Prevent the scanner from running on non-video files

This commit is contained in:
Zoe Roux 2023-04-04 23:28:52 +09:00
parent 5acd231292
commit bb716ab6b6

View File

@ -41,9 +41,15 @@ class Scanner:
@log_errors
async def identify(self, path: Path):
if await self.is_registered(path):
return
raw = guessit(path, "--episode-prefer-number")
if (
not "mimetype" in raw
or not raw["mimetype"].startswith("video")
or await self.is_registered(path)
):
return
logging.info("Identied %s: %s", path, raw)
# TODO: Add collections support