Remove calice-score from read books

This commit is contained in:
Dominik Moritz Roth 2022-03-20 18:11:56 +01:00
parent 6ebe7d03fc
commit 4f116bc8bf

View File

@ -582,10 +582,13 @@ class calibreDB():
sco, rat = cls._requireCaliceColumn()
for bookId in tqdm(scores):
score = scores[bookId]
if sco:
cls._getTxt('set_custom calice_score '+str(bookId)+' '+str(round(score,5)))
if rat:
cls._getTxt('set_custom calice_rating '+str(bookId)+' '+str(int(round(score))))
if score == '<clear>':
cls._getTxt('set_custom calice_score '+str(bookId)+' ""')
else:
if sco:
cls._getTxt('set_custom calice_score '+str(bookId)+' '+str(round(score,5)))
if rat:
cls._getTxt('set_custom calice_rating '+str(bookId)+' '+str(int(round(score))))
def calice(G):
scores = {}
@ -594,6 +597,8 @@ def calice(G):
if node['t'] in ['book']:
if 'score' in node and node['score'] != None:
scores[node['calibreID']] = node['score']
elif 'rating' in node:
scores[node['calibreID']] = '<clear>'
calibreDB.writeCaliceColumnMultiple(scores)
print('Done.')