mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More human friendly library ids
This commit is contained in:
parent
1adebcc700
commit
e6a98f5478
@ -7,11 +7,11 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from binascii import hexlify
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
|
from calibre import force_unicode, filesystem_encoding
|
||||||
from calibre.db.cache import Cache
|
from calibre.db.cache import Cache
|
||||||
from calibre.db.legacy import create_backend, LibraryDatabase
|
from calibre.db.legacy import create_backend, LibraryDatabase
|
||||||
from calibre.srv.auth import AuthController
|
from calibre.srv.auth import AuthController
|
||||||
@ -36,7 +36,7 @@ class LibraryBroker(object):
|
|||||||
seen.add(path)
|
seen.add(path)
|
||||||
if not LibraryDatabase.exists_at(path):
|
if not LibraryDatabase.exists_at(path):
|
||||||
continue
|
continue
|
||||||
bname = library_id = hexlify(os.path.basename(path).encode('utf-8')).decode('ascii')
|
bname = library_id = force_unicode(os.path.basename(path), filesystem_encoding)
|
||||||
c = 0
|
c = 0
|
||||||
while library_id in self.lmap:
|
while library_id in self.lmap:
|
||||||
c += 1
|
c += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user