mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-30 04:36:11 +01:00
Better handling of new books and custom_column_settings.
This commit is contained in:
parent
68381bc30b
commit
36bd28f90a
1 changed files with 4 additions and 1 deletions
|
|
@ -1622,7 +1622,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction):
|
|||
coldef = custom_columns[custcol]
|
||||
label = coldef['label']
|
||||
|
||||
if flag == 'r' or book['added']: # flag 'n' isn't actually needed--*always* set if configured and new book.
|
||||
if flag == 'r' or (flag == 'n' and book['added']):
|
||||
if coldef['datatype'] in ('int','float'): # for favs, etc--site specific metadata.
|
||||
if 'anthology_meta_list' in book and meta in book['anthology_meta_list']:
|
||||
# re-split list, strip commas, convert to floats, sum up.
|
||||
|
|
@ -1639,12 +1639,14 @@ class FanFictionDownLoaderPlugin(InterfaceAction):
|
|||
val = False
|
||||
else:
|
||||
val = None # for tri-state 'booleans'. Yes/No/Null
|
||||
#print("setting 'r' or 'added':%s"%val)
|
||||
db.set_custom(book_id, val, label=label, commit=False)
|
||||
|
||||
if flag == 'a':
|
||||
vallist = []
|
||||
try:
|
||||
existing=db.get_custom(book_id,label=label,index_is_id=True)
|
||||
#print("existing:%s"%existing)
|
||||
if isinstance(existing,list):
|
||||
vallist = existing
|
||||
elif existing:
|
||||
|
|
@ -1652,6 +1654,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction):
|
|||
except:
|
||||
pass
|
||||
|
||||
#print("vallist:%s"%vallist)
|
||||
if val:
|
||||
vallist.append(val)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue