Browse Source

fix indexer on missing files

Olivier Massot 4 years ago
parent
commit
4b40927843
1 changed files with 3 additions and 2 deletions
  1. 3 2
      core/indexer.py

+ 3 - 2
core/indexer.py

@@ -77,9 +77,10 @@ class Discoverer(CyclicThread):
                 continue
 
             filename = Path(filename)
-            if not filename.exists():
+            if not filename.exists() and track.status != Track.STATUS_UNAVAILABLE:
                 self.indexer.put(track.id)
 
+
 class Indexer(CyclicThread):
 
     def __init__(self):
@@ -116,7 +117,7 @@ class Indexer(CyclicThread):
             filename = Path(track.path)
             track_hash = track.hash
 
-            if not filename.exists():
+            if not filename.exists() and track.status != Track.STATUS_UNAVAILABLE:
                 logger.debug('Index - missing: %s' % filename)
                 track.status = Track.STATUS_UNAVAILABLE
                 track_repo.commit()