mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2025-01-15 10:45:15 +00:00
Fixed alternative checking
This commit is contained in:
parent
5d2c7ff200
commit
e0c72296d3
|
@ -76,7 +76,7 @@ async function getPreferredBitrate(dz, track, preferredBitrate, shouldFallback,
|
|||
if (track.localTrack) { return TrackFormats.LOCAL}
|
||||
|
||||
let falledBack = false
|
||||
let hasAlternative = track.fallbackID !== "0"
|
||||
let hasAlternative = track.fallbackID != 0
|
||||
let isGeolocked = false
|
||||
let wrongLicense = false
|
||||
|
||||
|
@ -157,17 +157,17 @@ async function getPreferredBitrate(dz, track, preferredBitrate, shouldFallback,
|
|||
// Current bitrate is higher than preferred bitrate; skip
|
||||
if (formatNumber > preferredBitrate) { continue }
|
||||
|
||||
let url
|
||||
let currentTrack = track
|
||||
let url = await getCorrectURL(currentTrack, formatName, formatNumber)
|
||||
let newTrack
|
||||
do {
|
||||
url = await getCorrectURL(currentTrack, formatName, formatNumber)
|
||||
if (hasAlternative && !url){
|
||||
if (!url && hasAlternative){
|
||||
newTrack = await dz.gw.get_track_with_fallback(currentTrack.fallbackID)
|
||||
currentTrack = new Track()
|
||||
currentTrack.parseEssentialData(newTrack)
|
||||
hasAlternative = currentTrack.fallbackID !== "0"
|
||||
hasAlternative = currentTrack.fallbackID != 0
|
||||
}
|
||||
url = await getCorrectURL(currentTrack, formatName, formatNumber)
|
||||
} while (!url && hasAlternative)
|
||||
|
||||
if (url) {
|
||||
|
|
Loading…
Reference in a new issue