Add typing to trakt.search_by_id return value
MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
from __future__ import annotations
from time import time
-from typing import Union
+from typing import List, Optional, Union
import trakt
import trakt.movies
@@ -309,7 +309,7 @@ def find_by_guid(self, guid: PlexGuid):
@rate_limit()
@retry()
- def search_by_id(self, media_id: str, id_type: str, media_type: str):
+ def search_by_id(self, media_id: str, id_type: str, media_type: str) -> Optional[List[TVShow, Movie]]:
if id_type == "tvdb" and media_type == "movie":
# Skip invalid search.
# The Trakt API states that tvdb is only for shows and episodes:

Add typing to trakt.search_by_id return value