Resolve guid wrapper deprecation
MODIFY
plex_trakt_sync/commands/inspect.py
plex_trakt_sync/commands/inspect.py
@@ -23,8 +23,8 @@ def inspect(input):
print(f"Inspecting: {m}")
media = m.item
- print(f"Guid: '{media.guid}'")
- print(f"Guids: {media.guids}")
+ print(f"Media.Guid: '{media.guid}'")
+ print(f"Media.Guids: {media.guids}")
if media.type in ["episode", "movie"]:
audio = media.media[0].parts[0].audioStreams()[0]
@@ -33,8 +33,9 @@ def inspect(input):
video = media.media[0].parts[0].videoStreams()[0]
print(f"Video: '{video.codec}'")
- print(f"Provider: {m.provider}")
- print(f"Id: {m.id}")
+ print(f"Guids:")
+ for guid in m.guids:
+ print(f" Guid: {guid}, Id: {guid.id}, Provider: {guid.provider}")
try:
tm = trakt.find_by_media(m)

MODIFY
plex_trakt_sync/plex_api.py
plex_trakt_sync/plex_api.py
@@ -193,7 +193,7 @@ def date_value(self, date):
return date
def __repr__(self):
- return "<%s:%s:%s>" % (self.provider, self.id, self.item)
+ return "<%s:%s:%s>" % (self.guid.provider, self.guid.id, self.item)
def to_json(self):
return {

MODIFY
plex_trakt_sync/trakt_api.py
plex_trakt_sync/trakt_api.py
@@ -271,7 +271,7 @@ def find_episode(self, tm: TVShow, pe: PlexLibraryItem, lookup=None):
except KeyError:
# Retry using search for specific Plex Episode
logger.warning("Retry using search for specific Plex Episode")
- if not pe.is_episode:
+ if not pe.guid.is_episode:
return self.find_by_media(pe)
return None

MODIFY
tests/test_new_agent.py
tests/test_new_agent.py
@@ -17,8 +17,10 @@ def test_tv_lookup():
type='show',
))
- assert m.provider == 'imdb'
- assert m.id == 'tt2661044'
+ guid = m.guid
+
+ assert guid.provider == 'imdb'
+ assert guid.id == 'tt2661044'
assert m.type == 'show'
@@ -31,6 +33,8 @@ def test_tv_lookup_none():
type='show',
))
- assert m.provider == 'none'
- assert m.id == '68178'
+ guid = m.guid
+
+ assert guid.provider == 'none'
+ assert guid.id == '68178'
assert m.type == 'show'

MODIFY
tests/test_plex_search.py
tests/test_plex_search.py
@@ -11,7 +11,9 @@ def test_plex_search():
assert len(results) == 1
m = results[0]
+ guid = m.guid
+
assert m.type == "show"
assert m.item.title == "The Addams Family (1964)"
- assert m.provider == "tvdb"
- assert m.id == "77137"
+ assert guid.provider == "tvdb"
+ assert guid.id == "77137"

Resolve guid wrapper deprecation