From c39832e9178198556f9548ae9c87cd2770e38bba Mon Sep 17 00:00:00 2001 From: sdaqo Date: Sat, 1 Jun 2024 15:35:15 +0200 Subject: [PATCH] fix: do not try to map anime with empty string This commit fixes an issue where the mal api gives use a synonym as an empty string (it should normally return null). If trying to map to the provider it can happen that the empty string triggers a download of the whole anime catalouge of the provider, we do not want this! --- api/pyproject.toml | 2 +- api/src/anipy_api/__init__.py | 2 +- api/src/anipy_api/mal.py | 3 +++ cli/pyproject.toml | 4 ++-- cli/src/anipy_cli/__init__.py | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/pyproject.toml b/api/pyproject.toml index a5f0caa2..352345e8 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "anipy-api" -version = "3.1.3" +version = "3.1.4" description = "api for anipy-cli" authors = ["sdaqo "] license = "GPL-3.0" diff --git a/api/src/anipy_api/__init__.py b/api/src/anipy_api/__init__.py index b76f3905..05d9d4a8 100644 --- a/api/src/anipy_api/__init__.py +++ b/api/src/anipy_api/__init__.py @@ -1,2 +1,2 @@ __appname__ = "anipy-api" -__version__ = "3.1.3" +__version__ = "3.1.4" diff --git a/api/src/anipy_api/mal.py b/api/src/anipy_api/mal.py index 00951042..35c5cc3e 100644 --- a/api/src/anipy_api/mal.py +++ b/api/src/anipy_api/mal.py @@ -625,6 +625,9 @@ def from_myanimelist( results: Set[ProviderSearchResult] = set() for title in mal_titles: + if len(title) == 0: + continue + results |= set(self.provider.get_search(title)) if use_filters: results |= set(self.provider.get_search(title, provider_filters)) diff --git a/cli/pyproject.toml b/cli/pyproject.toml index a487e01d..859b368f 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "anipy-cli" -version = "3.1.3" +version = "3.1.4" description = "Watch and Download anime from the comfort of your Terminal" authors = ["sdaqo "] license = "GPL-3.0" @@ -20,7 +20,7 @@ yaspin = "^3.0.2" inquirerpy = "^0.3.4" appdirs = "^1.4.4" pypresence = "^4.3.0" -anipy-api = "^3.1.3" +anipy-api = "^3.1.4" [tool.poetry.scripts] anipy-cli = "anipy_cli.cli:run_cli" diff --git a/cli/src/anipy_cli/__init__.py b/cli/src/anipy_cli/__init__.py index a29df2e7..22f35bf6 100644 --- a/cli/src/anipy_cli/__init__.py +++ b/cli/src/anipy_cli/__init__.py @@ -1,2 +1,2 @@ __appname__ = "anipy-cli" -__version__ = "3.1.3" +__version__ = "3.1.4"