for newline in lines:
msg += br
br = "<br>"
- if len(msg) + len(newline) > 5000:
+ if (len(msg) + len(newline)) > (bot.mumble.get_max_message_length() - 4) != 0: # 4 == len("<br>")
bot.send_msg(msg, text)
msg = ""
msg += newline
def cmd_remove(bot, user, text, command, parameter):
global log
+ if bot.download_in_progress:
+ bot.send_msg(constants.strings("cannot_change_when_download"))
+ return
+
# Allow to remove specific music into the queue with a number
if parameter and parameter.isdigit() and int(parameter) > 0 \
and int(parameter) <= var.playlist.length():
pm_not_allowed = Private message aren't allowed.
too_long = This music is too long, skip!
download_in_progress = Download of {item} in progress...
+cannot_change_when_download = Downloading songs, please wait until the download completes.
removing_item = Removed entry {item} from playlist.
user_ban = You are banned, not allowed to do that!
url_ban = This url is banned!
playlist_title = info['title']
for j in range(start_index, min(len(info['entries']), start_index + var.config.getint('bot', 'max_track_playlist'))):
- print(info['entries'][j])
# Unknow String if No title into the json
title = info['entries'][j]['title'] if 'title' in info['entries'][j] else "Unknown Title"
# Add youtube url if the url in the json isn't a full url
# then no need to download
return music
+ self.download_in_progress = True
+
url = music['url']
url_hash = hashlib.md5(url.encode()).hexdigest()
music = util.get_music_tag_info(music)
var.playlist.update(music, index)
+ self.download_in_progress = False
return music
def async_download_next(self):