View Single Post
Old 10-02-2012, 10:25 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,650
Karma: 5651616
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
I'm not the author of the script, but I know something about this.

Quote:
Originally Posted by Sharkus View Post
Does that set the "Name" and "InternalName" fields in the DB to the same value? My skills with python aren't that great so I'm unsure. If it does do this, great, if not, I'd suggest changing it so Name and InternalName are being set to the same value.

When testing the shelf sync on iOS we found if Name was set and InternalName was left blank, then the Touch would pick up the shelf, but on the next sync it seemed to create another shelf of the same name. We tracked it down to us not setting the InternalName as well as the Name. We looked at what Touch did and saw it set both, and once we did the same, everything worked as it should.
"Name" and "InternalName" have to be the same value. If they aren't, the shelf can't be deleted on the Touch.

As a curiosity, are shelf names in the iOS app case sensitive? And does it allow leading or trailing blanks? On the Touch you can create "aaa", " aaa", "aaa " and "AAA". In the list you can't see the difference between the first three. And personally, I would prefer them not to be case sensitive.
Quote:
One other thing to note is that iOS now supports shelf sync, previously it was Touch only, and thus if you were to create shelves, manually, or via this script, then if you sync your Touch, the shelves will sync, and if you happen to have the iOS app, and it syncs then it will pull down these shelves. If the books are in your Kobo Library, ie; not side-loaded, you will see them populate in the shelves. If they are side-loaded, well, you may end up with an empty shelf.
A similar thing happens with the Touch if you do a sync followed by a factory reset. The shelves come back, but only the kepubs are on them.
Quote:
If you delete that shelf on iOS then when you next sync the Touch the shelf will be removed as it's removed from the server.
I don't have a second device to test with, but I am sure the same would happen if you used two Touches that were signed in to the same Kobo account.

For anyone who does use this script, or otherwise creates a lot of shelves, there is a performance issue. The performance of shelf related actions is dependent on the number of shelves and the number of books on the shelves. By this I mean that 10 shelves with 100 books on each is as bad as 100 shelves with 10 books on them. Kobo is improving this, but I find that a WiFi sync doesn't work with a lot of books on shelves.

As taming said, there will be a new driver in calibre soon. It should be in one of the next two builds. It will support shelves in a similar fashion to this script, but you can specify one or more columns to use for the shelves. So, you could specify the tags column and the series column. And it will support the Glo and Mini.

Last edited by davidfor; 10-02-2012 at 10:28 AM. Reason: slight edit because taming beat me.
davidfor is online now   Reply With Quote