mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
d278180bde
commit
7b2a947a86
@ -129,6 +129,7 @@ class MTP_DEVICE(BASE):
|
||||
cached_metadata = bl[idx]
|
||||
del relpath_cache[relpath]
|
||||
if cached_metadata.size == mtp_file.size:
|
||||
cached_metadata.datetime = mtp_file.last_modified.timetuple()
|
||||
debug('Using cached metadata for',
|
||||
'/'.join(mtp_file.full_path))
|
||||
continue # No need to update metadata
|
||||
@ -148,6 +149,7 @@ class MTP_DEVICE(BASE):
|
||||
'/'.join(mtp_file.full_path))
|
||||
traceback.print_exc()
|
||||
book.size = mtp_file.size
|
||||
book.datetime = mtp_file.last_modified.timetuple()
|
||||
|
||||
# Remove books in the cache that no longer exist
|
||||
for idx in sorted(relpath_cache.itervalues(), reverse=True):
|
||||
|
@ -14,7 +14,7 @@ from future_builtins import map
|
||||
from datetime import datetime
|
||||
|
||||
from calibre import human_readable, prints, force_unicode
|
||||
from calibre.utils.date import local_tz
|
||||
from calibre.utils.date import local_tz, as_utc
|
||||
from calibre.utils.icu import sort_key, lower
|
||||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
|
||||
@ -40,6 +40,7 @@ class FileOrFolder(object):
|
||||
self.last_modified = datetime.fromtimestamp(md, local_tz)
|
||||
except:
|
||||
self.last_modified = datetime.fromtimestamp(0, local_tz)
|
||||
self.last_modified = as_utc(self.last_modified)
|
||||
|
||||
if self.storage_id not in self.all_storage_ids:
|
||||
raise ValueError('Storage id %s not valid for %s, valid values: %s'%(self.storage_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user