diff --git a/cogs/lastfm.py b/cogs/lastfm.py index 89d20dc..187103e 100644 --- a/cogs/lastfm.py +++ b/cogs/lastfm.py @@ -931,8 +931,9 @@ async def album(self, ctx: MisoContext, *, album: Annotated[tuple, AlbumArgument else: row = f"`{track['@attr']['rank']:02}` {track['name']}" - if (duration := int(track["duration"])) > 0: - m, s = divmod(duration, 60) + duration = track["duration"] + if duration is not None and int(duration) > 0: + m, s = divmod(int(duration), 60) h, m = divmod(m, 60) duration_fmt = (f"{h}:" if h > 1 else "") + f"{m}:{s:02}" row += f" `{duration_fmt}`"