made code slightly less shitty
This commit is contained in:
parent
3861935ddc
commit
fecd248a53
|
@ -3,7 +3,7 @@
|
|||
// @namespace io.github.uhwot.dzunlock
|
||||
// @description enables deezer hifi features lol
|
||||
// @author uh wot
|
||||
// @version 1.3
|
||||
// @version 1.3.1
|
||||
// @license GPL-3.0-only
|
||||
// @homepageURL https://git.freezer.life/uhwot/dzunlock
|
||||
// @downloadURL https://git.freezer.life/uhwot/dzunlock/raw/branch/master/dzunlock.user.js
|
||||
|
@ -159,16 +159,11 @@ fetchIntercept.register({
|
|||
const track = unsafeWindow.dzPlayer.getCurrentSong()
|
||||
const id = parseInt(track.SNG_ID)
|
||||
|
||||
let user_status_quality = quality
|
||||
if (user_status_quality === 'high') {
|
||||
user_status_quality = 'hq'
|
||||
}
|
||||
|
||||
let is_subbed = !unsafeWindow.dzPlayer.user_status.can_subscribe
|
||||
let is_quality_available = unsafeWindow.dzPlayer.user_status[user_status_quality]
|
||||
let is_quality_available = unsafeWindow.dzPlayer.user_status.audio_qualities.wifi_download.includes(quality)
|
||||
// STREAM_ADS_AVAILABLE is used to check if track is restricted to premium/hifi
|
||||
if (quality === 'standard' && (track.RIGHTS.STREAM_ADS_AVAILABLE === true || is_subbed)) {
|
||||
is_quality_available = true
|
||||
if (track.RIGHTS.STREAM_ADS_AVAILABLE !== true && !is_subbed) {
|
||||
is_quality_available = false
|
||||
}
|
||||
|
||||
if (id >= 0 && !is_quality_available) {
|
||||
|
|
Loading…
Reference in New Issue