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
1 changed files with 10 additions and 0 deletions

View File

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