Skip to content

Commit

Permalink
check if year is an int #23
Browse files Browse the repository at this point in the history
  • Loading branch information
3ll3d00d committed Feb 1, 2021
1 parent 93915ad commit 2277255
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ezbeq/catalogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ class Catalogue:
def __init__(self, idx: int, vals: dict):
self.idx = idx
self.title = vals.get('title', '')
self.year = int(vals.get('year', 0))
y = 0
try:
y = int(vals.get('year', 0))
except:
logger.error(f"Invalid year {vals.get('year', 0)} in {self.title}")
self.year = y
self.audio_types = vals.get('audioTypes', [])
self.author = vals.get('author', '')
self.beqc_url = vals.get('catalogue_url', '')
Expand Down

0 comments on commit 2277255

Please sign in to comment.