Skip to content

Commit 98cb2c1

Browse files
committed
fix: skip unindexable items when resetting db
1 parent 5123567 commit 98cb2c1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/program/program.py

+4
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ def _init_db_from_symlinks(self):
421421
continue
422422

423423
enhanced_item = future.result()
424+
if not enhanced_item:
425+
errors.append(f"Failed to enhance {item.log_string} ({item.imdb_id}) with Trakt Indexer")
426+
continue
427+
424428
enhanced_item.store_state()
425429
session.add(enhanced_item)
426430
added_items.add(item.imdb_id)

src/program/services/scrapers/torbox.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def run(self, item: MediaItem) -> Dict[str, str]:
5555
elif e.response and e.response.status_code == 500:
5656
logger.log("NOT_FOUND", f"TorBox is caching request for {item.log_string}, will retry later")
5757
except Exception as e:
58-
logger.exception(f"TorBox exception thrown: {e}")
58+
if "418 Client Error" in str(e):
59+
logger.log("NOT_FOUND", f"TorBox has no metadata for item: {item.log_string}, unable to scrape")
60+
else:
61+
logger.exception(f"TorBox exception thrown: {e}")
5962
return {}
6063

6164
def _build_query_params(self, item: MediaItem) -> str:

0 commit comments

Comments
 (0)