Merge pull request #60 from mk-fg/dont_update_mtime_for_different_path

library: don't set/update item mtime if read-path is passed to read()
This commit is contained in:
Adrian Sampson 2012-10-20 17:05:34 -07:00
commit b58e0ed7fc

View file

@ -283,12 +283,13 @@ class Item(object):
for key in ITEM_KEYS_META:
setattr(self, key, getattr(f, key))
self.path = read_path
# Database's mtime should now reflect the on-disk value.
if read_path == self.path:
self.mtime = self.current_mtime()
self.path = read_path
def write(self):
"""Writes the item's metadata to the associated file.
"""