Fix crash when using old queue files

This commit is contained in:
RemixDev 2022-05-28 15:50:17 +02:00
parent 516eb2557f
commit 6d771b1faf

View File

@ -363,9 +363,19 @@ export class DeemixApp {
switch (currentItem.__type__) { switch (currentItem.__type__) {
case 'Single': case 'Single':
downloadObject = new Single(currentItem) downloadObject = new Single(currentItem)
// Remove old incompatible queue items
if (downloadObject.single.trackAPI_gw) {
fs.unlinkSync(configFolder + `queue${sep}${filename}`)
return
}
break break
case 'Collection': case 'Collection':
downloadObject = new Collection(currentItem) downloadObject = new Collection(currentItem)
// Remove old incompatible queue items
if (downloadObject.collection.tracks_gw) {
fs.unlinkSync(configFolder + `queue${sep}${filename}`)
return
}
break break
case 'Convertable': case 'Convertable':
downloadObject = new Convertable(currentItem) downloadObject = new Convertable(currentItem)