mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
8b1ca1d3bf
@ -108,10 +108,12 @@ class MTP_DEVICE(BASE):
|
|||||||
f = storage.find_path((self.DRIVEINFO,))
|
f = storage.find_path((self.DRIVEINFO,))
|
||||||
dinfo = {}
|
dinfo = {}
|
||||||
if f is not None:
|
if f is not None:
|
||||||
stream = self.get_mtp_file(f)
|
|
||||||
try:
|
try:
|
||||||
|
stream = self.get_mtp_file(f)
|
||||||
dinfo = json.load(stream, object_hook=from_json)
|
dinfo = json.load(stream, object_hook=from_json)
|
||||||
except:
|
except:
|
||||||
|
prints('Failed to load existing driveinfo.calibre file, with error:')
|
||||||
|
traceback.print_exc()
|
||||||
dinfo = None
|
dinfo = None
|
||||||
if dinfo.get('device_store_uuid', None) is None:
|
if dinfo.get('device_store_uuid', None) is None:
|
||||||
dinfo['device_store_uuid'] = unicode(uuid.uuid4())
|
dinfo['device_store_uuid'] = unicode(uuid.uuid4())
|
||||||
|
@ -678,11 +678,12 @@ class CoversModel(QAbstractListModel): # {{{
|
|||||||
good = []
|
good = []
|
||||||
pmap = {}
|
pmap = {}
|
||||||
dcovers = sorted(self.covers[1:], key=self.cover_keygen, reverse=True)
|
dcovers = sorted(self.covers[1:], key=self.cover_keygen, reverse=True)
|
||||||
|
cmap = {x:self.covers.index(x) for x in self.covers}
|
||||||
for i, x in enumerate(self.covers[0:1] + dcovers):
|
for i, x in enumerate(self.covers[0:1] + dcovers):
|
||||||
if not x[-1]:
|
if not x[-1]:
|
||||||
good.append(x)
|
good.append(x)
|
||||||
if i > 0:
|
if i > 0:
|
||||||
plugin = self.plugin_for_index(i)
|
plugin = self.plugin_for_index(cmap[x])
|
||||||
pmap[plugin] = len(good) - 1
|
pmap[plugin] = len(good) - 1
|
||||||
self.covers = good
|
self.covers = good
|
||||||
self.plugin_map = pmap
|
self.plugin_map = pmap
|
||||||
|
Loading…
x
Reference in New Issue
Block a user