Skip to content

Season packs support - Phase 1#1710

Merged
liiight merged 64 commits intodevelopfrom
season_packs
Apr 3, 2017
Merged

Season packs support - Phase 1#1710
liiight merged 64 commits intodevelopfrom
season_packs

Conversation

@liiight
Copy link
Copy Markdown
Member

@liiight liiight commented Feb 26, 2017

Motivation for changes:

Native season pack support is long overdue. Design

Detailed changes:

  • Added basic support for season pack type in parser
  • Added Season table in series DB
  • Added logical test when tracking series for checking if season pack has been downloaded
  • Split Release table to EpisodeRelease and SeasonRelease
  • Added 4 modes for season_packs config: boolean, integer, always and 'only'. These will affect episode threshold control:
    By default (or by passing season_packs: yes the default episode threshold will be set to 0, meaning that if a series has 1 or more episode with a downloaded release, a season pack will be rejected.
    By passing a specific integer (season_packs: 5 for example), that threshold can be raised.
    Setting season_packs: always will always accept the season pack, regardless of how many episodes were already downloaded for the series.
    By setting season_packs: only, series plugin will accept only season packs, and reject all episodes.
    All modes still abide to checking if season is not completed.
  • Added lookup by season to api_tvmaze, tvmaze_lookup and est_release_series_tvmaze

Config usage if relevant (new plugin or updated schema):

series:
- foo:
    season_packs: yes
- baz:
    season_packs: 5
- boo:
    season_packs: always
- bla:
    season_packs: only

Existing issues:

  • Guessit does not support season pack ATM. Its parser will always return False on the is_season_pack call.

To Do:

  • Create a default threshold that'll check if any existing eps for the season have already been downloaded before accepting season pack.
    - [ ] Add support for partial season packs (will not mark season as complete) TBD, this does not fit well with the current DB relations and flow
  • DB Migration. Will do this when DB schema will lock.
  • More tests.
  • Edit next_series_episodes to take completed season into account.
  • Create next_series_seasons
  • Enable estimators to search for season
  • Verify no metadata plugins crash.
  • Fix series CLI


def __eq__(self, other):
if not isinstance(other, Season):
return NotImplemented
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

raise?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oops

@gazpachoking
Copy link
Copy Markdown
Member

With regards to guessit, when it returns type 'episode' with a season, but not an episode number, is that a reliable indication of season pack?

Also, from IRC: Switch (at least by default) to not download season packs once individual episodes have already been downloaded from a given season. Possibly allow an option to define how many individual eps are allowed to be downloaded and still consider getting a full season pack.

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Mar 3, 2017

Dunno about guessit, even if that were to case, I plan to add support for partial season packs (Foo.S01.PART1-Flexget) and that would require explicit support.

@Toilal does guessit have /will have explicit season pack support?

@Toilal
Copy link
Copy Markdown
Member

Toilal commented Mar 4, 2017 via email

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Mar 4, 2017

Oh, I guess its a matter of just updating the flexget plugin. You have an open pr for this right?

@Toilal
Copy link
Copy Markdown
Member

Toilal commented Mar 4, 2017 via email

Copy link
Copy Markdown
Member

@gazpachoking gazpachoking left a comment

Choose a reason for hiding this comment

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

I like the recent changes. I'm wondering if the logic dealing with comparing seasons to episodes should be more explicitly handled, rather than comparing against an unknown season/entity object. (I'm not sure the way you are doing it is bad though, just a vague notion I had.)


@property
def is_season(self):
return False
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where are we using the Episode model where we have to ask if it's a season? Also, if this actually makes sense, how about just is_season = False rather than making a property method?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We're using it in a bunch of places actually, like

for entity, entries in sorted(series_entries.items(), key=lambda e: (e[0].is_season, e[0].season or -1),

What's the benefit of setting a class variable as opposed to a property method?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nm, did it already, pushing soon

def __eq__(self, other):
if not isinstance(other, Episode):
return NotImplemented
if not isinstance(other, (Episode, Season)):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An episode can be equal to a season?

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Mar 16, 2017

I changed a lot of the comparison stuff. A lot of it was just dumb copy paste form Episode. It should make more sense now

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

I installed this branch for testing. From my (admittedly limited) testing this is not working with all_series - nothing is being decided upon and there are no series_* fields in the entry dump. Is resolving this within the scope of Phase 1?

(test filename: Show.Name.S02.720p.HDTV.x264-GROUP.torrent)

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

Thanks for testing. Please paste config and debug logs. Admittedly, I did not test this with all_series at all

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

Here it is. I should've posted that in the first place, my bad.

Config:

templates:
  watchdir_filesystem_tv:
    filesystem:
      path: "/path/to/torrents/tv"
      mask: '*.torrent'
  watchdir_move:
    move:
      to: '/path/to/torrents/_processed/'
  watchdir_disable:
    disable:
      - seen_info_hash
      - seen

tasks:
  watchdir_tv_eps:
    manual: yes
    template:
      - deluge-connect_tv
      - notify_tv
      - watchdir_disable
      - watchdir_move
      - watchdir_filesystem_tv
    set:
      tracker: tv
      step: 1
      notify_title: 'TV - Watch to Deluge'
    no_entries_ok: yes
    all_series:
      tracking: no
      season_packs: yes

Debug log:
https://gist.github.com/tubedogg/1caeb1cdf3b4949ab4b9d1207a21d111

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

Hmm, looks like it didn't parse that to be a season pack.
Please set the value here to debug and run again.

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

The only thing that added to the log was this:

2017-04-02 01:48 DEBUG    seriesparser  watchdir_tv_eps No name for series `Show.Name.S02.720p.HDTV.x264-GROUP` supplied, guessing name.
2017-04-02 01:48 DEBUG    seriesparser  watchdir_tv_eps Could not determine a series name

I think guess_name only tries to match it as an episode, not a season pack, and gives up if it's not an episode.

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

Yeah, i think you're right. Good catch, I'll test and fix soon

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

try now @tubedogg

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

@liiight Awesome, works a treat now. 👍 Thanks for doing this - super-excited to finally have season pack support!

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

sure thing. while I have your attention, it'd be great if you could also test next_series_seasons, preferably with real life sites. those scenarios are the hardest to anticipate.

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

I modified the BTN search plugin to support season packs and gave it a go withnext_series_seasons. Seems to work great. :)

(For the BTN plugin, do you want me to just tell you what I did and you can include it as part of this PR, or just hold onto it until this is released and submit a PR for BTN?)

@liiight
Copy link
Copy Markdown
Member Author

liiight commented Apr 2, 2017

You can tell me, but it's outside the scope of this pr

@tubedogg
Copy link
Copy Markdown
Contributor

tubedogg commented Apr 2, 2017

I just put it in a gist, two quick changes. https://gist.github.com/tubedogg/3ae75ab928b8a21fc9b5a51a7cf59ac6

@liiight liiight merged commit f104523 into develop Apr 3, 2017
@liiight liiight deleted the season_packs branch April 9, 2017 15:30
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.

5 participants