Best way to retrieve a year of a Series

I have the following for sorting and moving my downloaded series to my Library, but have some clashes when they are the same as older Series so Plex pulls the wrong Posters etc (for a 1960s series vs the current 2015 series).

How can I add the year to my save location. I tried {{series_year}} hoping it existed, but it doesn’t seem to work. Any ideas?

  Sort-Series:
    find:
      path:  /mnt/local/ext001/MEDIA/Public/Torrents/Complete/
      regexp: '.*\.(avi|mkv|mp4)$'
      recursive: yes
    seen: local
    template: tmp_series_all
    # NOTE: You must set the parse_only option for all of the series groups you have configured in your template.                                                                                                                                   
    # This option prevents the series plugin from accepting or rejecting anything in this feed.                                                                                                                                                     
    series:
      settings:
        ser_highres:
          parse_only: yes
    # Ignore samples                                                                                                                                                                                                                                
    regexp:
      reject:
        - sample
    # With the require_field and accept_all plugins, we accept anything that the series plugin has successfully parsed.                                                                                                                             
    require_field: series_name
    accept_all: yes
    move:
      to: /mnt/local/ext001/MEDIA/Public/TVShows/{{series_name}} ({{series_year}})/Season {{series_season|pad(2)}}

There might be a better way but i include my tv show yml file. You can put the year of the series in the name and it will use that as the series name when sorting.

So something like:

My Show Name 2014:
  alternate_name: My Show Name

With a configuration similar to that it will still match “My Show Name” for your rss download or “My Show Name 2014” but using the {{series_name}}} jinja template it will sort it into a folder “My Show Name 2014”

I actually need the same thing. Kodi also chooses the oldest series if there are 2 with the same name (like Hawaii Five-0 but also House of Cards).

I do not want to create a seperate series.yml. I found a field we can use:
tvdb_lookup contains tvdb_first_air_date but I have no clue how to extract the year from that.

I think you are still not with me, because this is exactly what that task and list are for. If you have files with the tvdb name, all tvdb parsers will work 100%. I think you should look closlier at the shows names in the database and the filenames, and maybe do some tests with a clean database :slight_smile:

1 Like

You are right, I was so focused on series that need the year, I didn’t pay attention to Kodi scanning other series. I now use tvdb_series_name.

I know this post is old but it is the first one to come up when trying to find this exact answer. And I found one.

{{ tvdb_first_air_date|re_replace(".{15}$", “”) }}

This takes the tvdb_first_air_date variable string and deletes the last 15 characters leaving the year.