Check if entry is valid before returning
This commit is contained in:
parent
91dec5bcd9
commit
57fab12f4e
1 changed files with 4 additions and 1 deletions
|
@ -162,7 +162,7 @@ class Source(ABC):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
res: Result = Result.from_filename(ident, self.source_name)
|
res: Result = Result.from_filename(ident, self.source_name)
|
||||||
return Entry(
|
entry = Entry(
|
||||||
ident=ident,
|
ident=ident,
|
||||||
source=self.source_name,
|
source=self.source_name,
|
||||||
duration=180,
|
duration=180,
|
||||||
|
@ -172,6 +172,9 @@ class Source(ABC):
|
||||||
performer=performer,
|
performer=performer,
|
||||||
incomplete_data=True,
|
incomplete_data=True,
|
||||||
)
|
)
|
||||||
|
if not await self.is_valid(entry):
|
||||||
|
return None
|
||||||
|
return entry
|
||||||
|
|
||||||
async def search(self, query: str) -> list[Result]:
|
async def search(self, query: str) -> list[Result]:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue