mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2025-01-14 10:15:15 +00:00
quick fixes and code cleanup
This commit is contained in:
parent
c70898c5d0
commit
3d2965d0f6
|
@ -129,7 +129,7 @@ async function getPreferredBitrate(dz, track, preferredBitrate, shouldFallback,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (track.localTrack) {
|
if (track.localTrack) {
|
||||||
let url = await getCorrectURL(track, "MP3_MISC", TrackFormats.LOCAL)
|
let url = await getCorrectURL(track, "MP3_MISC", TrackFormats.LOCAL, feelingLucky)
|
||||||
track.urls["MP3_MISC"] = url
|
track.urls["MP3_MISC"] = url
|
||||||
return TrackFormats.LOCAL
|
return TrackFormats.LOCAL
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ async function getPreferredBitrate(dz, track, preferredBitrate, shouldFallback,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is360Format) throw new TrackNot360
|
if (is360Format) throw new TrackNot360
|
||||||
let url = await getCorrectURL(track, "MP3_MISC", TrackFormats.DEFAULT)
|
let url = await getCorrectURL(track, "MP3_MISC", TrackFormats.DEFAULT, feelingLucky)
|
||||||
track.urls["MP3_MISC"] = url
|
track.urls["MP3_MISC"] = url
|
||||||
return TrackFormats.DEFAULT
|
return TrackFormats.DEFAULT
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,8 +125,6 @@ async function generateAlbumItem(dz, id, bitrate, rootArtist){
|
||||||
collection.push(trackAPI)
|
collection.push(trackAPI)
|
||||||
})
|
})
|
||||||
|
|
||||||
let explicit = albumAPI.explicit_lyrics
|
|
||||||
|
|
||||||
return new Collection({
|
return new Collection({
|
||||||
type: 'album',
|
type: 'album',
|
||||||
id: id,
|
id: id,
|
||||||
|
@ -134,7 +132,7 @@ async function generateAlbumItem(dz, id, bitrate, rootArtist){
|
||||||
title: albumAPI.title,
|
title: albumAPI.title,
|
||||||
artist: albumAPI.artist.name,
|
artist: albumAPI.artist.name,
|
||||||
cover: cover,
|
cover: cover,
|
||||||
explicit: explicit,
|
explicit: albumAPI.explicit_lyrics,
|
||||||
size: totalSize,
|
size: totalSize,
|
||||||
collection: {
|
collection: {
|
||||||
tracks: collection,
|
tracks: collection,
|
||||||
|
|
|
@ -267,6 +267,25 @@ class Spotify extends Plugin {
|
||||||
}
|
}
|
||||||
if (cachedTrack.id !== "0") trackAPI = await dz.api.get_track(cachedTrack.id)
|
if (cachedTrack.id !== "0") trackAPI = await dz.api.get_track(cachedTrack.id)
|
||||||
}
|
}
|
||||||
|
if (!trackAPI){
|
||||||
|
trackAPI = {
|
||||||
|
id: "0",
|
||||||
|
title: track.name,
|
||||||
|
duration: 0,
|
||||||
|
md5_origin: 0,
|
||||||
|
media_version: 0,
|
||||||
|
filesizes: {},
|
||||||
|
album: {
|
||||||
|
title: track.album.name,
|
||||||
|
md5_image: ""
|
||||||
|
},
|
||||||
|
artist: {
|
||||||
|
id: 0,
|
||||||
|
name: track.artists[0].name,
|
||||||
|
md5_image: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
trackAPI.position = pos+1
|
trackAPI.position = pos+1
|
||||||
collection[pos] = trackAPI
|
collection[pos] = trackAPI
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue