Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

First and last episode on a multi-episode file #19

Closed
cxhamilton opened this issue Jun 21, 2017 · 10 comments
Closed

First and last episode on a multi-episode file #19

cxhamilton opened this issue Jun 21, 2017 · 10 comments

Comments

@cxhamilton
Copy link
Contributor

cxhamilton commented Jun 21, 2017

The Plex naming convention for a multi-episode file is: ShowName - sXXeYY-eZZ.ext, where YY is the first episode and ZZ is the last episode.

The magic comes in eYY-eZZ for Plex to understand the span of episodes.

Based on the documentation, it appears as though VideoSort will append all episodes with the EpisodeSeparator in between.

i.e. ShowName.S01E01E02E03E04E05.ext.

Plex Media Scanner stops parsing after E01E02, no matter how many "EXX" follows.

@hugbug What are your thoughts on me adding something like:

%el - first and last episode number (1, 2)
%0el - two-digits first and last episode number (01, 02)

episode_list = guess.get('episodeList')
episode_separator + episode_list[0] + '-' + episode_separator + episode_list[-1]

Thanks!

@hugbug
Copy link
Member

hugbug commented Jun 22, 2017

Maybe better a new option to set how build episode lists? Something like EpisodeList=(list, range) and then use EpisodeSeparator as range separator instead of hardcoding -?

@hugbug
Copy link
Member

hugbug commented Jun 22, 2017

FYI: I've just updated guessit to the latest version. Make sure to pull the latest version before adding your changes.
In guessit2 episodes are in episode instead of episodeList.

Please also add new tests (see #21).

@cxhamilton
Copy link
Contributor Author

cxhamilton commented Jun 26, 2017

You still need EpisodeSeparator to prefix the first and last episode number. If your concern is a hardcoded value (-), then I would recommend that we add RangeSeparator=-. This is a minor and very simple extension to the original proposal.

%er - first and last episode in range (1, 2)
%0er - two-digits first and last episode in range (01, 02)

@hugbug
Copy link
Member

hugbug commented Jun 26, 2017

We don't need a prefix for first episode number as it's part of format string (for example S%0sE%0e).

In the end both solutions will work but I think the one with EpisodeList-option is less complex as it doesn't introduce new formatting variables and works more like a fine tuning for existing %e.

We probably should set the options EpisodeSeparator and EpisodeList to defaults suitable for Plex as it's probably the most widely used library manager.

@cxhamilton
Copy link
Contributor Author

cxhamilton commented Jun 27, 2017

Got it. I think I misunderstood your initial response. I want to make sure that we are on the same page.

If a user selects EpisodeList=list, EpisodeSeparator remains the episode number prefix and current behavior would prevail.

If a user selects EpisodeList=range, EpisodeSeparator becomes a customizable character that separates the first and last episodes. Plex still expects "E" (or "e") as an episode number prefix. Does that become a hardcoded value when EpisodeSeparator has been repurposed?

Would it make sense to leave EpisodeSeparator as-is and add RangeSeparator for the new use case?

@hugbug
Copy link
Member

hugbug commented Jun 27, 2017

For Plex you can set:

EpisodeList=list
EpisodeSeparator=-E

Should produce for example Show.name.S01E01-E03.


EpisodeList=list sounds strange. Maybe use another name. What about MultiEpisode=(list, range), better or worse?

@cxhamilton
Copy link
Contributor Author

MultiEpisode=(list, range) makes sense and looks better.

I understand how EpisodeSeparator=-E works for separating the two episodes i.e. Show.name.S01E01 -E 03, but what would you use to determine the first "E" i.e. Show.name.S01 E 01-E03? Am I missing something?

@hugbug
Copy link
Member

hugbug commented Jun 28, 2017

Look at your formatting string (option SeriesFormat), the first E is already there.

@cxhamilton
Copy link
Contributor Author

Sounds good. I have submitted a PR.

@hugbug
Copy link
Member

hugbug commented Jul 2, 2017

Merged #22.

@hugbug hugbug closed this as completed Jul 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants