diff --git a/public/js/bundle.js b/public/js/bundle.js index 16641e0..94082c0 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -2949,7 +2949,7 @@ PERFORMANCE OF THIS SOFTWARE. fiber_new `)]):e._e()]),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.currentTab==="all",expression:"currentTab === 'all'"}],staticClass:"block text-xs opacity-50 uppercase-first-letter"},[e._v(` `+e._s(e.$tc("globals.listTabs."+r.releaseType))+` - `)])])]),e._v(" "),n("td",{staticClass:"w-32 text-center xl:w-40"},[e._v(e._s(r.releaseDate))]),e._v(" "),n("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(r.releaseTracksNumber))]),e._v(" "),n("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":r.releaseLink},on:{click:function(i){return i.stopPropagation(),e.sendAddToQueue(r.releaseLink)}}},[n("i",{staticClass:"material-icons hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v("file_download")])])],1)}),0)])],1)},__vue_staticRenderFns__$d=[];const __vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_is_functional_template__$d=!1;function __vue_normalize__$d(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Artist.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var Artist=__vue_normalize__$d({render:__vue_render__$d,staticRenderFns:__vue_staticRenderFns__$d},__vue_inject_styles__$d,__vue_script__$b,__vue_scope_id__$d,__vue_is_functional_template__$d);let chartsData={},cached$1=!1;function getChartsData(){return cached$1?chartsData:(socket.emit("get_charts_data"),new Promise((e,a)=>{socket.on("init_charts",n=>{chartsData=n,cached$1=!0,socket.off("init_charts"),e(n)})}))}var script$c={methods:{previewMouseEnter,previewMouseLeave}};const __vue_script__$c=script$c;var __vue_render__$e=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("i",{staticClass:"absolute top-0 right-0 flex items-center justify-center w-full h-full text-center text-white transition-opacity duration-200 ease-in-out bg-black bg-opacity-50 rounded opacity-0 material-icons preview_controls",attrs:{title:e.$t("globals.play_hint")},on:{mouseenter:e.previewMouseEnter,mouseleave:e.previewMouseLeave}},[e._v(` + `)])])]),e._v(" "),n("td",{staticClass:"w-32 text-center xl:w-40"},[e._v(e._s(r.releaseDate))]),e._v(" "),n("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(r.releaseTracksNumber))]),e._v(" "),n("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":r.releaseLink},on:{click:function(i){return i.stopPropagation(),e.sendAddToQueue(r.releaseLink)}}},[n("i",{staticClass:"material-icons hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v("file_download")])])],1)}),0)])],1)},__vue_staticRenderFns__$d=[];const __vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_is_functional_template__$d=!1;function __vue_normalize__$d(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Artist.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var Artist=__vue_normalize__$d({render:__vue_render__$d,staticRenderFns:__vue_staticRenderFns__$d},__vue_inject_styles__$d,__vue_script__$b,__vue_scope_id__$d,__vue_is_functional_template__$d);let chartsData={},cached$1=!1;function getChartsData(){return cached$1?chartsData:(socket.emit("get_charts_data"),fetchData("getCharts"),new Promise((e,a)=>{socket.on("init_charts",n=>{chartsData=n,cached$1=!0,socket.off("init_charts"),e(n)})}))}var script$c={methods:{previewMouseEnter,previewMouseLeave}};const __vue_script__$c=script$c;var __vue_render__$e=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("i",{staticClass:"absolute top-0 right-0 flex items-center justify-center w-full h-full text-center text-white transition-opacity duration-200 ease-in-out bg-black bg-opacity-50 rounded opacity-0 material-icons preview_controls",attrs:{title:e.$t("globals.play_hint")},on:{mouseenter:e.previewMouseEnter,mouseleave:e.previewMouseLeave}},[e._v(` play_arrow `)])},__vue_staticRenderFns__$e=[];const __vue_inject_styles__$e=void 0,__vue_scope_id__$e=void 0,__vue_is_functional_template__$e=!1;function __vue_normalize__$e(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="PreviewControls.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var PreviewControls=__vue_normalize__$e({render:__vue_render__$e,staticRenderFns:__vue_staticRenderFns__$e},__vue_inject_styles__$e,__vue_script__$c,__vue_scope_id__$e,__vue_is_functional_template__$e),script$d={components:{PreviewControls},data(){return{country:"",id:0,countries:[],chart:[]}},computed:{worldwideRelease(){let e=this.countries.filter(a=>a.title==="Worldwide");return e[0]}},async created(){socket.on("setChartTracks",this.setTracklist),this.$on("hook:destroyed",()=>{socket.off("setChartTracks")});let e=await getChartsData(),a;e=e.filter(n=>(n.title==="Worldwide"&&(a=n),n.title!=="Worldwide")),e.unshift(a),this.initCharts(e)},methods:{convertDuration,playPausePreview,addToQueue(e){e.stopPropagation(),sendAddToQueue(e.currentTarget.dataset.link)},getTrackList(e){document.getElementById("content").scrollTo(0,0);const{currentTarget:{dataset:{title:a}},currentTarget:{dataset:{id:n}}}=e;this.country=a,localStorage.setItem("chart",this.country),this.id=n,socket.emit("getChartTracks",this.id)},setTracklist(e){this.chart=e},onChangeCountry(){this.country="",this.id=0},initCharts(e){if(this.countries=e,this.country=localStorage.getItem("chart")||"",!this.country)return;let a=0;for(;a{socket.on("init_settings",(n,r,i)=>{settingsData=n,defaultSettingsData=i,spotifyCredentials=r,socket.off("init_settings"),e({settingsData,defaultSettingsData,spotifyCredentials})})})}function getInitialPreviewVolume(){let e=parseInt(localStorage.getItem("previewVolume"));return isNaN(e)&&(e=80,localStorage.setItem("previewVolume",e.toString())),e}function checkInitialSlimDownloads(){return localStorage.getItem("slimDownloads")==="true"}function checkInitialSlimSidebar(){return localStorage.getItem("slimSidebar")==="true"}const state=()=>({currentCommit:null,latestCommit:null,updateAvailable:!1,deemixVersion:null,previewVolume:getInitialPreviewVolume(),hasSlimDownloads:checkInitialSlimDownloads(),hasSlimSidebar:checkInitialSlimSidebar()}),actions={setAppInfo({commit:e},a){e("SET_CURRENT_COMMIT",a.currentCommit),e("SET_LATEST_COMMIT",a.latestCommit),e("SET_UPDATE_AVAILABLE",a.updateAvailable),e("SET_DEEMIX_VERSION",a.deemixVersion)},setPreviewVolume({commit:e},a){e("SET_PREVIEW_VOLUME",a),localStorage.setItem("previewVolume",a.toString())},setSlimDownloads({commit:e},a){e("SET_SLIM_DOWNLOADS",a),localStorage.setItem("slimDownloads",a.toString())},setSlimSidebar({commit:e},a){e("SET_SLIM_SIDEBAR",a),localStorage.setItem("slimSidebar",a.toString()),Array.from(document.getElementsByClassName("toastify")).forEach(n=>{n.style.transform=`translate(${a?"3rem":"14rem"}, 0)`})}},getters={getAppInfo:e=>e,getPreviewVolume:e=>e.previewVolume,getSlimDownloads:e=>e.hasSlimDownloads,getSlimSidebar:e=>e.hasSlimSidebar},mutations={SET_CURRENT_COMMIT(e,a){e.currentCommit=a},SET_LATEST_COMMIT(e,a){e.latestCommit=a},SET_UPDATE_AVAILABLE(e,a){e.updateAvailable=a},SET_DEEMIX_VERSION(e,a){e.deemixVersion=a},SET_PREVIEW_VOLUME(e,a){e.previewVolume=a},SET_SLIM_DOWNLOADS(e,a){e.hasSlimDownloads=a},SET_SLIM_SIDEBAR(e,a){e.hasSlimSidebar=a}};var appInfo={state,getters,actions,mutations};const getDefaultState=()=>({arl:localStorage.getItem("arl")||"",status:null,user:{id:null,name:"",picture:""},spotifyUser:{id:localStorage.getItem("spotifyUser"),name:null,picture:null},clientMode:!1}),state$1=()=>getDefaultState(),actions$1={login({commit:e,dispatch:a},n){const{arl:r,user:i,status:s}=n;a("setARL",{arl:r}),e("SET_USER",i),e("SET_STATUS",s)},logout({commit:e}){localStorage.removeItem("arl"),e("RESET_LOGIN")},setARL({commit:e},a){let{arl:n,saveOnLocalStorage:r}=a;r=typeof r=="undefined"?!0:r,e("SET_ARL",n),r&&localStorage.setItem("arl",n)},removeARL({commit:e}){e("SET_ARL",""),localStorage.removeItem("arl")},setUser({commit:e},a){e("SET_USER",a)},setClientMode({commit:e},a){e("SET_CLIENT_MODE",a)}},getters$1={getARL:e=>e.arl,getUser:e=>e.user,getSpotifyUser:e=>e.spotifyUser,getClientMode:e=>e.clientMode,isLoggedIn:e=>!!e.arl,isLoggedWithSpotify:e=>!!e.spotifyUser.id},mutations$1={SET_ARL(e,a){e.arl=a},SET_STATUS(e,a){e.status=a},SET_USER(e,a){e.user=a},SET_CLIENT_MODE(e,a){e.clientMode=a},RESET_LOGIN(e){let a=e.clientMode;Object.assign(e,getDefaultState()),e.clientMode=a}};var login={state:state$1,getters:getters$1,actions:actions$1,mutations:mutations$1};const state$2=()=>({artist:"",bitrate:"",cover:"",downloaded:0,errors:[],failed:0,id:"",progress:0,silent:!0,size:0,title:"",type:"",uuid:""}),actions$2={setErrors({commit:e},a){e("SET_ERRORS",a)}},getters$2={getErrors:e=>e},mutations$2={SET_ERRORS(e,a){for(const n in e)if(e.hasOwnProperty(n)){const r=a[n];e[n]=r}}};var errors={state:state$2,getters:getters$2,actions:actions$2,mutations:mutations$2};Vue.use(index$2);var store=new index$2.Store({modules:{appInfo,login,errors},strict:!1});const favoriteArtists=ref$2([]),favoriteAlbums=ref$2([]),favoriteSpotifyPlaylists=ref$2([]),favoritePlaylists=ref$2([]),favoriteTracks=ref$2([]),isRefreshingFavorites=ref$2(!1);store.getters.isLoggedIn&&refreshFavorites({isInitial:!0});function refreshFavorites({isInitial:e=!1}){e||(isRefreshingFavorites.value=!0),socket.emit("get_favorites_data"),store.getters.isLoggedWithSpotify&&socket.emit("update_userSpotifyPlaylists",store.getters.getSpotifyUser.id)}function useFavorites(){return{favoriteArtists,favoriteAlbums,favoriteSpotifyPlaylists,favoritePlaylists,favoriteTracks,isRefreshingFavorites,refreshFavorites}}function setAllFavorites(e){const{tracks:a,albums:n,artists:r,playlists:i}=e;favoriteArtists.value=r,favoriteAlbums.value=n,favoritePlaylists.value=i,favoriteTracks.value=a}socket.on("updated_userFavorites",e=>{setAllFavorites(e)}),socket.on("init_favorites",e=>{setAllFavorites(e),isRefreshingFavorites.value=!1}),socket.on("updated_userSpotifyPlaylists",e=>{favoriteSpotifyPlaylists.value=e}),socket.on("updated_userSpotifyPlaylists",e=>{favoriteSpotifyPlaylists.value=e}),socket.on("updated_userPlaylists",e=>{favoritePlaylists.value=e}),socket.on("updated_userAlbums",e=>{favoriteAlbums.value=e}),socket.on("updated_userArtist",e=>{favoriteArtists.value=e}),socket.on("updated_userTracks",e=>{favoriteTracks.value=e});var script$g=defineComponent({components:{PreviewControls,CoverContainer,BaseTabs,BaseTab},setup(e,a){const n=reactive({activeTab:"playlist",tabs:["playlist","album","artist","track"]}),{favoriteArtists:r,favoriteAlbums:i,favoriteSpotifyPlaylists:s,favoritePlaylists:l,favoriteTracks:c,isRefreshingFavorites:o,refreshFavorites:d}=useFavorites(),u=computed(()=>a.refs.reloadButton);return watch(o,(f,h)=>{const m=h&&!f;if(!m)return;toast(a.root.$t("toasts.refreshFavs"),"done",!0)}),{...toRefs(n),tracks:c,albums:i,artists:r,playlists:l,spotifyPlaylists:s,refreshFavorites:d,isRefreshingFavorites:o}},computed:{activeTabEmpty(){let e=this.getActiveRelease();return e?.length===0}},methods:{playPausePreview,convertDuration,downloadAllOfType(){try{let e=this.getActiveRelease();if(this.activeTab==="track"){let a=this.getLovedTracksPlaylist();sendAddToQueue(a.link)}else sendAddToQueue(aggregateDownloadLinks(e))}catch(e){console.error(e.message)}},addToQueue(e){sendAddToQueue(e.currentTarget.dataset.link)},getActiveRelease(e=this.activeTab){let a;switch(e){case"playlist":a=this.playlists;break;case"album":a=this.albums;break;case"artist":a=this.artists;break;case"track":a=this.tracks;break}return a},getTabLength(e=this.activeTab){let a=this[`${e}s`]?.length;return a||0},getLovedTracksPlaylist(){let e=this.playlists.filter(a=>a.is_loved_track);if(e.length!==0)return e[0];throw new Error("No loved tracks playlist!")}}});const __vue_script__$g=script$g;var __vue_render__$i=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",[n("h1",{staticClass:"mb-8 text-5xl"},[e._v(` +`);else{const u=document.createTextNode(o),f=c.element.childNodes;f[d]&&c.element.removeChild(f[d]),f.length?c.element.insertBefore(u,f[d]):c.element.appendChild(u)}}}}var CoverContainer=__vue_normalize__$h({render:__vue_render__$h,staticRenderFns:__vue_staticRenderFns__$h},__vue_inject_styles__$h,__vue_script__$f,__vue_scope_id__$h,__vue_is_functional_template__$h,__vue_module_identifier__$a,__vue_create_injector__$a);let settingsData={},defaultSettingsData={},spotifyCredentials={};function getSettingsData(){return socket.emit("get_settings_data"),new Promise((e,a)=>{socket.on("init_settings",(n,r,i)=>{settingsData=n,defaultSettingsData=i,spotifyCredentials=r,socket.off("init_settings"),e({settingsData,defaultSettingsData,spotifyCredentials})})})}function getInitialPreviewVolume(){let e=parseInt(localStorage.getItem("previewVolume"));return isNaN(e)&&(e=80,localStorage.setItem("previewVolume",e.toString())),e}function checkInitialSlimDownloads(){return localStorage.getItem("slimDownloads")==="true"}function checkInitialSlimSidebar(){return localStorage.getItem("slimSidebar")==="true"}const state=()=>({currentCommit:null,latestCommit:null,updateAvailable:!1,deemixVersion:null,previewVolume:getInitialPreviewVolume(),hasSlimDownloads:checkInitialSlimDownloads(),hasSlimSidebar:checkInitialSlimSidebar()}),actions={setAppInfo({commit:e},a){e("SET_CURRENT_COMMIT",a.currentCommit),e("SET_LATEST_COMMIT",a.latestCommit),e("SET_UPDATE_AVAILABLE",a.updateAvailable),e("SET_DEEMIX_VERSION",a.deemixVersion)},setPreviewVolume({commit:e},a){e("SET_PREVIEW_VOLUME",a),localStorage.setItem("previewVolume",a.toString())},setSlimDownloads({commit:e},a){e("SET_SLIM_DOWNLOADS",a),localStorage.setItem("slimDownloads",a.toString())},setSlimSidebar({commit:e},a){e("SET_SLIM_SIDEBAR",a),localStorage.setItem("slimSidebar",a.toString()),Array.from(document.getElementsByClassName("toastify")).forEach(n=>{n.style.transform=`translate(${a?"3rem":"14rem"}, 0)`})}},getters={getAppInfo:e=>e,getPreviewVolume:e=>e.previewVolume,getSlimDownloads:e=>e.hasSlimDownloads,getSlimSidebar:e=>e.hasSlimSidebar},mutations={SET_CURRENT_COMMIT(e,a){e.currentCommit=a},SET_LATEST_COMMIT(e,a){e.latestCommit=a},SET_UPDATE_AVAILABLE(e,a){e.updateAvailable=a},SET_DEEMIX_VERSION(e,a){e.deemixVersion=a},SET_PREVIEW_VOLUME(e,a){e.previewVolume=a},SET_SLIM_DOWNLOADS(e,a){e.hasSlimDownloads=a},SET_SLIM_SIDEBAR(e,a){e.hasSlimSidebar=a}};var appInfo={state,getters,actions,mutations};const getDefaultState=()=>({arl:localStorage.getItem("arl")||"",status:null,user:{id:null,name:"",picture:""},spotifyUser:{id:localStorage.getItem("spotifyUser"),name:null,picture:null},clientMode:!1}),state$1=()=>getDefaultState(),actions$1={login({commit:e,dispatch:a},n){const{arl:r,user:i,status:s}=n;a("setARL",{arl:r}),e("SET_USER",i),e("SET_STATUS",s)},logout({commit:e}){localStorage.removeItem("arl"),e("RESET_LOGIN")},setARL({commit:e},a){let{arl:n,saveOnLocalStorage:r}=a;r=typeof r=="undefined"?!0:r,e("SET_ARL",n),r&&localStorage.setItem("arl",n)},removeARL({commit:e}){e("SET_ARL",""),localStorage.removeItem("arl")},setUser({commit:e},a){e("SET_USER",a)},setClientMode({commit:e},a){e("SET_CLIENT_MODE",a)}},getters$1={getARL:e=>e.arl,getUser:e=>e.user,getSpotifyUser:e=>e.spotifyUser,getClientMode:e=>e.clientMode,isLoggedIn:e=>!!e.arl,isLoggedWithSpotify:e=>!!e.spotifyUser.id},mutations$1={SET_ARL(e,a){e.arl=a},SET_STATUS(e,a){e.status=a},SET_USER(e,a){e.user=a},SET_CLIENT_MODE(e,a){e.clientMode=a},RESET_LOGIN(e){let a=e.clientMode;Object.assign(e,getDefaultState()),e.clientMode=a}};var login={state:state$1,getters:getters$1,actions:actions$1,mutations:mutations$1};const state$2=()=>({artist:"",bitrate:"",cover:"",downloaded:0,errors:[],failed:0,id:"",progress:0,silent:!0,size:0,title:"",type:"",uuid:""}),actions$2={setErrors({commit:e},a){e("SET_ERRORS",a)}},getters$2={getErrors:e=>e},mutations$2={SET_ERRORS(e,a){for(const n in e)if(e.hasOwnProperty(n)){const r=a[n];e[n]=r}}};var errors={state:state$2,getters:getters$2,actions:actions$2,mutations:mutations$2};Vue.use(index$2);var store=new index$2.Store({modules:{appInfo,login,errors},strict:!1});const favoriteArtists=ref$2([]),favoriteAlbums=ref$2([]),favoriteSpotifyPlaylists=ref$2([]),favoritePlaylists=ref$2([]),favoriteTracks=ref$2([]),isRefreshingFavorites=ref$2(!1);store.getters.isLoggedIn&&refreshFavorites({isInitial:!0});async function refreshFavorites({isInitial:e=!1}){e||(isRefreshingFavorites.value=!0);const a=await fetchData("getFavorites");if(setAllFavorites(a),store.getters.isLoggedWithSpotify){const n=await fetchData("getUserSpotifyPlaylists",{spotifyUser:store.getters.getSpotifyUser.id})}}function useFavorites(){return{favoriteArtists,favoriteAlbums,favoriteSpotifyPlaylists,favoritePlaylists,favoriteTracks,isRefreshingFavorites,refreshFavorites}}function setAllFavorites(e){const{tracks:a,albums:n,artists:r,playlists:i}=e;favoriteArtists.value=r,favoriteAlbums.value=n,favoritePlaylists.value=i,favoriteTracks.value=a}socket.on("updated_userFavorites",e=>{setAllFavorites(e)}),socket.on("init_favorites",e=>{setAllFavorites(e),isRefreshingFavorites.value=!1}),socket.on("updated_userSpotifyPlaylists",e=>{favoriteSpotifyPlaylists.value=e}),socket.on("updated_userSpotifyPlaylists",e=>{favoriteSpotifyPlaylists.value=e}),socket.on("updated_userPlaylists",e=>{favoritePlaylists.value=e}),socket.on("updated_userAlbums",e=>{favoriteAlbums.value=e}),socket.on("updated_userArtist",e=>{favoriteArtists.value=e}),socket.on("updated_userTracks",e=>{favoriteTracks.value=e});var script$g=defineComponent({components:{PreviewControls,CoverContainer,BaseTabs,BaseTab},setup(e,a){const n=reactive({activeTab:"playlist",tabs:["playlist","album","artist","track"]}),{favoriteArtists:r,favoriteAlbums:i,favoriteSpotifyPlaylists:s,favoritePlaylists:l,favoriteTracks:c,isRefreshingFavorites:o,refreshFavorites:d}=useFavorites(),u=computed(()=>a.refs.reloadButton);return watch(o,(f,h)=>{const m=h&&!f;if(!m)return;toast(a.root.$t("toasts.refreshFavs"),"done",!0)}),{...toRefs(n),tracks:c,albums:i,artists:r,playlists:l,spotifyPlaylists:s,refreshFavorites:d,isRefreshingFavorites:o}},computed:{activeTabEmpty(){let e=this.getActiveRelease();return e?.length===0}},methods:{playPausePreview,convertDuration,downloadAllOfType(){try{let e=this.getActiveRelease();if(this.activeTab==="track"){let a=this.getLovedTracksPlaylist();sendAddToQueue(a.link)}else sendAddToQueue(aggregateDownloadLinks(e))}catch(e){console.error(e.message)}},addToQueue(e){sendAddToQueue(e.currentTarget.dataset.link)},getActiveRelease(e=this.activeTab){let a;switch(e){case"playlist":a=this.playlists;break;case"album":a=this.albums;break;case"artist":a=this.artists;break;case"track":a=this.tracks;break}return a},getTabLength(e=this.activeTab){let a=this[`${e}s`]?.length;return a||0},getLovedTracksPlaylist(){let e=this.playlists.filter(a=>a.is_loved_track);if(e.length!==0)return e[0];throw new Error("No loved tracks playlist!")}}});const __vue_script__$g=script$g;var __vue_render__$i=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",[n("h1",{staticClass:"mb-8 text-5xl"},[e._v(` `+e._s(e.$t("favorites.title"))+` - `),n("div",{ref:"reloadButton",staticClass:"inline-block clickable",attrs:{role:"button","aria-label":"reload"},on:{click:e.refreshFavorites}},[n("i",{staticClass:"material-icons",class:{spin:e.isRefreshingFavorites}},[e._v("sync")])])]),e._v(" "),n("BaseTabs",e._l(e.tabs,function(r){return n("BaseTab",{key:r,class:{active:e.activeTab===r},on:{click:function(i){e.activeTab=r}}},[e._v(` + `),n("div",{ref:"reloadButton",staticClass:"inline-block clickable",attrs:{"aria-label":"reload",role:"button"},on:{click:e.refreshFavorites}},[n("i",{staticClass:"material-icons",class:{spin:e.isRefreshingFavorites}},[e._v("sync")])])]),e._v(" "),n("BaseTabs",e._l(e.tabs,function(r){return n("BaseTab",{key:r,class:{active:e.activeTab===r},on:{click:function(i){e.activeTab=r}}},[e._v(` `+e._s(e.$tc("globals.listTabs."+r,2))+` `)])}),1),e._v(" "),e.activeTabEmpty?e._e():n("button",{staticClass:"btn btn-primary",staticStyle:{"margin-bottom":"2rem"},on:{click:e.downloadAllOfType}},[e._v(` `+e._s(e.$t("globals.download",{thing:e.$tc("globals.listTabs."+e.activeTab+"N",e.getTabLength())}))+` - `)]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="playlist",expression:"activeTab === 'playlist'"}]},[e.playlists.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noPlaylists")))])]):e._e(),e._v(" "),e.playlists.length>0||e.spotifyPlaylists>0?n("div",{staticClass:"release-grid"},[e._l(e.playlists,function(r){return n("div",{key:r.id,staticClass:"release"},[n("router-link",{staticClass:"cursor-pointer",attrs:{tag:"div",to:{name:"Playlist",params:{id:r.id}}}},[n("CoverContainer",{attrs:{"is-rounded":"",cover:r.picture_medium,link:r.link},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))])],1),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(` + `)]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="playlist",expression:"activeTab === 'playlist'"}]},[e.playlists.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noPlaylists")))])]):e._e(),e._v(" "),e.playlists.length>0||e.spotifyPlaylists>0?n("div",{staticClass:"release-grid"},[e._l(e.playlists,function(r){return n("div",{key:r.id,staticClass:"release"},[n("router-link",{staticClass:"cursor-pointer",attrs:{to:{name:"Playlist",params:{id:r.id}},tag:"div"}},[n("CoverContainer",{attrs:{cover:r.picture_medium,link:r.link,"is-rounded":""},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))])],1),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(` `+e._s(e.$t("globals.by",{artist:r.creator.name})+" - "+e.$tc("globals.listTabs.trackN",r.nb_tracks))+` - `)])],1)}),e._v(" "),e._l(e.spotifyPlaylists,function(r){return n("div",{key:r.id,staticClass:"release"},[n("router-link",{staticClass:"cursor-pointer",attrs:{tag:"div",to:{name:"Spotify Playlist",params:{id:r.id}}}},[n("CoverContainer",{attrs:{"is-rounded":"",cover:r.picture_medium,link:r.link},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))])],1),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(` + `)])],1)}),e._v(" "),e._l(e.spotifyPlaylists,function(r){return n("div",{key:r.id,staticClass:"release"},[n("router-link",{staticClass:"cursor-pointer",attrs:{to:{name:"Spotify Playlist",params:{id:r.id}},tag:"div"}},[n("CoverContainer",{attrs:{cover:r.picture_medium,link:r.link,"is-rounded":""},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))])],1),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(` `+e._s(e.$t("globals.by",{artist:r.creator.name})+" - "+e.$tc("globals.listTabs.trackN",r.nb_tracks))+` - `)])],1)})],2):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="album",expression:"activeTab === 'album'"}]},[e.albums.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noAlbums")))])]):e._e(),e._v(" "),e.albums.length>0?n("div",{staticClass:"release-grid"},e._l(e.albums,function(r){return n("router-link",{key:r.id,staticClass:"release clickable",attrs:{tag:"div",to:{name:"Album",params:{id:r.id}}}},[n("CoverContainer",{attrs:{"is-rounded":"",cover:r.cover_medium,link:r.link},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))]),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(e._s(""+e.$t("globals.by",{artist:r.artist.name})))])],1)}),1):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="artist",expression:"activeTab === 'artist'"}]},[e.artists.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noArtists")))])]):e._e(),e._v(" "),e.artists.length>0?n("div",{staticClass:"release-grid"},e._l(e.artists,function(r){return n("router-link",{key:r.id,staticClass:"release clickable",attrs:{tag:"div",to:{name:"Artist",params:{id:r.id}}}},[n("CoverContainer",{attrs:{"is-circle":"",cover:r.picture_medium,link:r.link},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.name))])],1)}),1):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="track",expression:"activeTab === 'track'"}]},[e.tracks.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noTracks")))])]):e._e(),e._v(" "),e.tracks.length>0?n("table",{staticClass:"table"},e._l(e.tracks,function(r){return n("tr",{staticClass:"track_row"},[n("td",{staticClass:"p-3 text-center cursor-default",class:{first:r.position===1}},[e._v(` + `)])],1)})],2):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="album",expression:"activeTab === 'album'"}]},[e.albums.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noAlbums")))])]):e._e(),e._v(" "),e.albums.length>0?n("div",{staticClass:"release-grid"},e._l(e.albums,function(r){return n("router-link",{key:r.id,staticClass:"release clickable",attrs:{to:{name:"Album",params:{id:r.id}},tag:"div"}},[n("CoverContainer",{attrs:{cover:r.cover_medium,link:r.link,"is-rounded":""},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.title))]),e._v(" "),n("p",{staticClass:"secondary-text"},[e._v(e._s(""+e.$t("globals.by",{artist:r.artist.name})))])],1)}),1):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="artist",expression:"activeTab === 'artist'"}]},[e.artists.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noArtists")))])]):e._e(),e._v(" "),e.artists.length>0?n("div",{staticClass:"release-grid"},e._l(e.artists,function(r){return n("router-link",{key:r.id,staticClass:"release clickable",attrs:{to:{name:"Artist",params:{id:r.id}},tag:"div"}},[n("CoverContainer",{attrs:{cover:r.picture_medium,link:r.link,"is-circle":""},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}}),e._v(" "),n("p",{staticClass:"primary-text"},[e._v(e._s(r.name))])],1)}),1):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="track",expression:"activeTab === 'track'"}]},[e.tracks.length==0?n("div",[n("h1",[e._v(e._s(e.$t("favorites.noTracks")))])]):e._e(),e._v(" "),e.tracks.length>0?n("table",{staticClass:"table"},e._l(e.tracks,function(r){return n("tr",{staticClass:"track_row"},[n("td",{staticClass:"p-3 text-center cursor-default",class:{first:r.position===1}},[e._v(` `+e._s(r.position)+` `)]),e._v(" "),n("td",[n("span",{staticClass:"relative inline-block rounded cursor-pointer",attrs:{"data-preview":r.preview},on:{click:e.playPausePreview}},[r.preview?n("PreviewControls"):e._e(),e._v(" "),n("img",{staticClass:"rounded coverart",attrs:{src:r.album.cover_small}})],1)]),e._v(" "),n("td",{staticClass:"table__cell--large"},[e._v(` `+e._s(r.title+(r.title_version&&r.title.indexOf(r.title_version)==-1?" "+r.title_version:""))+` - `)]),e._v(" "),n("router-link",{staticClass:"table__cell table__cell--medium table__cell--center clickable",attrs:{tag:"td",to:{name:"Artist",params:{id:r.artist.id}}}},[e._v(` + `)]),e._v(" "),n("router-link",{staticClass:"table__cell table__cell--medium table__cell--center clickable",attrs:{to:{name:"Artist",params:{id:r.artist.id}},tag:"td"}},[e._v(` `+e._s(r.artist.name)+` - `)]),e._v(" "),n("router-link",{staticClass:"table__cell--medium table__cell--center clickable",attrs:{tag:"td",to:{name:"Album",params:{id:r.album.id}}}},[e._v(` + `)]),e._v(" "),n("router-link",{staticClass:"table__cell--medium table__cell--center clickable",attrs:{to:{name:"Album",params:{id:r.album.id}},tag:"td"}},[e._v(` `+e._s(r.album.title)+` `)]),e._v(" "),n("td",{staticClass:"table__cell--small"},[e._v(` `+e._s(e.convertDuration(r.duration))+` - `)]),e._v(" "),n("td",{staticClass:"cursor-pointer group",attrs:{"data-link":r.link,role:"button","aria-label":"download"},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}},[n("div",{staticClass:"table__cell-content table__cell-content--vertical-center"},[n("i",{staticClass:"transition-colors duration-150 ease-in-out material-icons group-hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v(` + `)]),e._v(" "),n("td",{staticClass:"cursor-pointer group",attrs:{"data-link":r.link,"aria-label":"download",role:"button"},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}},[n("div",{staticClass:"table__cell-content table__cell-content--vertical-center"},[n("i",{staticClass:"transition-colors duration-150 ease-in-out material-icons group-hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v(` get_app `)])])])],1)}),0):e._e()])],1)},__vue_staticRenderFns__$i=[];const __vue_inject_styles__$i=void 0,__vue_scope_id__$i=void 0,__vue_is_functional_template__$i=!1;function __vue_normalize__$i(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Favorites.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var Favorites=__vue_normalize__$i({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},__vue_inject_styles__$i,__vue_script__$g,__vue_scope_id__$i,__vue_is_functional_template__$i);let homeData={},cached$2=!1;async function getHomeData(){if(cached$2)return homeData;{const e=await fetchData("getHome");return homeData=e,cached$2=!0,e}}var script$h={components:{CoverContainer},data(){return{playlists:[],albums:[]}},async created(){const e=await getHomeData();this.initHome(e)},computed:{...mapGetters(["isLoggedIn"])},methods:{addToQueue(e){sendAddToQueue(e.currentTarget.dataset.link)},initHome(e){const{playlists:{data:a},albums:{data:n}}=e;this.playlists=a,this.albums=n}}};const __vue_script__$h=script$h;var __vue_render__$j=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{attrs:{id:"home_tab"}},[n("h1",{staticClass:"mb-8 text-5xl"},[e._v(e._s(e.$t("globals.welcome")))]),e._v(" "),e.isLoggedIn?e._e():n("section",{ref:"notLogged",staticClass:"py-6 border-0 border-t border-solid border-grayscale-500"},[n("p",{staticClass:"mb-4",attrs:{id:"home_not_logged_text"}},[e._v(e._s(e.$t("home.needTologin")))]),e._v(" "),n("router-link",{staticClass:"btn btn-primary",attrs:{tag:"button",name:"button",to:{name:"Settings"}}},[e._v(` `+e._s(e.$t("home.openSettings"))+` @@ -4760,7 +4760,7 @@ PERFORMANCE OF THIS SOFTWARE. /*# 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 u=c.element=document.createElement("style");u.type="text/css",s.media&&u.setAttribute("media",s.media),n&&(u.setAttribute("data-group",l),u.setAttribute("data-next-index","0")),e.appendChild(u)}if(n&&(d=parseInt(c.element.getAttribute("data-next-index")),c.element.setAttribute("data-next-index",d+1)),c.element.styleSheet)c.parts.push(o),c.element.styleSheet.cssText=c.parts.filter(Boolean).join(` `);else{const u=document.createTextNode(o),f=c.element.childNodes;f[d]&&c.element.removeChild(f[d]),f.length?c.element.insertBefore(u,f[d]):c.element.appendChild(u)}}}}var BaseAccordion=__vue_normalize__$s({render:__vue_render__$s,staticRenderFns:__vue_staticRenderFns__$s},__vue_inject_styles__$s,__vue_script__$q,__vue_scope_id__$s,__vue_is_functional_template__$s,__vue_module_identifier__$b,__vue_create_injector__$b),script$r={components:{BaseAccordion},props:{templateVariables:{type:Array,required:!0}}};const __vue_script__$r=script$r;var __vue_render__$t=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("BaseAccordion",{staticStyle:{"--arrow-v-align":"baseline","margin-bottom":"3rem"},scopedSlots:e._u([{key:"title",fn:function(){return[e._t("title")]},proxy:!0}],null,!0)},[e._v(" "),n("div",{staticClass:"flex flex-wrap p-4 space-x-2 rounded-2xl bg-background-secondary"},e._l(e.templateVariables,function(r){return n("span",{staticClass:"inline-block p-2 mt-2 tracking-wider rounded cursor-pointer bg-panels-bg first:ml-2 hover:shadow-outline",on:{click:function(i){return e.$emit("variable-click",r)}}},[e._v(` `+e._s(r)+` - `)])}),0)])},__vue_staticRenderFns__$t=[];const __vue_inject_styles__$t=void 0,__vue_scope_id__$t=void 0,__vue_is_functional_template__$t=!1;function __vue_normalize__$t(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="TemplateVariablesList.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var TemplateVariablesList=__vue_normalize__$t({render:__vue_render__$t,staticRenderFns:__vue_staticRenderFns__$t},__vue_inject_styles__$t,__vue_script__$r,__vue_scope_id__$t,__vue_is_functional_template__$t),script$s={components:{BaseAccordion,TemplateVariablesList},data(){return{flags:flags$1,currentLocale:this.$i18n.locale,locales:this.$i18n.availableLocales,settings:{tags:{}},lastSettings:{},spotifyFeatures:{},lastCredentials:{},defaultSettings:{},lastUser:"",spotifyUser:"",accountNum:0,accounts:[],trackTemplateVariables}},computed:{...mapGetters({arl:"getARL",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$1(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);let r=localStorage.getItem("accountNum");r&&(this.accountNum=r);let i=localStorage.getItem("spotifyUser");i&&(this.lastUser=i,this.spotifyUser=i,socket.emit("update_userSpotifyPlaylists",i)),socket.on("updateSettings",this.updateSettings),socket.on("accountChanged",this.accountChanged),socket.on("familyAccounts",this.initAccounts),socket.on("downloadFolderSelected",this.downloadFolderSelected),socket.on("applogin_arl",this.loggedInViaDeezer),this.$on("hook:destroyed",()=>{socket.off("updateSettings"),socket.off("accountChanged"),socket.off("familyAccounts"),socket.off("downloadFolderSelected"),socket.off("applogin_arl")})},methods:{...mapActions({dispatchARL:"setARL",setPreviewVolume:"setPreviewVolume",setSlimDownloads:"setSlimDownloads",setSlimSidebar:"setSlimSidebar"}),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(){let 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.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),e=!0),socket.emit("saveSettings",this.lastSettings,this.lastCredentials,e?this.lastUser:!1)},selectDownloadFolder(){socket.emit("selectDownloadFolder")},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}),socket.emit("login",e,!0,this.accountNum)},login(){let e=this.$refs.loginInput.value.trim();e&&e!==this.arl&&socket.emit("login",e,!0,this.accountNum)},appLogin(e){socket.emit("applogin")},changeAccount(){socket.emit("changeAccount",this.accountNum)},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},logout(){socket.emit("logout")},initSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.init"),"settings")},updateSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.update"),"settings")},resetToDefault(){const e=confirm(this.$t("settings.resetMessage"));if(!e)return;this.settings=JSON.parse(JSON.stringify(this.defaultSettings)),toast(this.$t("settings.toasts.reset"),"settings")}}};const __vue_script__$s=script$s;var __vue_render__$u=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(` + `)])}),0)])},__vue_staticRenderFns__$t=[];const __vue_inject_styles__$t=void 0,__vue_scope_id__$t=void 0,__vue_is_functional_template__$t=!1;function __vue_normalize__$t(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="TemplateVariablesList.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var TemplateVariablesList=__vue_normalize__$t({render:__vue_render__$t,staticRenderFns:__vue_staticRenderFns__$t},__vue_inject_styles__$t,__vue_script__$r,__vue_scope_id__$t,__vue_is_functional_template__$t),script$s={components:{BaseAccordion,TemplateVariablesList},data(){return{flags:flags$1,currentLocale:this.$i18n.locale,locales:this.$i18n.availableLocales,settings:{tags:{}},lastSettings:{},spotifyFeatures:{},lastCredentials:{},defaultSettings:{},lastUser:"",spotifyUser:"",accountNum:0,accounts:[],trackTemplateVariables}},computed:{...mapGetters({arl:"getARL",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$1(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);let r=localStorage.getItem("accountNum");r&&(this.accountNum=r);let i=localStorage.getItem("spotifyUser");i&&(this.lastUser=i,this.spotifyUser=i,socket.emit("update_userSpotifyPlaylists",i)),socket.on("updateSettings",this.updateSettings),socket.on("accountChanged",this.accountChanged),socket.on("familyAccounts",this.initAccounts),socket.on("downloadFolderSelected",this.downloadFolderSelected),socket.on("applogin_arl",this.loggedInViaDeezer),this.$on("hook:destroyed",()=>{socket.off("updateSettings"),socket.off("accountChanged"),socket.off("familyAccounts"),socket.off("downloadFolderSelected"),socket.off("applogin_arl")})},methods:{...mapActions({dispatchARL:"setARL",setPreviewVolume:"setPreviewVolume",setSlimDownloads:"setSlimDownloads",setSlimSidebar:"setSlimSidebar"}),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(){let 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.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),e=!0),socket.emit("saveSettings",this.lastSettings,this.lastCredentials,e?this.lastUser:!1)},selectDownloadFolder(){socket.emit("selectDownloadFolder")},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))},async loggedInViaDeezer(e){this.dispatchARL({arl:e})},async login(){let e=this.$refs.loginInput.value.trim();if(e&&e!==this.arl){const a=await fetchData("login",{arl:e,force:!0,child:this.accountNum});this.loggedInViaDeezer(a.arl)}},appLogin(e){socket.emit("applogin")},changeAccount(){socket.emit("changeAccount",this.accountNum)},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},logout(){socket.emit("logout")},initSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.init"),"settings")},updateSettings(e,a){this.loadSettings(e),this.loadCredentials(a),toast(this.$t("settings.toasts.update"),"settings")},resetToDefault(){const e=confirm(this.$t("settings.resetMessage"));if(!e)return;this.settings=JSON.parse(JSON.stringify(this.defaultSettings)),toast(this.$t("settings.toasts.reset"),"settings")}}};const __vue_script__$s=script$s;var __vue_render__$u=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(` `+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(r){var i=Array.prototype.filter.call(r.target.options,function(s){return s.selected}).map(function(s){var l="_value"in s?s._value:s.value;return l});e.accountNum=r.target.multiple?i:i[0]},e.changeAccount]}},e._l(e.accounts,function(r,i){return n("option",{key:r,domProps:{value:i.toString()}},[e._v(` `+e._s(r.name)+` @@ -4802,7 +4802,7 @@ PERFORMANCE OF THIS SOFTWARE. `+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(r){if(r.target.composing)return;e.$set(e.spotifyFeatures,"clientId",r.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(r){if(r.target.composing)return;e.$set(e.spotifyFeatures,"clientSecret",r.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(r){if(r.target.composing)return;e.spotifyUser=r.target.value}}})])],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__$u=[];const __vue_inject_styles__$u=function(e){if(!e)return;e("data-v-580f260e_0",{source:"#logged_in_info[data-v-580f260e]{display:flex;align-items:center;flex-direction:column;justify-content:space-evenly;height:250px}.locale-flag[data-v-580f260e]{justify-content:center;cursor:pointer;width:60px}.locale-flag[data-v-580f260e]:not(:last-child){margin-right:10px}.locale-flag.locale-flag--current svg[data-v-580f260e]{filter:brightness(1)}.locale-flag[data-v-580f260e] svg{width:40px!important;height:40px!important;filter:brightness(.5)}.settings-group[data-v-580f260e]{border-top-width:1px;border-color:gray}.settings-group__header[data-v-580f260e]{display:inline-flex;align-items:center;padding-top:2rem;padding-bottom:2rem;font-size:1.5rem}.settings-group__header i.material-icons[data-v-580f260e]{margin-right:1rem}.settings-container[data-v-580f260e]{display:flex}.settings-container__half[data-v-580f260e]{width:50%}.settings-container__third[data-v-580f260e]{width:33%}.settings-container__third--only-checkbox[data-v-580f260e]{display:flex;align-items:start;flex-direction:column;justify-content:center}.settings-container__half>*[data-v-580f260e],.settings-container__third>*[data-v-580f260e]{margin-bottom:1rem}.with-checkbox[data-v-580f260e]{display:flex;align-items:center}.with-checkbox [type=checkbox][data-v-580f260e]{cursor:pointer}.with-checkbox .checkbox-text[data-v-580f260e]{margin-left:10px;cursor:pointer;user-select:none}.input-group .input-group-text[data-v-580f260e]{margin-bottom:.5rem}",map:void 0,media:void 0})},__vue_scope_id__$u="data-v-580f260e",__vue_module_identifier__$c=void 0,__vue_is_functional_template__$u=!1;function __vue_normalize__$u(e,a,n,r,i,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,i&&(o.functional=!0)),o._scopeId=r;{let d;if(a&&(d=function(u){a.call(this,l(u))}),d!==void 0)if(o.functional){const u=o.render;o.render=function(h,m){return d.call(m),u(h,m)}}else{const u=o.beforeCreate;o.beforeCreate=u?[].concat(u,d):[d]}}return o}function __vue_create_injector__$c(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__$c.styles||(__vue_create_injector__$c.styles={}),n=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(i,s){if(document.querySelector('style[data-vue-ssr-id~="'+i+'"]'))return;const l=n?s.media||"default":i,c=a[l]||(a[l]={ids:[],parts:[],element:void 0});if(!c.ids.includes(i)){let o=s.source,d=c.ids.length;if(c.ids.push(i),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(r){if(r.target.composing)return;e.$set(e.spotifyFeatures,"clientId",r.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(r){if(r.target.composing)return;e.$set(e.spotifyFeatures,"clientSecret",r.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(r){if(r.target.composing)return;e.spotifyUser=r.target.value}}})])],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__$u=[];const __vue_inject_styles__$u=function(e){if(!e)return;e("data-v-17440f18_0",{source:"#logged_in_info[data-v-17440f18]{display:flex;align-items:center;flex-direction:column;justify-content:space-evenly;height:250px}.locale-flag[data-v-17440f18]{justify-content:center;cursor:pointer;width:60px}.locale-flag[data-v-17440f18]:not(:last-child){margin-right:10px}.locale-flag.locale-flag--current svg[data-v-17440f18]{filter:brightness(1)}.locale-flag[data-v-17440f18] svg{width:40px!important;height:40px!important;filter:brightness(.5)}.settings-group[data-v-17440f18]{border-top-width:1px;border-color:gray}.settings-group__header[data-v-17440f18]{display:inline-flex;align-items:center;padding-top:2rem;padding-bottom:2rem;font-size:1.5rem}.settings-group__header i.material-icons[data-v-17440f18]{margin-right:1rem}.settings-container[data-v-17440f18]{display:flex}.settings-container__half[data-v-17440f18]{width:50%}.settings-container__third[data-v-17440f18]{width:33%}.settings-container__third--only-checkbox[data-v-17440f18]{display:flex;align-items:start;flex-direction:column;justify-content:center}.settings-container__half>*[data-v-17440f18],.settings-container__third>*[data-v-17440f18]{margin-bottom:1rem}.with-checkbox[data-v-17440f18]{display:flex;align-items:center}.with-checkbox [type=checkbox][data-v-17440f18]{cursor:pointer}.with-checkbox .checkbox-text[data-v-17440f18]{margin-left:10px;cursor:pointer;user-select:none}.input-group .input-group-text[data-v-17440f18]{margin-bottom:.5rem}",map:void 0,media:void 0})},__vue_scope_id__$u="data-v-17440f18",__vue_module_identifier__$c=void 0,__vue_is_functional_template__$u=!1;function __vue_normalize__$u(e,a,n,r,i,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,i&&(o.functional=!0)),o._scopeId=r;{let d;if(a&&(d=function(u){a.call(this,l(u))}),d!==void 0)if(o.functional){const u=o.render;o.render=function(h,m){return d.call(m),u(h,m)}}else{const u=o.beforeCreate;o.beforeCreate=u?[].concat(u,d):[d]}}return o}function __vue_create_injector__$c(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__$c.styles||(__vue_create_injector__$c.styles={}),n=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());return function(i,s){if(document.querySelector('style[data-vue-ssr-id~="'+i+'"]'))return;const l=n?s.media||"default":i,c=a[l]||(a[l]={ids:[],parts:[],element:void 0});if(!c.ids.includes(i)){let o=s.source,d=c.ids.length;if(c.ids.push(i),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 u=c.element=document.createElement("style");u.type="text/css",s.media&&u.setAttribute("media",s.media),n&&(u.setAttribute("data-group",l),u.setAttribute("data-next-index","0")),e.appendChild(u)}if(n&&(d=parseInt(c.element.getAttribute("data-next-index")),c.element.setAttribute("data-next-index",d+1)),c.element.styleSheet)c.parts.push(o),c.element.styleSheet.cssText=c.parts.filter(Boolean).join(` `);else{const u=document.createTextNode(o),f=c.element.childNodes;f[d]&&c.element.removeChild(f[d]),f.length?c.element.insertBefore(u,f[d]):c.element.appendChild(u)}}}}var Settings=__vue_normalize__$u({render:__vue_render__$u,staticRenderFns:__vue_staticRenderFns__$u},__vue_inject_styles__$u,__vue_script__$s,__vue_scope_id__$u,__vue_is_functional_template__$u,__vue_module_identifier__$c,__vue_create_injector__$c),script$t={data(){return{title:"",metadata:"",release_date:"",label:"",explicit:!1,image:"",type:"empty",link:"",body:[]}},mounted(){socket.on("show_album",this.showAlbum),socket.on("show_playlist",this.showPlaylist),socket.on("show_spotifyplaylist",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(){var 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:r,label:i,artist:{name:s},tracks:l,tracks:{length:c},release_date:o,cover_xl:d}=e;this.type="album",this.link=`https://www.deezer.com/album/${a}`,this.title=n,this.explicit=r,this.label=i,this.metadata=`${s} \u2022 ${this.$tc("globals.listTabs.trackN",c)}`,this.release_date=o.substring(0,10),this.image=d,isEmpty(l)?this.body=null:this.body=l},showPlaylist(e){this.reset();const{id:a,title:n,picture_xl:r,creation_date:i,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=r,this.release_date=i.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:r,images:{length:i},owner:{display_name:s},tracks:l,tracks:{length:c}}=e;this.type="spotifyPlaylist",this.link=a,this.title=n,this.image=i?r[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__$t=script$t;var __vue_render__$v=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(` @@ -4827,5 +4827,5 @@ PERFORMANCE OF THIS SOFTWARE. `)]),e._v(" "),n("td",[e._v(e._s(r.artists[0].name))]),e._v(" "),n("td",[e._v(e._s(r.album.name))]),e._v(" "),n("td",[e._v(e._s(e.convertDuration(Math.floor(r.duration_ms/1e3))))]),e._v(" "),n("td",[n("input",{directives:[{name:"model",rawName:"v-model",value:r.selected,expression:"track.selected"}],staticClass:"clickable",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(r.selected)?e._i(r.selected,null)>-1:r.selected},on:{change:function(s){var l=r.selected,c=s.target,o=!!c.checked;if(Array.isArray(l)){var d=null,u=e._i(l,d);c.checked?u<0&&e.$set(r,"selected",l.concat([d])):u>-1&&e.$set(r,"selected",l.slice(0,u).concat(l.slice(u+1)))}else e.$set(r,"selected",o)}}})])])})],2)]),e._v(" "),e.label?n("span",{staticStyle:{opacity:"0.4","margin-top":"8px",display:"inline-block","font-size":"13px"}},[e._v(e._s(e.label))]):e._e(),e._v(" "),n("footer",{staticClass:"bg-background-main"},[n("button",{staticClass:"mr-2 btn btn-primary",attrs:{"data-link":e.link},on:{click:function(r){return r.stopPropagation(),e.addToQueue(r)}}},[e._v(` `+e._s(""+e.$t("globals.download",{thing:e.$tc("globals.listTabs."+e.type,1)}))+` `)]),e._v(" "),n("button",{staticClass:"flex items-center btn btn-primary",attrs:{"data-link":e.selectedLinks()},on:{click:function(r){return r.stopPropagation(),e.addToQueue(r)}}},[e._v(` - `+e._s(e.$t("tracklist.downloadSelection"))),n("i",{staticClass:"ml-2 material-icons"},[e._v("file_download")])])])])},__vue_staticRenderFns__$v=[function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("th",[n("i",{staticClass:"material-icons"},[e._v("music_note")])])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("th",[n("i",{staticClass:"material-icons"},[e._v("timer")])])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("td",[n("div",{staticClass:"table__cell-content table__cell-content--vertical-center",staticStyle:{opacity:"0.54"}},[n("i",{staticClass:"material-icons"},[e._v("album")])])])}];const __vue_inject_styles__$v=void 0,__vue_scope_id__$v=void 0,__vue_is_functional_template__$v=!1;function __vue_normalize__$v(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Tracklist.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var Tracklist=__vue_normalize__$v({render:__vue_render__$v,staticRenderFns:__vue_staticRenderFns__$v},__vue_inject_styles__$v,__vue_script__$t,__vue_scope_id__$v,__vue_is_functional_template__$v);Vue.use(VueRouter);const routes=[{path:window.location.pathname,name:"Home",component:Home,meta:{notKeepAlive:!0}},{path:"/tracklist/:type/:id",name:"Tracklist",component:Tracklist},{path:"/artist/:id",name:"Artist",component:Artist,meta:{notKeepAlive:!0}},{path:"/album/:id",name:"Album",component:Tracklist},{path:"/playlist/:id",name:"Playlist",component:Tracklist},{path:"/spotify-playlist/:id",name:"Spotify Playlist",component:Tracklist},{path:"/charts",name:"Charts",component:Charts,meta:{notKeepAlive:!0}},{path:"/favorites",name:"Favorites",component:Favorites,meta:{notKeepAlive:!0}},{path:"/errors",name:"Errors",component:Errors},{path:"/link-analyzer",name:"Link Analyzer",component:LinkAnalyzer},{path:"/info-arl",name:"ARL",component:InfoArl},{path:"/info-spotify",name:"Spotify Features",component:InfoSpotifyFeatures},{path:"/settings",name:"Settings",component:Settings},{path:"/search",name:"Search",component:Search,meta:{notKeepAlive:!0}},{path:"*",component:Home}],router=new VueRouter({mode:"history",routes,scrollBehavior(e,a,n){return{x:0,y:0}}});router.beforeEach((e,a,n)=>{let r=null;switch(e.name){case"Tracklist":r={type:e.params.type,id:e.params.id};break;case"Album":r={type:"album",id:e.params.id};break;case"Playlist":r={type:"playlist",id:e.params.id};break;case"Spotify Playlist":r={type:"spotifyplaylist",id:e.params.id};break}r&&socket.emit("getTracklist",r),n()});async function startApp(){new Vue({store,router,i18n,render:a=>a(App)}).$mount("#app");const e=await(await fetch("connect")).json();if(store.dispatch("setAppInfo",e.update),e.autologin){console.info("Autologin successful");let a=localStorage.getItem("arl");const n=localStorage.getItem("accountNum");if(a){a=a.trim();let r;n!==0?r=await fetchData("login",{arl:a,force:!0,child:n||0}):r=await fetchData("login",{arl:a}),loggedIn(r)}}}function initClient(){store.dispatch("setClientMode",!0),setClientModeKeyBindings()}document.addEventListener("DOMContentLoaded",startApp),window.addEventListener("pywebviewready",initClient),document.addEventListener("paste",e=>{if(e.target.localName==="input")return;let a=e.clipboardData.getData("Text");if(isValidURL(a))router.currentRoute.name==="Link Analyzer"?socket.emit("analyzeLink",a):(a.indexOf(` -`)!=-1&&(a=a.replace(/\n/g,";")),sendAddToQueue(a));else{let n=document.querySelector("#searchbar");n.select(),n.setSelectionRange(0,99999)}});function setClientModeKeyBindings(){document.addEventListener("keyup",e=>{e.altKey&&e.key==="ArrowLeft"&&router.back(),e.altKey&&e.key==="ArrowRight"&&router.forward()})}socket.on("message",function(e){console.log(e)});function loggedIn(e){console.log({data:e});const{status:a,user:n}=e;switch(a){case 1:case 3:toast(i18n.t("toasts.loggedIn"),"done",!0,"login-toast"),store.dispatch("login",e);break;case 2:toast(i18n.t("toasts.alreadyLogged"),"done",!0,"login-toast"),store.dispatch("setUser",n);break;case 0:toast(i18n.t("toasts.loginFailed"),"close",!0,"login-toast"),store.dispatch("removeARL");break;case-1:toast(i18n.t("toasts.deezerNotAvailable"),"close",!0,"login-toast");return}}socket.on("restoringQueue",function(){toast(i18n.t("toasts.restoringQueue"),"loading",!1,"restoring_queue")}),socket.on("cancellingCurrentItem",function(e){toast(i18n.t("toasts.cancellingCurrentItem"),"loading",!1,"cancelling_"+e)}),socket.on("currentItemCancelled",function(e){toast(i18n.t("toasts.currentItemCancelled"),"done",!0,"cancelling_"+e)}),socket.on("startAddingArtist",function(e){toast(i18n.t("toasts.startAddingArtist",{artist:e.name}),"loading",!1,"artist_"+e.id)}),socket.on("finishAddingArtist",function(e){toast(i18n.t("toasts.finishAddingArtist",{artist:e.name}),"done",!0,"artist_"+e.id)}),socket.on("startConvertingSpotifyPlaylist",function(e){toast(i18n.t("toasts.startConvertingSpotifyPlaylist"),"loading",!1,"spotifyplaylist_"+e)}),socket.on("finishConvertingSpotifyPlaylist",function(e){toast(i18n.t("toasts.finishConvertingSpotifyPlaylist"),"done",!0,"spotifyplaylist_"+e)}),socket.on("errorMessage",function(e){toast(e,"error")}),socket.on("queueError",function(e){e.errid?toast(e.link+" - "+i18n.t(`errors.ids.${e.errid}`),"error"):toast(e.link+" - "+e.error,"error")}),socket.on("alreadyInQueue",function(e){toast(i18n.t("toasts.alreadyInQueue",{item:e.title}),"playlist_add_check")}),socket.on("loginNeededToDownload",function(e){toast(i18n.t("toasts.loginNeededToDownload"),"report")}),socket.on("startGeneratingItems",function(e){toast(i18n.t("toasts.startGeneratingItems",{n:e.total}),"loading",!1,"batch_"+e.uuid)}),socket.on("finishGeneratingItems",function(e){toast(i18n.t("toasts.finishGeneratingItems",{n:e.total}),"done",!0,"batch_"+e.uuid)}); + `+e._s(e.$t("tracklist.downloadSelection"))),n("i",{staticClass:"ml-2 material-icons"},[e._v("file_download")])])])])},__vue_staticRenderFns__$v=[function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("th",[n("i",{staticClass:"material-icons"},[e._v("music_note")])])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("th",[n("i",{staticClass:"material-icons"},[e._v("timer")])])},function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("td",[n("div",{staticClass:"table__cell-content table__cell-content--vertical-center",staticStyle:{opacity:"0.54"}},[n("i",{staticClass:"material-icons"},[e._v("album")])])])}];const __vue_inject_styles__$v=void 0,__vue_scope_id__$v=void 0,__vue_is_functional_template__$v=!1;function __vue_normalize__$v(e,a,n,r,i,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Tracklist.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var Tracklist=__vue_normalize__$v({render:__vue_render__$v,staticRenderFns:__vue_staticRenderFns__$v},__vue_inject_styles__$v,__vue_script__$t,__vue_scope_id__$v,__vue_is_functional_template__$v);Vue.use(VueRouter);const routes=[{path:window.location.pathname,name:"Home",component:Home,meta:{notKeepAlive:!0}},{path:"/tracklist/:type/:id",name:"Tracklist",component:Tracklist},{path:"/artist/:id",name:"Artist",component:Artist,meta:{notKeepAlive:!0}},{path:"/album/:id",name:"Album",component:Tracklist},{path:"/playlist/:id",name:"Playlist",component:Tracklist},{path:"/spotify-playlist/:id",name:"Spotify Playlist",component:Tracklist},{path:"/charts",name:"Charts",component:Charts,meta:{notKeepAlive:!0}},{path:"/favorites",name:"Favorites",component:Favorites,meta:{notKeepAlive:!0}},{path:"/errors",name:"Errors",component:Errors},{path:"/link-analyzer",name:"Link Analyzer",component:LinkAnalyzer},{path:"/info-arl",name:"ARL",component:InfoArl},{path:"/info-spotify",name:"Spotify Features",component:InfoSpotifyFeatures},{path:"/settings",name:"Settings",component:Settings},{path:"/search",name:"Search",component:Search,meta:{notKeepAlive:!0}},{path:"*",component:Home}],router=new VueRouter({mode:"history",routes,scrollBehavior(e,a,n){return{x:0,y:0}}});router.beforeEach((e,a,n)=>{let r=null;switch(e.name){case"Tracklist":r={type:e.params.type,id:e.params.id};break;case"Album":r={type:"album",id:e.params.id};break;case"Playlist":r={type:"playlist",id:e.params.id};break;case"Spotify Playlist":r={type:"spotifyplaylist",id:e.params.id};break}r&&(socket.emit("getTracklist",r),fetchData("getTracklist",r)),n()});async function startApp(){new Vue({store,router,i18n,render:a=>a(App)}).$mount("#app");const e=await(await fetch("connect")).json();if(store.dispatch("setAppInfo",e.update),e.autologin){console.info("Autologin");let a=localStorage.getItem("arl");const n=localStorage.getItem("accountNum");if(a){a=a.trim();let r;n!==0?r=await fetchData("login",{arl:a,force:!0,child:n||0}):r=await fetchData("login",{arl:a}),loggedIn(r)}}}function initClient(){store.dispatch("setClientMode",!0),setClientModeKeyBindings()}document.addEventListener("DOMContentLoaded",startApp),window.addEventListener("pywebviewready",initClient),document.addEventListener("paste",e=>{if(e.target.localName==="input")return;let a=e.clipboardData.getData("Text");if(isValidURL(a))router.currentRoute.name==="Link Analyzer"?socket.emit("analyzeLink",a):(a.indexOf(` +`)!=-1&&(a=a.replace(/\n/g,";")),sendAddToQueue(a));else{let n=document.querySelector("#searchbar");n.select(),n.setSelectionRange(0,99999)}});function setClientModeKeyBindings(){document.addEventListener("keyup",e=>{e.altKey&&e.key==="ArrowLeft"&&router.back(),e.altKey&&e.key==="ArrowRight"&&router.forward()})}socket.on("message",function(e){console.log(e)});function loggedIn(e){const{status:a,user:n}=e;switch(a){case 1:case 3:toast(i18n.t("toasts.loggedIn"),"done",!0,"login-toast"),store.dispatch("login",e);break;case 2:toast(i18n.t("toasts.alreadyLogged"),"done",!0,"login-toast"),store.dispatch("setUser",n);break;case 0:toast(i18n.t("toasts.loginFailed"),"close",!0,"login-toast"),store.dispatch("removeARL");break;case-1:toast(i18n.t("toasts.deezerNotAvailable"),"close",!0,"login-toast");return}}socket.on("restoringQueue",function(){toast(i18n.t("toasts.restoringQueue"),"loading",!1,"restoring_queue")}),socket.on("cancellingCurrentItem",function(e){toast(i18n.t("toasts.cancellingCurrentItem"),"loading",!1,"cancelling_"+e)}),socket.on("currentItemCancelled",function(e){toast(i18n.t("toasts.currentItemCancelled"),"done",!0,"cancelling_"+e)}),socket.on("startAddingArtist",function(e){toast(i18n.t("toasts.startAddingArtist",{artist:e.name}),"loading",!1,"artist_"+e.id)}),socket.on("finishAddingArtist",function(e){toast(i18n.t("toasts.finishAddingArtist",{artist:e.name}),"done",!0,"artist_"+e.id)}),socket.on("startConvertingSpotifyPlaylist",function(e){toast(i18n.t("toasts.startConvertingSpotifyPlaylist"),"loading",!1,"spotifyplaylist_"+e)}),socket.on("finishConvertingSpotifyPlaylist",function(e){toast(i18n.t("toasts.finishConvertingSpotifyPlaylist"),"done",!0,"spotifyplaylist_"+e)}),socket.on("errorMessage",function(e){toast(e,"error")}),socket.on("queueError",function(e){e.errid?toast(e.link+" - "+i18n.t(`errors.ids.${e.errid}`),"error"):toast(e.link+" - "+e.error,"error")}),socket.on("alreadyInQueue",function(e){toast(i18n.t("toasts.alreadyInQueue",{item:e.title}),"playlist_add_check")}),socket.on("loginNeededToDownload",function(e){toast(i18n.t("toasts.loginNeededToDownload"),"report")}),socket.on("startGeneratingItems",function(e){toast(i18n.t("toasts.startGeneratingItems",{n:e.total}),"loading",!1,"batch_"+e.uuid)}),socket.on("finishGeneratingItems",function(e){toast(i18n.t("toasts.finishGeneratingItems",{n:e.total}),"done",!0,"batch_"+e.uuid)}); diff --git a/src/app.js b/src/app.js index 2e99316..47a3b40 100644 --- a/src/app.js +++ b/src/app.js @@ -38,7 +38,7 @@ async function startApp() { store.dispatch('setAppInfo', connectResponse.update) if (connectResponse.autologin) { - console.info('Autologin successful') + console.info('Autologin') let arl = localStorage.getItem('arl') const accountNum = localStorage.getItem('accountNum') @@ -111,7 +111,6 @@ socket.on('message', function (msg) { }) function loggedIn(data) { - console.log({ data }) const { status, user } = data switch (status) { diff --git a/src/components/pages/Favorites.vue b/src/components/pages/Favorites.vue index fcb5d8d..bb9333e 100644 --- a/src/components/pages/Favorites.vue +++ b/src/components/pages/Favorites.vue @@ -3,13 +3,13 @@

{{ $t('favorites.title') }}
- sync + sync

@@ -19,7 +19,7 @@ - @@ -27,10 +27,10 @@

{{ $t('favorites.noPlaylists') }}

-
-
- - +
+
+ +

{{ release.title }}

@@ -44,9 +44,9 @@

-
- - +
+ +

{{ release.title }}

@@ -66,15 +66,15 @@

{{ $t('favorites.noAlbums') }}

-
+
- +

{{ release.title }}

{{ `${$t('globals.by', { artist: release.artist.name })}` }}

@@ -85,15 +85,15 @@

{{ $t('favorites.noArtists') }}

-
+
- +

{{ release.name }}

@@ -105,17 +105,17 @@
- {{ track.artist.name }} {{ track.album.title }} @@ -142,16 +142,16 @@ {{ convertDuration(track.duration) }}
+ {{ track.position }} - + @@ -125,16 +125,16 @@ }}
get_app @@ -164,14 +164,14 @@