double check that volume is still around, only flag files as missing

This commit is contained in:
j 2019-02-13 12:36:25 +05:30
commit 8928b5447b
3 changed files with 66 additions and 14 deletions

View file

@ -556,6 +556,11 @@ class Item(db.Model):
return True
return False
def missing_file(self):
logger.debug('file is missing! %s: %s', self.id, self.get_path())
self.info['missing'] = True
state.db.session.add(self)
def remove_file(self):
for f in self.files.all():
path = f.fullpath()