Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Plex Movie Scanner #82

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,31 @@ def process_movie_section(s, watched_set, ratings_dict, listutil, collection):
x = guid.split('//')[1]
x = x.split('?')[0]
provider = CONFIG['xbmc-providers']['movies']
elif 'plex:' in guid:
# We can't use the guid for this as it's not going to match Trakt.
x = movie.title
provider = 'plex'
# We'll do a name based query against Trakt for the Plex Movie Scanner
# It's a lot looser, but we'll do our best to match it up.
# It's more likely we'd get misses than false positives.
else:
logging.error('Movie [{} ({})]: Unrecognized GUID {}'.format(
movie.title, movie.year, movie.guid))
continue
raise NotImplementedError()
# search and sync movie
try:
search = trakt.sync.search_by_id(x, id_type=provider)
search = []
if ( provider == 'plex' ):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( provider == 'plex' ):
if provider == 'plex':

superfluous parens can be dropped

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's cool with you, I'd like to follow both of your suggestions.

I'll remove the parens (I am 99.99% a Java guy), kill this PR, and start a new one that's from a non-master branch.

I hope killing the PR and starting a new one doesn't cause you any additional concern.

Thanks again!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can force push to the same branch you created the pr, and PR will update. no need to create new PR.

you can also apply the suggestion from web. there's UI for that. but you want then probably git squash the commit locally (and the force push).

find = trakt.sync.get_search_results(x, ['movie'], False)
for f in find:
if f.media.title == movie.title and f.media.year == movie.year:
# Title and year match ... pretty highly likely match.
# Possible that the year could have been added to the query, but this
# feels more concrete (in other words, we'd want to check anyhow)
search.append(f.media)
else:
search = trakt.sync.search_by_id(x, id_type=provider)
m = None
# look for the first movie in the results
for result in search:
Expand Down