Thread: Library names
View Single Post
Old 02-27-2011, 04:19 AM   #5
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I see how to set/get the data in the DB, although like Chaley I'm a little hesitant.

Is there a naming convention I should use for plugin data (# is user, @ is category, etc.), e.g. name_plugin_setting, or plugin_MyName_setting, etc. to avoid clashes.

This data will be persistent after the plugin is removed, and unlike a file can't be deleted. I suppose I could provide a delete customizations button on the customization window like reset all which could be used before the plugin is removed.

The reason I want to do settings per library is because the columns/categories change per library - and if I use a file that's not aware of libraries then the old data would get re-written on each library switch.

I guess if the library did contain a unique ID, if you just copied it as mentioned, then I couldn't tell the difference between the 2 libraries based on the ID (unless to 'copy' a db you had to export it and this cleared the ID).

In my customization window I could provide a 'Library name' which could be overridden by the user in case of a rename. These are likely to be rare with this plugin, but its interesting to make sure the plugin is flexible - but not confusing to the user.

I'm also debating how to store config settings per device. Either I put the config settings on the device (JSONConfig forces the path to be in Calibre's config_dir so I'd have to use my own version), or I store the device name in a central settings store. But since the Kindle has no unique identifier accessible to me, I'd have to store a name in a file anyway, or just allow the user to select a profile (or most likely a combination of default name/selection).

I was just about to finish testing too - always one more thing to go in before the next version
meme is offline   Reply With Quote