Skip to content

Commit

Permalink
findMediaObject: Change title fallback to elif clause
Browse files Browse the repository at this point in the history
This way the media object will not fall back to only matching by title if title and year did not match to anything
  • Loading branch information
danielerl authored and razzeee committed May 29, 2024
1 parent e78d536 commit 3631480
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def findMediaObject(mediaObjectToMatch, listToSearch, matchByTitleAndYear):
year=mediaObjectToMatch["year"],
)
# match only by title, as some items don't have a year on trakt
if result is None and "title" in mediaObjectToMatch:
elif result is None and "title" in mediaObjectToMatch:
result = __findInList(listToSearch, title=mediaObjectToMatch["title"])

return result
Expand Down Expand Up @@ -521,11 +521,11 @@ def compareEpisodes(
in season_col2[season][ep]["ids"]
):
if "ids" in eps:
eps[ep]["ids"][
"episodeid"
] = season_col2[season][ep]["ids"][
"episodeid"
]
eps[ep]["ids"]["episodeid"] = (
season_col2[season][ep]["ids"][
"episodeid"
]
)
else:
eps[ep]["ids"] = {
"episodeid": season_col2[season][
Expand Down Expand Up @@ -558,11 +558,11 @@ def compareEpisodes(
in collectedSeasons[season][ep]["ids"]
):
if "ids" in eps:
eps[ep]["ids"][
"episodeid"
] = collectedSeasons[season][ep]["ids"][
"episodeid"
]
eps[ep]["ids"]["episodeid"] = (
collectedSeasons[season][ep]["ids"][
"episodeid"
]
)
else:
eps[ep]["ids"] = {
"episodeid": collectedSeasons[
Expand Down

0 comments on commit 3631480

Please sign in to comment.