Kometa-Team / Kometa

Python script to update metadata information for items in plex as well as automatically build collections and playlists. The Wiki Documentation is linked below.
https://kometa.wiki
MIT License
2.52k stars 307 forks source link

[Bug]: time data 'November 30, -0001' does not match format '%B %d, %Y' #838

Closed aunefyren closed 2 years ago

aunefyren commented 2 years ago

Version Number

1.16.5

What branch are you on?

master

Describe the Bug

The building of a collection crashed because of some metadata that couldn't get parsed into a DateTime object. I am guessing the show it pulled data from had -0001 as the year, and the code couldn't handle the value when trying to create an object.

Traceback (most recent call last): File "/app/pmm/plex_meta_manager.py", line 490, in run_collection radarr_add, sonarr_add = builder.run_missing() File "/app/pmm/modules/builder.py", line 2219, in run_missing show = self.config.TVDb.get_series(missing_id) File "/app/pmm/modules/tvdb.py", line 136, in get_series return TVDbObj(tvdb_url, self.tvdb_language, False, self.config) File "/app/pmm/modules/tvdb.py", line 100, in init self.released = datetime.strptime(released, "%B %d, %Y") if released else released File "/usr/lib/python3.9/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/lib/python3.9/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data 'November 30, -0001' does not match format '%B %d, %Y'
Unknown Error: time data 'November 30, -0001' does not match format '%B %d, %Y'

Relevant Collection/Playlist Definition

templates:
    Holiday:
        url_poster: <<poster>>
        sort_title: +++++++_<<collection_name>>
        collection_order: release
        collection_mode: hide
collections:
  Norsk:
    template: {name: Holiday, poster: https://i.imgur.com/CBoNbYg.jpeg }
    imdb_list:
    - url: https://www.imdb.com/search/title/?title_type=tv_series,tv_miniseries&release_date=1950-01-01,&countries=no&languages=no
    summary: Serier som har norsk som hovedspråk.
    visible_home: true
    visible_shared: true
    collection_order: release.desc

Logs

https://gist.github.com/aunefyren/a97bcd03fe3b410df741df9e59964954

meisnate12 commented 2 years ago

ill add a catch for it odd that the show has a year of -0001 https://thetvdb.com/series/torsdag-kveld-fra-nydalen

aunefyren commented 2 years ago

ill add a catch for it odd that the show has a year of -0001 https://thetvdb.com/series/torsdag-kveld-fra-nydalen

Yeah, I agree. Pretty stupid, but if their system allows it, it can happen again even if we fix it.

meisnate12 commented 2 years ago

Added in 1.17.0