View Single Post
Old 08-25-2014, 08:50 AM   #4
ahisham
Junior Member
ahisham began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2014
Device: none
Hi,

I tried to use the "mi.set_user_metadata(col_name, col)" as in count pages plugin. However, it uses the "col" variable that results from "db.field_metadata.custom_field_metadata()" function.

In "src/calibre/ebooks/metadata/sources/amazon.py", I want to set a value in custom genre column. However, I don't have access to the above function (since "self.gui" is undefined). I tried to use this code instead:

Code:
um = {'#genre': {'#value#':genres, 'datatype':'text','is_multiple': '|', 'name': u'Genre'}}
mi.set_all_user_metadata(um)
but it just fails without error message!

with this code:
Code:
um = {'#genre': {'#value#':genres, 'datatype':'text','is_multiple': None, 'name': u'Genre'}}
mi.set_all_user_metadata(um)
with genres as string, it completes but the genres are not saved!!

Could you please help me with correct way of doing it ?

Thanks
ahisham is offline   Reply With Quote