From 59b2cb2e69b30b9f272ae876643ac02e3f20fa8a Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 5 Mar 2022 13:32:42 +0100 Subject: [PATCH] Disable bitrate options based on account license --- src/components/pages/Settings.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/pages/Settings.vue b/src/components/pages/Settings.vue index d77dc56..b9abb6f 100644 --- a/src/components/pages/Settings.vue +++ b/src/components/pages/Settings.vue @@ -462,9 +462,9 @@

{{ $t('settings.downloads.maxBitrate.title') }}

@@ -1070,6 +1070,14 @@ export default { this.settings = JSON.parse(JSON.stringify(this.defaultSettings)) toast(this.$t('settings.toasts.reset'), 'settings') + }, + canDownload(bitrate){ + if (!this.user.id) return false + if (this.settings.feelingLucky) return true + if (this.userLicense == "Free" && bitrate == 1) return true + if (this.userLicense == "Premium" && bitrate == 3) return true + if (this.userLicense == "Hi-Fi" && bitrate == 9) return true + return false } } }