downloads might be gone in shutdown

This commit is contained in:
j 2016-02-14 13:07:27 +05:30
parent f7d96747c0
commit 0689563c4d

View file

@ -130,7 +130,7 @@ class Item(db.Model):
j['timesaccessed'] = self.timesaccessed j['timesaccessed'] = self.timesaccessed
j['accessed'] = self.accessed j['accessed'] = self.accessed
j['added'] = self.added j['added'] = self.added
if state.downloads: if state.downloads and not state.shutdown:
t = state.downloads.transfers.get(self.id) t = state.downloads.transfers.get(self.id)
if t: if t:
j['transferadded'] = t['added'] j['transferadded'] = t['added']