Skip to content

Commit

Permalink
fixup! fixup! fixup! Add trakt url support for inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Mar 30, 2024
1 parent 1fb6cbb commit 1aa3562
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions plextraktsync/plex/PlexIdFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ def from_url(url: str):
@classmethod
def from_trakt_url(cls, url: str):
path = urlparse(url).path
print(path)
from plextraktsync.factory import factory
from plextraktsync.trakt.TraktItem import TraktItem
plex = factory.plex_api

if path.startswith("/movies/"):
slug = path[len("/movies/"):]
tm = TraktItem(factory.trakt_api.find_by_slug(slug, "movie"))
print("tm", tm)
results = plex.search_by_guid(tm.guids, libtype=tm.type)
if results is None:
raise RuntimeError(f"Unable to find Plex Match: {url}")
Expand Down

0 comments on commit 1aa3562

Please sign in to comment.