From 82d1c869b747b745906424a7aa2c76405ac678f3 Mon Sep 17 00:00:00 2001 From: Dom Batten Date: Tue, 16 Nov 2021 14:57:46 +0000 Subject: [PATCH 1/2] fix cover photo url key name --- src/phylm/tools.py | 11 ++++++++++- tests/unit/tools/test_tools.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/phylm/tools.py b/src/phylm/tools.py index e599102..e09d445 100644 --- a/src/phylm/tools.py +++ b/src/phylm/tools.py @@ -19,4 +19,13 @@ def search_movies(query: str) -> List[Dict[str, Union[str, int]]]: """ results: List[Movie] = ia.search_movie(query) - return [{**r.data, "imdb_id": r.movieID} for r in results] + return [ + { + "title": r.data.get("title"), + "kind": r.data.get("kind"), + "year": r.data.get("year"), + "imdb_id": r.movieID, + "cover_photo": r.data.get("cover url"), + } + for r in results + ] diff --git a/tests/unit/tools/test_tools.py b/tests/unit/tools/test_tools.py index 74ec0c5..61c5438 100644 --- a/tests/unit/tools/test_tools.py +++ b/tests/unit/tools/test_tools.py @@ -39,4 +39,4 @@ def test_results(self, mock_ia: MagicMock, the_matrix: List[Movie]) -> None: assert result[0]["imdb_id"] == "0133093" assert result[0]["title"] == "The Matrix" assert result[0]["year"] == 1999 - assert result[0]["cover url"] + assert result[0]["cover_photo"] From c7b59a394f7f3e953ab81c7ba9e60331dd2d2a70 Mon Sep 17 00:00:00 2001 From: Dom Batten Date: Tue, 16 Nov 2021 15:00:48 +0000 Subject: [PATCH 2/2] bump poetry version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a4fcb8..8df638a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "phylm" -version = "4.0.5" +version = "4.1.0" description = "Phylm" authors = ["Dom Batten "] license = "MIT"