Rename find_movie to more appropriate find_by_media
MODIFY
plex_trakt_sync/commands/inspect.py
plex_trakt_sync/commands/inspect.py
@@ -36,7 +36,7 @@ def inspect(input):
try:
print(f"Provider: {m.provider}")
print(f"Id: {m.id}")
- tm = trakt.find_movie(m)
+ tm = trakt.find_by_media(m)
print(f"Trakt match: {tm}")
except Exception as e:
print(f"Error: {e}")

MODIFY
plex_trakt_sync/commands/sync.py
plex_trakt_sync/commands/sync.py
@@ -113,7 +113,7 @@ def for_each_pair(sections, trakt: TraktApi):
)
continue
- tm = trakt.find_movie(pm)
+ tm = trakt.find_by_media(pm)
if tm is None:
logger.warning(f"Skipping {pm}: Not found on Trakt")
continue

MODIFY
plex_trakt_sync/commands/watch.py
plex_trakt_sync/commands/watch.py
@@ -52,7 +52,7 @@ def filter_media(self, message):
if not pm:
continue
- tm = self.trakt.find_movie(pm)
+ tm = self.trakt.find_by_media(pm)
if not tm:
continue

MODIFY
plex_trakt_sync/trakt_api.py
plex_trakt_sync/trakt_api.py
@@ -201,7 +201,7 @@ def lookup(self, tm: TVShow):
@memoize
@rate_limit()
- def find_movie(self, media: PlexLibraryItem):
+ def find_by_media(self, media: PlexLibraryItem):
try:
search = trakt.sync.search_by_id(media.id, id_type=media.provider, media_type=media.type)
except JSONDecodeError as e:

MODIFY
tests/test_tv_lookup.py
tests/test_tv_lookup.py
@@ -14,7 +14,7 @@ def make(cls=None, **kwargs):
def test_tv_lookup():
m = PlexLibraryItem(make(cls='plexapi.video.Show', guid='imdb://tt10584350', type='show'))
- tm = trakt.find_movie(m)
+ tm = trakt.find_by_media(m)
lookup = trakt.lookup(tm)
te = lookup[1][2].instance

Rename find_movie to more appropriate find_by_media