Skip to content

New input plugin: trakt_calendar#1824

Merged
cvium merged 8 commits intodevelopfrom
trakt_calendar
May 25, 2017
Merged

New input plugin: trakt_calendar#1824
cvium merged 8 commits intodevelopfrom
trakt_calendar

Conversation

@cvium
Copy link
Copy Markdown
Contributor

@cvium cvium commented May 16, 2017

Motivation for changes:

Dunno

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

  trakt_calendar:
    account: myaccount
    start_day: -7  # number of days from today
    days: 10
    strip_dates: yes
    type: episodes

TODO

  • Test with what in discover plugin
    - [ ] Structural pytest?
  • Make sure a "you missed an episode X days ago" task is feasible

Example "you missed an episode X days ago" task

tasks:
  notify_missed:
    disable: seen  # we do not want seen to interfere
    metainfo_series: yes
    notify: bla bla
    trakt_calendar:
      type: episodes
      account: asdas
      start_day: -7
      days: 6  # Grab episodes in the last 6 days (not including today)
    if:
      - "trakt_collected or trakt_watched": reject
      - "series_season == 0": reject
    trakt_lookup:
      account: dsadsa
    crossmatch:
      from:
        - trakt_list:
            account: dsadsa
            type: shows
            list: ddsadasdas
      action: accept
      fields: [trakt_series_name]

Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

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

Maybe some logging...

return get_template(instance) is not None


@format_checker.checks('date', raises=ValueError)
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.

Json schema had a built in date-time format, can't we use that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't conform to the same standard as dateutil, which means it validates a format that dateutil can't parse...

@mfonville
Copy link
Copy Markdown
Contributor

Thanks for working on this; I tried to get it working but already noticed the following things:
I had to set "start_date: 2017-01-01" with the " otherwise it is not interpreted as a string

Also I got:

Series `The Simpsons S28E22` with identified_by value `auto` are not supported.

which I had to solve by adding identified_by: ep but this is something I'd expect to be set by the plugin itself.

Also days seems to look ahead in time (so the next 7 days) instead of back in time, is that on purpose?

@cvium
Copy link
Copy Markdown
Contributor Author

cvium commented May 17, 2017

Also days seems to look ahead in time (so the next 7 days) instead of back in time, is that on purpose?

That's the API. I'm not sure if it supports negative numbers.

which I had to solve by adding identified_by: ep but this is something I'd expect to be set by the plugin itself.

I don't think any other plugin automatically sets this...

@liiight
Copy link
Copy Markdown
Member

liiight commented May 17, 2017

Also days seems to look ahead in time (so the next 7 days) instead of back in time, is that on purpose?

The idea is to get shows with an upcoming broadcast date. @cvium maybe the default needs to be today?

@mfonville
Copy link
Copy Markdown
Contributor

mfonville commented May 17, 2017

That's the API. I'm not sure if it supports negative numbers.

Ok, I understand. It is a bit counter-intuitive for users, so it will be important to document this in an accessible way.
It would make sense to then e.g. make the days to be '1' by default.

I don't think any other plugin automatically sets this...

hmm, but it fails with auto, and calendar can only provides episode. imho it would make sense that the plugin at least sets the config-parts that it cannot do without and that are static.

@tubedogg
Copy link
Copy Markdown
Contributor

It's too bad Trakt doesn't offer through the API the custom calendars that VIP members can create. It basically takes a list and makes a custom calendar that only includes shows on that list, instead of using watchlist/watched/collected.

That said, will this work with crossmatch to be able to kind of simulate that? I'd basically want to pull a list from Trakt and be able to use crossmatch to only return entries for episodes that match a series on that list.

@cvium
Copy link
Copy Markdown
Contributor Author

cvium commented May 19, 2017

It should.

@cvium cvium merged commit d602c32 into develop May 25, 2017
@cvium cvium deleted the trakt_calendar branch May 25, 2017 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants