mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use unicode instead of str when typecasting
This commit is contained in:
parent
72e7d29690
commit
6634b010f8
@ -162,7 +162,7 @@ class KTCollectionsBookList(CollectionsBookList):
|
|||||||
elif fm is not None and fm['datatype'] == 'series':
|
elif fm is not None and fm['datatype'] == 'series':
|
||||||
val = [orig_val]
|
val = [orig_val]
|
||||||
elif fm is not None and fm['datatype'] == 'rating':
|
elif fm is not None and fm['datatype'] == 'rating':
|
||||||
val = [str(orig_val / 2)]
|
val = [type(u'')(orig_val / 2.0)]
|
||||||
elif fm is not None and fm['datatype'] == 'text' and fm['is_multiple']:
|
elif fm is not None and fm['datatype'] == 'text' and fm['is_multiple']:
|
||||||
if isinstance(orig_val, (list, tuple)):
|
if isinstance(orig_val, (list, tuple)):
|
||||||
val = orig_val
|
val = orig_val
|
||||||
@ -207,7 +207,7 @@ class KTCollectionsBookList(CollectionsBookList):
|
|||||||
if not category:
|
if not category:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cat_name = str(category).strip(' ,')
|
cat_name = type(u'')(category).strip(' ,')
|
||||||
|
|
||||||
if cat_name not in collections:
|
if cat_name not in collections:
|
||||||
collections[cat_name] = {}
|
collections[cat_name] = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user