mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-06 03:05:35 +00:00
fix: ValueError: year 0 is out of range
This commit is contained in:
parent
d8bb31e4a8
commit
622c297bef
@ -203,7 +203,10 @@ class Album:
|
||||
return
|
||||
|
||||
dates = (int(t.date) for t in tracks if t.date)
|
||||
self.date = datetime.datetime.fromtimestamp(min(dates)).year
|
||||
try:
|
||||
self.date = datetime.datetime.fromtimestamp(min(dates)).year
|
||||
except ValueError:
|
||||
self.date = datetime.datetime.now().year
|
||||
|
||||
def set_count(self, count: int):
|
||||
self.count = count
|
||||
|
Loading…
x
Reference in New Issue
Block a user