Skip to content

Populate series info for Plex episodes#1313

Merged
liiight merged 1 commit intoFlexget:developfrom
pkoenig10:develop
Aug 7, 2016
Merged

Populate series info for Plex episodes#1313
liiight merged 1 commit intoFlexget:developfrom
pkoenig10:develop

Conversation

@pkoenig10
Copy link
Copy Markdown
Contributor

@pkoenig10 pkoenig10 commented Aug 6, 2016

Motivation for changes:

Sometimes I download episodes into my Plex server through channels other than Flexget. I would like to mark these episodes as seen/downloaded in Flexget. Currently the series plugin cannot be used with Plex episode entries because the necessary field are not set, although the information is available. These changes set the relevant fields so Flexget can get metainfo about Plex episodes.

Detailed changes:

Added the fields series_name, series_season, series_episode, series_id_type, and series_id for Plex episode entires. The necessary info was already used in Flexget for setting other fields, so my changes are entirely setting these fields.

@liiight
Copy link
Copy Markdown
Member

liiight commented Aug 6, 2016

Will this work with episodes by date?

@pkoenig10
Copy link
Copy Markdown
Contributor Author

Updated the commit to handle episodes by date.

@liiight
Copy link
Copy Markdown
Member

liiight commented Aug 6, 2016

Also, will this support other media types? Plex has music, movies etc libraries...

@pkoenig10
Copy link
Copy Markdown
Contributor Author

pkoenig10 commented Aug 6, 2016

These changes are exclusive to entries determined to be Plex episodes.

As for movies, the only fields used by the movies metainfo plugins are title, imdb_id, and tmdb_id. Plex already provides the title. In most cases the title is sufficient to obtain the correct metainfo (although there is certainly the possibility of error).

Plex can provide the imdb_id for movies and the tvdb_id for TV shows by parsing urls that look like com.plexapp.agents.imdb://tt0338751?lang=en or com.plexapp.agents.thetvdb://248742/1/1?lang=en. But at that point we are just replacing Flexget lookup with Plex lookup. This seems like a poor decision because we lose control over the metainfo lookup logic for Plex entries. However I would be more than willing to add that as well if you think it would be a desired modification.

For other media (music, photos, and home videos), there aren't any metainfo plugins for these types of content, so there isn't any work to be done in this PR.

@liiight
Copy link
Copy Markdown
Member

liiight commented Aug 6, 2016

I got no issues with relying on metainfo retrieved via Plex or any other input source for that matter. The rare situation that the metadata is incorrect in the source does not match up to the advantage of adding metadata without needing additional lookup.

I was wondering if you added a check that knows if it should populate movie or series fields based on content type or library type or whatever

@pkoenig10
Copy link
Copy Markdown
Contributor Author

pkoenig10 commented Aug 6, 2016

Okay, I'll add the metainfo id parsing to this PR.

That check already existed in this plugin (see the variable viewgroup). That info is determined in the XML returned by Plex. I'm using that to determine which fields to populate.

@pkoenig10 pkoenig10 changed the title Populate series info for Plex episodes Populate metainfo fields for Plex entries Aug 7, 2016
@pkoenig10 pkoenig10 changed the title Populate metainfo fields for Plex entries Populate series info for Plex episodes Aug 7, 2016
@pkoenig10
Copy link
Copy Markdown
Contributor Author

Currently, Flexget makes a single request to Plex and receives an XML response containing of list with limited info about the requested items in Plex. This limited info does not include the fields necessary to populate the imdb_id or tvdb_id. In order to populate these fields, Flexget would have to make an additional request for each entry listed in the original response. While this is certainly possible, it is outside the scope of this commit.

As I mentioned earlier, the info returned by Plex is almost always sufficient to retrieve movie metainfo using other plugins. This PR was motivated by the desire the ensure that the Plex plugin provides enough info for other metainfo plugins to retrieve info about series episodes.

@liiight liiight merged commit c22fd89 into Flexget:develop Aug 7, 2016
@liiight
Copy link
Copy Markdown
Member

liiight commented Aug 7, 2016

Fair enough, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants