forked from platypush/platypush
Sync removed directories in the media index
This commit is contained in:
parent
b204d477ac
commit
4076cd3518
1 changed files with 7 additions and 0 deletions
|
@ -125,6 +125,13 @@ class LocalMediaSearcher:
|
||||||
if not dir_record:
|
if not dir_record:
|
||||||
dir_record = self._get_or_create_dir_entry(session, media_dir)
|
dir_record = self._get_or_create_dir_entry(session, media_dir)
|
||||||
|
|
||||||
|
if not os.path.isdir(media_dir):
|
||||||
|
self.logger.info('Directory {} is no longer accessible, removing it'.
|
||||||
|
format(media_dir))
|
||||||
|
session.query(MediaDirectory). \
|
||||||
|
filter(MediaDirectory.path=media_dir).delete()
|
||||||
|
return
|
||||||
|
|
||||||
stored_file_records = {
|
stored_file_records = {
|
||||||
f.path: f for f in self._get_file_records(dir_record, session) }
|
f.path: f for f in self._get_file_records(dir_record, session) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue