Skip to content

Commit

Permalink
Merge pull request #33 from dbatten5/cover-photo
Browse files Browse the repository at this point in the history
Cover photo
  • Loading branch information
dbatten5 authored Nov 16, 2021
2 parents 927e3cb + c7b59a3 commit 57dbe6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "phylm"
version = "4.0.5"
version = "4.1.0"
description = "Phylm"
authors = ["Dom Batten <[email protected]>"]
license = "MIT"
Expand Down
11 changes: 10 additions & 1 deletion src/phylm/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
2 changes: 1 addition & 1 deletion tests/unit/tools/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 57dbe6f

Please sign in to comment.