Skip to content

Commit

Permalink
Handle fileless scenes in Filename scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
Maista6969 committed Jul 12, 2024
1 parent 1f98d61 commit 5536b88
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scrapers/Filename/Filename.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ def title_from_filename(js):
}""",
{"id": scene_id},
)
assert response is not None
path = response["findScene"]["files"][0]["path"]
filename = os.path.basename(path)
if not response:
return None

files = response["findScene"]["files"]
if not files:
log.warning(f"Skipping scene {scene_id} as it has no files")
return None

filename = os.path.basename(files[0]["path"])
if REMOVE_EXT:
filename = os.path.splitext(filename)[0]

if scene_title != filename:
log.info(
f"Scene {scene_id}: Title differs from filename: '{scene_title}' => '{filename}'"
Expand Down

0 comments on commit 5536b88

Please sign in to comment.