diff --git a/public/js/bundle.js b/public/js/bundle.js index 6f2f5ed..029ff9f 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -4867,7 +4867,7 @@ a { -`;const flags={it,en:gb,es,de,fr,id,pt,pt_br:br,ru,tr,vn,hr,ar,ko,ph,zh_tw:tw,pl},getFormItem=e=>a=>{const n=e.elements.namedItem(a);return{[a]:n.value}};var script$1={components:{BaseAccordion,TemplateVariablesList},setup(){const{areLogsActive:e,saveLogsSettings:a}=useLogs();return{areLogsActive:e,saveLogsSettings:a}},data(){return{flags,currentLocale:this.$i18n.locale,locales:this.$i18n.availableLocales,settings:{tags:{}},lastSettings:{},spotifyFeatures:{},lastCredentials:{},defaultSettings:{},lastUser:"",spotifyUser:"",accountNum:0,accounts:[],trackTemplateVariables}},computed:{...mapGetters({arl:"getARL",accessToken:"getAccessToken",user:"getUser",isLoggedIn:"isLoggedIn",clientMode:"getClientMode",previewVolume:"getPreviewVolume",hasSlimDownloads:"getSlimDownloads",hasSlimSidebar:"getSlimSidebar"}),needToWait(){return Object.keys(this.getSettings).length===0},modelVolume:{get(){return this.previewVolume},set:debounce(function(e){this.setPreviewVolume(e)},20)},modelSlimDownloads:{get(){return this.hasSlimDownloads},set(e){this.setSlimDownloads(e)}},modelSlimSidebar:{get(){return this.hasSlimSidebar},set(e){this.setSlimSidebar(e)}},pictureHref(){return`https://e-cdns-images.dzcdn.net/images/user/${this.user.picture}/125x125-000000-80-0-0.jpg`}},async mounted(){const{settingsData:e,defaultSettingsData:a,spotifyCredentials:n}=await getSettingsData();this.defaultSettings=a,this.initSettings(e,n);const i=localStorage.getItem("accountNum");i&&(this.accountNum=i);const r=localStorage.getItem("spotifyUser");r&&(this.lastUser=r,this.spotifyUser=r,socket.emit("update_userSpotifyPlaylists",r)),socket.on("updateSettings",this.updateSettings),socket.on("familyAccounts",this.initAccounts),this.clientMode&&(window.api.receive("downloadFolderSelected",this.downloadFolderSelected),window.api.receive("applogin_arl",this.loggedInViaDeezer)),this.$on("hook:destroyed",()=>{socket.off("updateSettings"),socket.off("familyAccounts")})},methods:{...mapActions({dispatchARL:"setARL",dispatchAccessTocken:"setAccessToken",dispatchUser:"setUser",removeARL:"removeARL",setPreviewVolume:"setPreviewVolume",setSlimDownloads:"setSlimDownloads",setSlimSidebar:"setSlimSidebar",dispatchLogout:"logout",dispatchLogin:"login",setSpotifyUserId:"setSpotifyUserId",refreshSpotifyStatus:"refreshSpotifyStatus"}),onTemplateVariableClick(e){copyToClipboard(e),toast(`Copied ${e} to clipboard!`)},revertSettings(){this.settings=JSON.parse(JSON.stringify(this.lastSettings))},revertCredentials(){this.spotifyCredentials=JSON.parse(JSON.stringify(this.lastCredentials)),this.spotifyUser=(" "+this.lastUser).slice(1)},copyARLtoClipboard(){const e=this.$refs.loginInput;e.setAttribute("type","text"),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.setAttribute("type","password"),toast(this.$t("settings.toasts.ARLcopied"),"assignment")},changeLocale(e){this.$i18n.locale=e,this.currentLocale=e,localStorage.setItem("locale",e)},saveSettings(){this.saveLogsSettings(),this.lastSettings=JSON.parse(JSON.stringify(this.settings)),this.lastCredentials=JSON.parse(JSON.stringify(this.spotifyFeatures));let e=!1;this.lastUser!==this.spotifyUser&&(this.lastUser=(" "+this.spotifyUser).slice(1),localStorage.setItem("spotifyUser",this.lastUser),this.setSpotifyUserId(this.lastUser),e=!0),socket.emit("saveSettings",{settings:this.lastSettings,spotifySettings:this.lastCredentials,spotifyUser:e?this.lastUser:!1})},selectDownloadFolder(){window.api.send("selectDownloadFolder",this.settings.downloadLocation)},downloadFolderSelected(e){this.$set(this.settings,"downloadLocation",e)},loadSettings(e){this.lastSettings=JSON.parse(JSON.stringify(e)),this.settings=JSON.parse(JSON.stringify(e))},loadCredentials(e){this.lastCredentials=JSON.parse(JSON.stringify(e)),this.spotifyFeatures=JSON.parse(JSON.stringify(e))},loggedInViaDeezer(e){this.dispatchARL({arl:e})},async login(e,a=!1){toast(this.$t("toasts.loggingIn"),"loading",!1,"login-toast");const n=await fetchData("login-arl",{arl:e,force:a,child:this.accountNum},"POST"),{status:i,user:r,childs:s,currentChild:l}=n;switch(this.accounts=s,this.accountNum=l,i){case 1:case 3:toast(this.$t("toasts.loggedIn"),"done",!0,"login-toast"),this.dispatchLogin(n);break;case 2:toast(this.$t("toasts.alreadyLogged"),"done",!0,"login-toast"),this.dispatchUser(r);break;case 0:toast(this.$t("toasts.loginFailed"),"close",!0,"login-toast"),this.removeARL();break;case-1:toast(this.$t("toasts.deezerNotAvailable"),"close",!0,"login-toast")}},loginButton(){const e=this.$refs.loginInput.value.trim();e&&e!==this.arl&&this.login(e,!0)},async loginWithCredentials(){const e=getFormItem(this.$refs.loginWithCredentialsForm),{email:a}=e("email"),{password:n}=e("password"),{accessToken:i,arl:r}=await postToServer("loginWithCredentials",{email:a,password:n,accessToken:this.accessToken});i!==this.accessToken&&this.dispatchAccessTocken({accessToken:i}),r&&this.login(r)},appLogin(){window.api.send("applogin")},async changeAccount(){const[e,a]=await fetchData("changeAccount",{child:this.accountNum});this.accountChanged(e,a)},accountChanged(e,a){this.$refs.username.innerText=e.name,this.$refs.userpicture.src=`https://e-cdns-images.dzcdn.net/images/user/${e.picture}/125x125-000000-80-0-0.jpg`,this.accountNum=a,localStorage.setItem("accountNum",this.accountNum)},initAccounts(e){this.accounts=e},async logout(){const e=await postToServer("logout");console.log(e),e.logged_out&&(toast(this.$t("toasts.loggedOut"),"done",!0,"login-toast"),this.dispatchLogout())},initSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.init"),"settings")},updateSettings(e){const{settings:a,spotifySettings:n}=e;this.loadSettings(a),this.loadCredentials(n),toast(this.$t("settings.toasts.update"),"settings"),this.refreshSpotifyStatus()},resetToDefault(){!confirm(this.$t("settings.resetMessage"))||(this.settings=JSON.parse(JSON.stringify(this.defaultSettings)),toast(this.$t("settings.toasts.reset"),"settings"))}}};const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{staticClass:"fixed-footer"},[n("h1",{staticClass:"mb-8 text-5xl"},[e._v(e._s(e.$t("settings.title")))]),e._v(" "),e.isLoggedIn?n("div",{ref:"loggedInInfo",attrs:{id:"logged_in_info"}},[n("img",{ref:"userpicture",staticClass:"w-32 h-32 rounded-full",attrs:{id:"settings_picture",src:e.pictureHref,alt:"Profile Picture"}}),e._v(" "),n("i18n",{attrs:{path:"settings.login.loggedIn",tag:"p"},scopedSlots:e._u([{key:"username",fn:function(){return[n("strong",{ref:"username",attrs:{id:"settings_username"}},[e._v(e._s(e.user.name||"not logged"))])]},proxy:!0}],null,!1,2821744753)}),e._v(" "),n("button",{staticClass:"btn btn-primary",on:{click:e.logout}},[e._v(` +`;const flags={it,en:gb,es,de,fr,id,pt,pt_br:br,ru,tr,vn,hr,ar,ko,ph,zh_tw:tw,pl},getFormItem=e=>a=>{const n=e.elements.namedItem(a);return{[a]:n.value}};var script$1={components:{BaseAccordion,TemplateVariablesList},setup(){const{areLogsActive:e,saveLogsSettings:a}=useLogs();return{areLogsActive:e,saveLogsSettings:a}},data(){return{flags,currentLocale:this.$i18n.locale,locales:this.$i18n.availableLocales,settings:{tags:{}},lastSettings:{},spotifyFeatures:{},lastCredentials:{},defaultSettings:{},lastUser:"",spotifyUser:"",accountNum:0,accounts:[],trackTemplateVariables}},computed:{...mapGetters({arl:"getARL",accessToken:"getAccessToken",user:"getUser",isLoggedIn:"isLoggedIn",clientMode:"getClientMode",previewVolume:"getPreviewVolume",hasSlimDownloads:"getSlimDownloads",hasSlimSidebar:"getSlimSidebar"}),needToWait(){return Object.keys(this.getSettings).length===0},modelVolume:{get(){return this.previewVolume},set:debounce(function(e){this.setPreviewVolume(e)},20)},modelSlimDownloads:{get(){return this.hasSlimDownloads},set(e){this.setSlimDownloads(e)}},modelSlimSidebar:{get(){return this.hasSlimSidebar},set(e){this.setSlimSidebar(e)}},pictureHref(){return`https://e-cdns-images.dzcdn.net/images/user/${this.user.picture}/125x125-000000-80-0-0.jpg`},userLicense(){return this.user.can_stream_lossless?"Hi-Fi":this.user.can_stream_hq?"Premium":"Free"}},async mounted(){const{settingsData:e,defaultSettingsData:a,spotifyCredentials:n}=await getSettingsData();this.defaultSettings=a,this.initSettings(e,n);const i=localStorage.getItem("accountNum");i&&(this.accountNum=i);const r=localStorage.getItem("spotifyUser");r&&(this.lastUser=r,this.spotifyUser=r,socket.emit("update_userSpotifyPlaylists",r)),socket.on("updateSettings",this.updateSettings),socket.on("familyAccounts",this.initAccounts),this.clientMode&&(window.api.receive("downloadFolderSelected",this.downloadFolderSelected),window.api.receive("applogin_arl",this.loggedInViaDeezer)),this.$on("hook:destroyed",()=>{socket.off("updateSettings"),socket.off("familyAccounts")})},methods:{...mapActions({dispatchARL:"setARL",dispatchAccessTocken:"setAccessToken",dispatchUser:"setUser",removeARL:"removeARL",setPreviewVolume:"setPreviewVolume",setSlimDownloads:"setSlimDownloads",setSlimSidebar:"setSlimSidebar",dispatchLogout:"logout",dispatchLogin:"login",setSpotifyUserId:"setSpotifyUserId",refreshSpotifyStatus:"refreshSpotifyStatus"}),onTemplateVariableClick(e){copyToClipboard(e),toast(`Copied ${e} to clipboard!`)},revertSettings(){this.settings=JSON.parse(JSON.stringify(this.lastSettings))},revertCredentials(){this.spotifyCredentials=JSON.parse(JSON.stringify(this.lastCredentials)),this.spotifyUser=(" "+this.lastUser).slice(1)},copyARLtoClipboard(){const e=this.$refs.loginInput;e.setAttribute("type","text"),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),e.setAttribute("type","password"),toast(this.$t("settings.toasts.ARLcopied"),"assignment")},changeLocale(e){this.$i18n.locale=e,this.currentLocale=e,localStorage.setItem("locale",e)},saveSettings(){this.saveLogsSettings(),this.lastSettings=JSON.parse(JSON.stringify(this.settings)),this.lastCredentials=JSON.parse(JSON.stringify(this.spotifyFeatures));let e=!1;this.lastUser!==this.spotifyUser&&(this.lastUser=(" "+this.spotifyUser).slice(1),localStorage.setItem("spotifyUser",this.lastUser),this.setSpotifyUserId(this.lastUser),e=!0),socket.emit("saveSettings",{settings:this.lastSettings,spotifySettings:this.lastCredentials,spotifyUser:e?this.lastUser:!1})},selectDownloadFolder(){window.api.send("selectDownloadFolder",this.settings.downloadLocation)},downloadFolderSelected(e){this.$set(this.settings,"downloadLocation",e)},loadSettings(e){this.lastSettings=JSON.parse(JSON.stringify(e)),this.settings=JSON.parse(JSON.stringify(e))},loadCredentials(e){this.lastCredentials=JSON.parse(JSON.stringify(e)),this.spotifyFeatures=JSON.parse(JSON.stringify(e))},loggedInViaDeezer(e){this.dispatchARL({arl:e})},async login(e,a=!1){toast(this.$t("toasts.loggingIn"),"loading",!1,"login-toast");const n=await fetchData("login-arl",{arl:e,force:a,child:this.accountNum},"POST"),{status:i,user:r,childs:s,currentChild:l}=n;switch(this.accounts=s,this.accountNum=l,i){case 1:case 3:toast(this.$t("toasts.loggedIn"),"done",!0,"login-toast"),this.dispatchLogin(n);break;case 2:toast(this.$t("toasts.alreadyLogged"),"done",!0,"login-toast"),this.dispatchUser(r);break;case 0:toast(this.$t("toasts.loginFailed"),"close",!0,"login-toast"),this.removeARL();break;case-1:toast(this.$t("toasts.deezerNotAvailable"),"close",!0,"login-toast")}},loginButton(){const e=this.$refs.loginInput.value.trim();e&&e!==this.arl&&this.login(e,!0)},async loginWithCredentials(){const e=getFormItem(this.$refs.loginWithCredentialsForm),{email:a}=e("email"),{password:n}=e("password"),{accessToken:i,arl:r}=await postToServer("loginWithCredentials",{email:a,password:n,accessToken:this.accessToken});i!==this.accessToken&&this.dispatchAccessTocken({accessToken:i}),r&&this.login(r)},appLogin(){window.api.send("applogin")},async changeAccount(){const[e,a]=await fetchData("changeAccount",{child:this.accountNum});this.accountChanged(e,a)},accountChanged(e,a){this.$refs.username.innerText=e.name,this.$refs.userpicture.src=`https://e-cdns-images.dzcdn.net/images/user/${e.picture}/125x125-000000-80-0-0.jpg`,this.accountNum=a,localStorage.setItem("accountNum",this.accountNum)},initAccounts(e){this.accounts=e},async logout(){const e=await postToServer("logout");console.log(e),e.logged_out&&(toast(this.$t("toasts.loggedOut"),"done",!0,"login-toast"),this.dispatchLogout())},initSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.init"),"settings")},updateSettings(e){const{settings:a,spotifySettings:n}=e;this.loadSettings(a),this.loadCredentials(n),toast(this.$t("settings.toasts.update"),"settings"),this.refreshSpotifyStatus()},resetToDefault(){!confirm(this.$t("settings.resetMessage"))||(this.settings=JSON.parse(JSON.stringify(this.defaultSettings)),toast(this.$t("settings.toasts.reset"),"settings"))}}};const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{staticClass:"fixed-footer"},[n("h1",{staticClass:"mb-8 text-5xl"},[e._v(e._s(e.$t("settings.title")))]),e._v(" "),e.isLoggedIn?n("div",{ref:"loggedInInfo",attrs:{id:"logged_in_info"}},[n("img",{ref:"userpicture",staticClass:"w-32 h-32 rounded-full",attrs:{id:"settings_picture",src:e.pictureHref,alt:"Profile Picture"}}),e._v(" "),n("i18n",{attrs:{path:"settings.login.loggedIn",tag:"p"},scopedSlots:e._u([{key:"username",fn:function(){return[n("strong",{ref:"username",attrs:{id:"settings_username"}},[e._v(e._s(e.user.name||"not logged"))])]},proxy:!0}],null,!1,2821744753)}),e._v(" "),n("p",[e._v(e._s(e.userLicense)+" | "+e._s(e.user.country))]),e._v(" "),n("button",{staticClass:"btn btn-primary",on:{click:e.logout}},[e._v(` `+e._s(e.$t("settings.login.logout"))+` `)]),e._v(" "),e.accounts.length>1?n("select",{directives:[{name:"model",rawName:"v-model",value:e.accountNum,expression:"accountNum"}],attrs:{id:"family_account"},on:{change:[function(i){var r=Array.prototype.filter.call(i.target.options,function(s){return s.selected}).map(function(s){var l="_value"in s?s._value:s.value;return l});e.accountNum=i.target.multiple?r:r[0]},e.changeAccount]}},e._l(e.accounts,function(i,r){return n("option",{key:i,domProps:{value:r.toString()}},[e._v(` `+e._s(i.name)+` @@ -4908,7 +4908,7 @@ a { `+e._s(e.$t("settings.spotify.title"))+` `)])]},proxy:!0}])},[e._v(" "),n("RouterLink",{attrs:{to:{name:"Spotify Features"}}},[e._v(` `+e._s(e.$t("settings.spotify.question"))+` - `)]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.clientID")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.clientId,expression:"spotifyFeatures.clientId"}],attrs:{type:"text"},domProps:{value:e.spotifyFeatures.clientId},on:{input:function(i){i.target.composing||e.$set(e.spotifyFeatures,"clientId",i.target.value)}}})]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.clientSecret")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.clientSecret,expression:"spotifyFeatures.clientSecret"}],attrs:{type:"password"},domProps:{value:e.spotifyFeatures.clientSecret},on:{input:function(i){i.target.composing||e.$set(e.spotifyFeatures,"clientSecret",i.target.value)}}})]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.username")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyUser,expression:"spotifyUser"}],attrs:{type:"text"},domProps:{value:e.spotifyUser},on:{input:function(i){i.target.composing||(e.spotifyUser=i.target.value)}}})]),e._v(" "),n("label",{staticClass:"with-checkbox"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.fallbackSearch,expression:"spotifyFeatures.fallbackSearch"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.spotifyFeatures.fallbackSearch)?e._i(e.spotifyFeatures.fallbackSearch,null)>-1:e.spotifyFeatures.fallbackSearch},on:{change:function(i){var r=e.spotifyFeatures.fallbackSearch,s=i.target,l=!!s.checked;if(Array.isArray(r)){var c=null,o=e._i(r,c);s.checked?o<0&&e.$set(e.spotifyFeatures,"fallbackSearch",r.concat([c])):o>-1&&e.$set(e.spotifyFeatures,"fallbackSearch",r.slice(0,o).concat(r.slice(o+1)))}else e.$set(e.spotifyFeatures,"fallbackSearch",l)}}}),e._v(" "),n("span",{staticClass:"checkbox-text"},[e._v(e._s(e.$t("settings.downloads.fallbackSearch")))])])],1),e._v(" "),n("footer",{staticClass:"bg-background-main"},[n("button",{staticClass:"mr-2 btn btn-primary",on:{click:e.resetToDefault}},[e._v(e._s(e.$t("settings.reset")))]),e._v(" "),n("button",{staticClass:"btn btn-primary",on:{click:e.saveSettings}},[e._v(e._s(e.$t("settings.save")))])])],1)},__vue_staticRenderFns__$1=[function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("label",[n("span",[e._v("E-mail")]),e._v(" "),n("input",{attrs:{type:"text",name:"email"}})])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("label",[n("span",[e._v("Password")]),e._v(" "),n("input",{attrs:{type:"password",name:"password"}})])}];const __vue_inject_styles__$1=function(e){!e||e("data-v-931dc1c4_0",{source:"#logged_in_info[data-v-931dc1c4]{display:flex;align-items:center;flex-direction:column;justify-content:space-evenly;height:250px}.locale-flag[data-v-931dc1c4]{justify-content:center;cursor:pointer;width:60px}.locale-flag[data-v-931dc1c4]:not(:last-child){margin-right:10px}.locale-flag.locale-flag--current[data-v-931dc1c4] svg{filter:brightness(1)!important}.locale-flag[data-v-931dc1c4] svg{width:40px!important;height:40px!important;filter:brightness(.5)}.settings-group[data-v-931dc1c4]{border-top-width:1px;border-color:gray}.settings-group__header[data-v-931dc1c4]{display:inline-flex;align-items:center;padding-top:2rem;padding-bottom:2rem;font-size:1.5rem}.settings-group__header i.material-icons[data-v-931dc1c4]{margin-right:1rem}.settings-container[data-v-931dc1c4]{display:flex}.settings-container__half[data-v-931dc1c4]{width:50%}.settings-container__third[data-v-931dc1c4]{width:33%}.settings-container__third--only-checkbox[data-v-931dc1c4]{display:flex;align-items:start;flex-direction:column;justify-content:center}.settings-container__half>*[data-v-931dc1c4],.settings-container__third>*[data-v-931dc1c4]{margin-bottom:1rem}.with-checkbox[data-v-931dc1c4]{display:flex;align-items:center}.with-checkbox [type=checkbox][data-v-931dc1c4]{cursor:pointer}.with-checkbox .checkbox-text[data-v-931dc1c4]{margin-left:10px;cursor:pointer;user-select:none}.input-group .input-group-text[data-v-931dc1c4]{margin-bottom:.5rem}",map:void 0,media:void 0})},__vue_scope_id__$1="data-v-931dc1c4",__vue_module_identifier__=void 0,__vue_is_functional_template__$1=!1;function __vue_normalize__$1(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};o.__file="Settings.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i;{let u;if(a&&(u=function(d){a.call(this,l(d))}),u!==void 0)if(o.functional){const d=o.render;o.render=function(h,m){return u.call(m),d(h,m)}}else{const d=o.beforeCreate;o.beforeCreate=d?[].concat(d,u):[u]}}return o}function __vue_create_injector__(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__.styles||(__vue_create_injector__.styles={}),n=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(r,s){if(document.querySelector('style[data-vue-ssr-id~="'+r+'"]'))return;const l=n?s.media||"default":r,c=a[l]||(a[l]={ids:[],parts:[],element:void 0});if(!c.ids.includes(r)){let o=s.source,u=c.ids.length;if(c.ids.push(r),s.map&&(o+=` + `)]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.clientID")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.clientId,expression:"spotifyFeatures.clientId"}],attrs:{type:"text"},domProps:{value:e.spotifyFeatures.clientId},on:{input:function(i){i.target.composing||e.$set(e.spotifyFeatures,"clientId",i.target.value)}}})]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.clientSecret")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.clientSecret,expression:"spotifyFeatures.clientSecret"}],attrs:{type:"password"},domProps:{value:e.spotifyFeatures.clientSecret},on:{input:function(i){i.target.composing||e.$set(e.spotifyFeatures,"clientSecret",i.target.value)}}})]),e._v(" "),n("div",{staticClass:"input-group"},[n("p",{staticClass:"input-group-text"},[e._v(e._s(e.$t("settings.spotify.username")))]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyUser,expression:"spotifyUser"}],attrs:{type:"text"},domProps:{value:e.spotifyUser},on:{input:function(i){i.target.composing||(e.spotifyUser=i.target.value)}}})]),e._v(" "),n("label",{staticClass:"with-checkbox"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.spotifyFeatures.fallbackSearch,expression:"spotifyFeatures.fallbackSearch"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.spotifyFeatures.fallbackSearch)?e._i(e.spotifyFeatures.fallbackSearch,null)>-1:e.spotifyFeatures.fallbackSearch},on:{change:function(i){var r=e.spotifyFeatures.fallbackSearch,s=i.target,l=!!s.checked;if(Array.isArray(r)){var c=null,o=e._i(r,c);s.checked?o<0&&e.$set(e.spotifyFeatures,"fallbackSearch",r.concat([c])):o>-1&&e.$set(e.spotifyFeatures,"fallbackSearch",r.slice(0,o).concat(r.slice(o+1)))}else e.$set(e.spotifyFeatures,"fallbackSearch",l)}}}),e._v(" "),n("span",{staticClass:"checkbox-text"},[e._v(e._s(e.$t("settings.downloads.fallbackSearch")))])])],1),e._v(" "),n("footer",{staticClass:"bg-background-main"},[n("button",{staticClass:"mr-2 btn btn-primary",on:{click:e.resetToDefault}},[e._v(e._s(e.$t("settings.reset")))]),e._v(" "),n("button",{staticClass:"btn btn-primary",on:{click:e.saveSettings}},[e._v(e._s(e.$t("settings.save")))])])],1)},__vue_staticRenderFns__$1=[function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("label",[n("span",[e._v("E-mail")]),e._v(" "),n("input",{attrs:{type:"text",name:"email"}})])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("label",[n("span",[e._v("Password")]),e._v(" "),n("input",{attrs:{type:"password",name:"password"}})])}];const __vue_inject_styles__$1=function(e){!e||e("data-v-80f66b50_0",{source:"#logged_in_info[data-v-80f66b50]{display:flex;align-items:center;flex-direction:column;justify-content:space-evenly;height:250px}.locale-flag[data-v-80f66b50]{justify-content:center;cursor:pointer;width:60px}.locale-flag[data-v-80f66b50]:not(:last-child){margin-right:10px}.locale-flag.locale-flag--current[data-v-80f66b50] svg{filter:brightness(1)!important}.locale-flag[data-v-80f66b50] svg{width:40px!important;height:40px!important;filter:brightness(.5)}.settings-group[data-v-80f66b50]{border-top-width:1px;border-color:gray}.settings-group__header[data-v-80f66b50]{display:inline-flex;align-items:center;padding-top:2rem;padding-bottom:2rem;font-size:1.5rem}.settings-group__header i.material-icons[data-v-80f66b50]{margin-right:1rem}.settings-container[data-v-80f66b50]{display:flex}.settings-container__half[data-v-80f66b50]{width:50%}.settings-container__third[data-v-80f66b50]{width:33%}.settings-container__third--only-checkbox[data-v-80f66b50]{display:flex;align-items:start;flex-direction:column;justify-content:center}.settings-container__half>*[data-v-80f66b50],.settings-container__third>*[data-v-80f66b50]{margin-bottom:1rem}.with-checkbox[data-v-80f66b50]{display:flex;align-items:center}.with-checkbox [type=checkbox][data-v-80f66b50]{cursor:pointer}.with-checkbox .checkbox-text[data-v-80f66b50]{margin-left:10px;cursor:pointer;user-select:none}.input-group .input-group-text[data-v-80f66b50]{margin-bottom:.5rem}",map:void 0,media:void 0})},__vue_scope_id__$1="data-v-80f66b50",__vue_module_identifier__=void 0,__vue_is_functional_template__$1=!1;function __vue_normalize__$1(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};o.__file="Settings.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i;{let u;if(a&&(u=function(d){a.call(this,l(d))}),u!==void 0)if(o.functional){const d=o.render;o.render=function(h,m){return u.call(m),d(h,m)}}else{const d=o.beforeCreate;o.beforeCreate=d?[].concat(d,u):[u]}}return o}function __vue_create_injector__(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__.styles||(__vue_create_injector__.styles={}),n=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(r,s){if(document.querySelector('style[data-vue-ssr-id~="'+r+'"]'))return;const l=n?s.media||"default":r,c=a[l]||(a[l]={ids:[],parts:[],element:void 0});if(!c.ids.includes(r)){let o=s.source,u=c.ids.length;if(c.ids.push(r),s.map&&(o+=` /*# sourceURL=`+s.map.sources[0]+" */",o+=` /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(s.map))))+" */"),n&&(c.element=c.element||document.querySelector("style[data-group="+l+"]")),!c.element){const d=c.element=document.createElement("style");d.type="text/css",s.media&&d.setAttribute("media",s.media),n&&(d.setAttribute("data-group",l),d.setAttribute("data-next-index","0")),e.appendChild(d)}if(n&&(u=parseInt(c.element.getAttribute("data-next-index")),c.element.setAttribute("data-next-index",u+1)),c.element.styleSheet)c.parts.push(o),c.element.styleSheet.cssText=c.parts.filter(Boolean).join(` `);else{const d=document.createTextNode(o),f=c.element.childNodes;f[u]&&c.element.removeChild(f[u]),f.length?c.element.insertBefore(d,f[u]):c.element.appendChild(d)}}}}var Settings=__vue_normalize__$1({render:__vue_render__$1,staticRenderFns:__vue_staticRenderFns__$1},__vue_inject_styles__$1,__vue_script__$1,__vue_scope_id__$1,__vue_is_functional_template__$1,__vue_module_identifier__,__vue_create_injector__),script={data(){return{title:"",metadata:"",release_date:"",label:"",explicit:!1,image:"",type:"empty",link:"",body:[]}},mounted(){EventBus.$on("showAlbum",this.showAlbum),EventBus.$on("showPlaylist",this.showPlaylist),EventBus.$on("showSpotifyPlaylist",this.showSpotifyPlaylist)},methods:{playPausePreview,reset(){this.title="Loading...",this.image="",this.metadata="",this.label="",this.release_date="",this.explicit=!1,this.type="empty",this.body=[]},addToQueue(e){sendAddToQueue(e.currentTarget.dataset.link)},toggleAll(e){this.body.forEach(a=>{a.type==="track"&&(a.selected=e.currentTarget.checked)})},selectedLinks(){const e=[];return this.body&&this.body.forEach(a=>{a.type==="track"&&a.selected&&e.push(this.type==="spotifyPlaylist"?a.uri:a.link)}),e.join(";")},convertDuration:Utils.convertDuration,showAlbum(e){this.reset();const{id:a,title:n,explicit_lyrics:i,label:r,artist:{name:s},tracks:l,nb_tracks:c,release_date:o,cover_xl:u}=e;this.type="album",this.link=`https://www.deezer.com/album/${a}`,this.title=n,this.explicit=i,this.label=r,this.metadata=`${s} \u2022 ${this.$tc("globals.listTabs.trackN",c)}`,this.release_date=o.substring(0,10),this.image=u,isEmpty(l)?this.body=null:this.body=l},showPlaylist(e){this.reset();const{id:a,title:n,picture_xl:i,creation_date:r,creator:{name:s},tracks:l,tracks:{length:c}}=e;this.type="playlist",this.link=`https://www.deezer.com/playlist/${a}`,this.title=n,this.image=i,this.release_date=r.substring(0,10),this.metadata=`${this.$t("globals.by",{artist:s})} \u2022 ${this.$tc("globals.listTabs.trackN",c)}`,isEmpty(l)?this.body=null:this.body=l},showSpotifyPlaylist(e){this.reset();const{uri:a,name:n,images:i,images:{length:r},owner:{display_name:s},tracks:l,tracks:{length:c}}=e;this.type="spotifyPlaylist",this.link=a,this.title=n,this.image=r?i[0].url:"https://e-cdns-images.dzcdn.net/images/cover/d41d8cd98f00b204e9800998ecf8427e/1000x1000-000000-80-0-0.jpg",this.release_date="",this.metadata=`${this.$t("globals.by",{artist:s})} \u2022 ${this.$tc("globals.listTabs.trackN",c)}`,isEmpty(l)?this.body=null:this.body=l},selectRow(e,a){a.selected=!a.selected}}};const __vue_script__=script;var __vue_render__=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{ref:"root",staticClass:"relative fixed-footer bg-background-main image-header"},[n("header",{style:{"background-image":"linear-gradient(to bottom, transparent 0%, var(--main-background) 100%), url('"+e.image+"')"}},[n("h1",{staticClass:"flex items-center m-0 text-5xl"},[e._v(` diff --git a/src/components/pages/Settings.vue b/src/components/pages/Settings.vue index df63f9d..f0965e3 100644 --- a/src/components/pages/Settings.vue +++ b/src/components/pages/Settings.vue @@ -16,6 +16,7 @@ {{ user.name || 'not logged' }} +

{{userLicense}} | {{user.country}}