Skip to content

Commit

Permalink
[55] #838 Catch bad dates
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed May 7, 2022
1 parent 98e625b commit 0995faf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.5-develop54
1.16.5-develop55
5 changes: 4 additions & 1 deletion modules/tvdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ def parse_title_summary(lang=None):
self.writers = parse_page("//strong[text()='Writers']/parent::li/span/a/text()[normalize-space()]", is_list=True)
self.studios = parse_page("//strong[text()='Studio']/parent::li/span/a/text()[normalize-space()]", is_list=True)
released = parse_page("//strong[text()='Released']/parent::li/span/text()[normalize-space()]")
self.released = datetime.strptime(released, "%B %d, %Y") if released else released
else:
self.networks = parse_page("//strong[text()='Networks']/parent::li/span/a/text()[normalize-space()]", is_list=True)
released = parse_page("//strong[text()='First Aired']/parent::li/span/text()[normalize-space()]")
try:
self.released = datetime.strptime(released, "%B %d, %Y") if released else released
except ValueError:
self.released = None

self.genres = parse_page("//strong[text()='Genres']/parent::li/span/a/text()[normalize-space()]", is_list=True)

tmdb_id = None
Expand Down

0 comments on commit 0995faf

Please sign in to comment.