[Audio] Redefine max length with livestream exception (#3878)

* Redefine max length with livestream exception

* Address review

* is_track_too_long -> is_track_length_allowed for a more accurate description of what the function actually is doing
* we now rely on Track.is_stream for determining whether item is a livestream (or unseekable/non-known audio length like OGG files) for determining whether it can bypass the user-set max track length
* Removal of passing track length/an int to is_track_length_allowed - will always pass the full Track object now

* Address review
This commit is contained in:
aikaterna
2020-06-11 07:38:43 -07:00
committed by GitHub
parent b1d394eac5
commit e3322af384
6 changed files with 13 additions and 15 deletions

View File

@@ -566,7 +566,7 @@ class AudioAPIInterface:
if len(player.queue) >= 10000:
continue
if guild_data["maxlength"] > 0:
if self.cog.is_track_too_long(single_track, guild_data["maxlength"]):
if self.cog.is_track_length_allowed(single_track, guild_data["maxlength"]):
enqueued_tracks += 1
player.add(ctx.author, single_track)
self.bot.dispatch(