Fixed out of memory issue when downloading large playlists
This commit is contained in:
parent
92e9a3fc6e
commit
b7601f282d
|
@ -26,6 +26,13 @@ if its an album/playlist
|
||||||
collection
|
collection
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def slimQueueItem(item):
|
||||||
|
light = item.copy()
|
||||||
|
if 'single' in light:
|
||||||
|
del light['single']
|
||||||
|
if 'collection' in light:
|
||||||
|
del light['collection']
|
||||||
|
return light
|
||||||
|
|
||||||
def generateQueueItem(dz, sp, url, settings, bitrate=None, albumAPI=None, interface=None):
|
def generateQueueItem(dz, sp, url, settings, bitrate=None, albumAPI=None, interface=None):
|
||||||
forcedBitrate = getBitrateInt(bitrate)
|
forcedBitrate = getBitrateInt(bitrate)
|
||||||
|
@ -232,7 +239,7 @@ def addToQueue(dz, sp, url, settings, bitrate=None, interface=None):
|
||||||
print("Already in queue!")
|
print("Already in queue!")
|
||||||
continue
|
continue
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("addedToQueue", x)
|
interface.send("addedToQueue", slimQueueItem(x))
|
||||||
queue.append(x['uuid'])
|
queue.append(x['uuid'])
|
||||||
queueList[x['uuid']] = x
|
queueList[x['uuid']] = x
|
||||||
else:
|
else:
|
||||||
|
@ -247,7 +254,7 @@ def addToQueue(dz, sp, url, settings, bitrate=None, interface=None):
|
||||||
{'msg': f"{queueItem['title']} is already in queue!", 'icon': 'playlist_add_check'})
|
{'msg': f"{queueItem['title']} is already in queue!", 'icon': 'playlist_add_check'})
|
||||||
return False
|
return False
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("addedToQueue", queueItem)
|
interface.send("addedToQueue", slimQueueItem(queueItem))
|
||||||
interface.send("toast", {'msg': f"{queueItem['title']} added to queue", 'icon': 'playlist_add'})
|
interface.send("toast", {'msg': f"{queueItem['title']} added to queue", 'icon': 'playlist_add'})
|
||||||
queue.append(queueItem['uuid'])
|
queue.append(queueItem['uuid'])
|
||||||
queueList[queueItem['uuid']] = queueItem
|
queueList[queueItem['uuid']] = queueItem
|
||||||
|
|
Loading…
Reference in New Issue