Fix an attribute error that can be raised in humanize_timedelta if seconds = 0 (#3231)

* Migrate Playlist to DB 3 TODO
1 Migrate Config to Schema 3 without playlists
and update get_playlist methods

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Revert "Migrate Playlist to DB 3 TODO 1 Migrate Config to Schema 3 without playlists and update get_playlist methods"

This reverts commit 4af33cff

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Allow removing tracks from queue by URL

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Words matter

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* *sigh*

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* chore

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Fix an attribute error that can be raised here is seconds = 0

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Fix an attribute error that can be raised here is seconds = 0

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* go away

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* *sigh*

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
Draper 2019-12-29 14:37:50 +00:00 committed by Michael H
parent f9211ff50f
commit f7e2617911
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix an attribute error that can be raised in humanize_timedelta if seconds = 0.

View File

@ -430,7 +430,7 @@ def humanize_timedelta(
""" """
try: try:
obj = seconds or timedelta.total_seconds() obj = seconds if seconds is not None else timedelta.total_seconds()
except AttributeError: except AttributeError:
raise ValueError("You must provide either a timedelta or a number of seconds") raise ValueError("You must provide either a timedelta or a number of seconds")