From 57fab12f4e738a8f0235cb00f5a8db062c5759dc Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Sat, 15 Feb 2025 00:06:01 +0100 Subject: [PATCH] Check if entry is valid before returning --- syng/sources/source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syng/sources/source.py b/syng/sources/source.py index 1457902..666d290 100644 --- a/syng/sources/source.py +++ b/syng/sources/source.py @@ -162,7 +162,7 @@ class Source(ABC): return None res: Result = Result.from_filename(ident, self.source_name) - return Entry( + entry = Entry( ident=ident, source=self.source_name, duration=180, @@ -172,6 +172,9 @@ class Source(ABC): performer=performer, incomplete_data=True, ) + if not await self.is_valid(entry): + return None + return entry async def search(self, query: str) -> list[Result]: """