dont fail in folders with spaces

This commit is contained in:
j 2014-05-20 12:30:53 +02:00
commit 4d1d96c07c
2 changed files with 21 additions and 21 deletions

View file

@ -31,13 +31,14 @@ def remove_missing():
with app.app_context():
prefs = settings.preferences
prefix = os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/')
for f in File.query:
path = f.item.get_path()
if not os.path.exists(path):
dirty = True
f.item.remove_file()
if dirty:
db.session.commit()
if os.path.exists(prefix):
for f in File.query:
path = f.item.get_path()
if not os.path.exists(path):
dirty = True
f.item.remove_file()
if dirty:
db.session.commit()
def add_file(id, f, prefix):
user = state.user()