Fixed charts tab, added correct auto relogin

This commit is contained in:
RemixDev 2021-05-06 11:51:33 +02:00
parent 0b1c5a8718
commit 6baf7d989b
3 changed files with 15 additions and 14 deletions

View File

@ -3026,10 +3026,10 @@ a {
`+e._s(e.$tc("globals.listTabs."+i.releaseType))+` `+e._s(e.$tc("globals.listTabs."+i.releaseType))+`
`)])])]),e._v(" "),n("td",{staticClass:"w-32 text-center xl:w-40"},[e._v(e._s(i.releaseDate))]),e._v(" "),n("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(i.releaseTracksNumber))]),e._v(" "),n("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":i.releaseLink},on:{click:function(r){return r.stopPropagation(),e.sendAddToQueue(i.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__$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,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var Artist=__vue_normalize__$i({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},__vue_inject_styles__$i,__vue_script__$i,__vue_scope_id__$i,__vue_is_functional_template__$i);function getChartsData(){return fetchData("getCharts")}function getChartTracks(e){return fetchData("getChartTracks",{id:e})}var script$h={methods:{previewMouseEnter,previewMouseLeave}};const __vue_script__$h=script$h;var __vue_render__$h=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(i.releaseDate))]),e._v(" "),n("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(i.releaseTracksNumber))]),e._v(" "),n("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":i.releaseLink},on:{click:function(r){return r.stopPropagation(),e.sendAddToQueue(i.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__$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,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var Artist=__vue_normalize__$i({render:__vue_render__$i,staticRenderFns:__vue_staticRenderFns__$i},__vue_inject_styles__$i,__vue_script__$i,__vue_scope_id__$i,__vue_is_functional_template__$i);function getChartsData(){return fetchData("getCharts")}function getChartTracks(e){return fetchData("getChartTracks",{id:e})}var script$h={methods:{previewMouseEnter,previewMouseLeave}};const __vue_script__$h=script$h;var __vue_render__$h=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 play_arrow
`)])},__vue_staticRenderFns__$h=[];const __vue_inject_styles__$h=void 0,__vue_scope_id__$h=void 0,__vue_is_functional_template__$h=!1;function __vue_normalize__$h(e,a,n,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var PreviewControls=__vue_normalize__$h({render:__vue_render__$h,staticRenderFns:__vue_staticRenderFns__$h},__vue_inject_styles__$h,__vue_script__$h,__vue_scope_id__$h,__vue_is_functional_template__$h),script$g={components:{PreviewControls},data(){return{country:"",id:0,countries:[],chart:[]}},computed:{worldwideRelease(){return this.countries.filter(a=>a.title==="Worldwide")[0]}},async created(){let{data: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,id:n}}}=e;this.country=a,localStorage.setItem("chart",this.country),this.id=n},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<this.countries.length&&this.countries[a].title!=this.country;a++);a!==this.countries.length?(this.id=this.countries[a].id,socket.emit("getChartTracks",this.id)):(this.country="",localStorage.setItem("chart",this.country))}},watch:{id(e){e!==0&&getChartTracks(e).then(n=>this.setTracklist(n.result))}}};const __vue_script__$g=script$g;var __vue_render__$g=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("charts.title")))]),e._v(" "),e.country===""?n("div",[n("div",{staticClass:"release-grid"},e._l(e.countries,function(i){return n("div",{key:i.id,staticClass:"w-40 h-40 release clickable",attrs:{"aria-label":i.title,"data-id":i.id,"data-title":i.title,role:"button"},on:{click:e.getTrackList}},[n("img",{staticClass:"w-full rounded coverart",attrs:{src:i.picture_medium}})])}),0)]):n("div",[n("button",{staticClass:"btn btn-primary",on:{click:e.onChangeCountry}},[e._v(e._s(e.$t("charts.changeCountry")))]),e._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{"data-link":"https://www.deezer.com/playlist/"+e.id},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(` `)])},__vue_staticRenderFns__$h=[];const __vue_inject_styles__$h=void 0,__vue_scope_id__$h=void 0,__vue_is_functional_template__$h=!1;function __vue_normalize__$h(e,a,n,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var PreviewControls=__vue_normalize__$h({render:__vue_render__$h,staticRenderFns:__vue_staticRenderFns__$h},__vue_inject_styles__$h,__vue_script__$h,__vue_scope_id__$h,__vue_is_functional_template__$h),script$g={components:{PreviewControls},data(){return{country:"",id:0,countries:[],chart:[]}},computed:{worldwideRelease(){return this.countries.filter(a=>a.title==="Worldwide")[0]}},async created(){let{data: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,id:n}}}=e;this.country=a,localStorage.setItem("chart",this.country),this.id=n},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<this.countries.length&&this.countries[a].title!=this.country;a++);a!==this.countries.length?(this.id=this.countries[a].id,getChartTracks(this.id).then(n=>this.setTracklist(n.data))):(this.country="",localStorage.setItem("chart",this.country))}},watch:{id(e){e!==0&&getChartTracks(e).then(n=>this.setTracklist(n.data))}}};const __vue_script__$g=script$g;var __vue_render__$g=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("charts.title"))+" "+e._s(e.country?"- "+e.country:""))]),e._v(" "),e.country===""?n("div",[n("div",{staticClass:"release-grid"},e._l(e.countries,function(i){return n("div",{key:i.id,staticClass:"w-40 h-40 release clickable",attrs:{"aria-label":i.title,"data-id":i.id,"data-title":i.title,role:"button"},on:{click:e.getTrackList}},[n("img",{staticClass:"w-full rounded coverart",attrs:{src:i.picture_medium,alt:i.title}})])}),0)]):n("div",[n("button",{staticClass:"btn btn-primary",on:{click:e.onChangeCountry}},[e._v(e._s(e.$t("charts.changeCountry")))]),e._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{"data-link":"https://www.deezer.com/playlist/"+e.id},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(`
`+e._s(e.$t("charts.download"))+` `+e._s(e.$t("charts.download"))+`
`)]),e._v(" "),n("table",{staticClass:"table table--charts"},[n("tbody",e._l(e.chart,function(i){return n("tr",{staticClass:"track_row"},[n("td",{staticClass:"p-3 text-center cursor-default",class:{first:i.position===1}},[e._v(` `)]),e._v(" "),n("table",{staticClass:"table table--charts"},[n("tbody",e._l(e.chart,function(i,r){return n("tr",{staticClass:"track_row"},[n("td",{staticClass:"p-3 text-center cursor-default",class:{first:r===0}},[e._v(`
`+e._s(i.position)+` `+e._s(r+1)+`
`)]),e._v(" "),n("td",{staticClass:"table__icon table__icon--big"},[n("span",{staticClass:"relative inline-block rounded cursor-pointer",attrs:{"data-preview":i.preview},on:{click:e.playPausePreview}},[i.preview?n("PreviewControls"):e._e(),e._v(" "),n("img",{staticClass:"rounded coverart",attrs:{src:i.album.cover_small}})],1)]),e._v(" "),n("td",{staticClass:"table__cell--large"},[e._v(` `)]),e._v(" "),n("td",{staticClass:"table__icon table__icon--big"},[n("span",{staticClass:"relative inline-block rounded cursor-pointer",attrs:{"data-preview":i.preview},on:{click:e.playPausePreview}},[i.preview?n("PreviewControls"):e._e(),e._v(" "),n("img",{staticClass:"rounded coverart",attrs:{src:i.album.cover_small}})],1)]),e._v(" "),n("td",{staticClass:"table__cell--large"},[e._v(`
`+e._s(i.title+(i.title_version&&i.title.indexOf(i.title_version)==-1?" "+i.title_version:""))+` `+e._s(i.title+(i.title_version&&i.title.indexOf(i.title_version)==-1?" "+i.title_version:""))+`
`)]),e._v(" "),n("router-link",{staticClass:"table__cell table__cell--medium table__cell--center clickable",attrs:{to:{name:"Artist",params:{id:i.artist.id}},tag:"td"}},[e._v(` `)]),e._v(" "),n("router-link",{staticClass:"table__cell table__cell--medium table__cell--center clickable",attrs:{to:{name:"Artist",params:{id:i.artist.id}},tag:"td"}},[e._v(`
@ -3038,7 +3038,7 @@ a {
`+e._s(i.album.title)+` `+e._s(i.album.title)+`
`)]),e._v(" "),n("td",{staticClass:"table__cell--small table__cell--center"},[e._v(` `)]),e._v(" "),n("td",{staticClass:"table__cell--small table__cell--center"},[e._v(`
`+e._s(e.convertDuration(i.duration))+` `+e._s(e.convertDuration(i.duration))+`
`)]),e._v(" "),n("td",{staticClass:"cursor-pointer group",attrs:{"data-link":i.link,"aria-label":"download",role:"button"},on:{click:function(r){return r.stopPropagation(),e.addToQueue(r)}}},[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":i.link,"aria-label":"download",role:"button"},on:{click:function(s){return s.stopPropagation(),e.addToQueue(s)}}},[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 get_app
`)])])],1)}),0)])])])},__vue_staticRenderFns__$g=[];const __vue_inject_styles__$g=void 0,__vue_scope_id__$g=void 0,__vue_is_functional_template__$g=!1;function __vue_normalize__$g(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Charts.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i,o}var Charts=__vue_normalize__$g({render:__vue_render__$g,staticRenderFns:__vue_staticRenderFns__$g},__vue_inject_styles__$g,__vue_script__$g,__vue_scope_id__$g,__vue_is_functional_template__$g),script$f={computed:{...mapGetters(["getErrors"]),title(){return`${this.getErrors.artist} - ${this.getErrors.title}`},errors(){return this.getErrors.errors}}};const __vue_script__$f=script$f;var __vue_render__$f=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("errors.title",{name:e.title})))]),e._v(" "),n("table",{staticClass:"table table--tracklist"},[n("tr",[n("th",[e._v("ID")]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.artist",1)))]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.title",1)))]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.error",1)))])]),e._v(" "),e._l(e.errors,function(i){return n("tr",{key:i.data.id},[n("td",[e._v(e._s(i.data.id))]),e._v(" "),n("td",[e._v(e._s(i.data.artist))]),e._v(" "),n("td",[e._v(e._s(i.data.title))]),e._v(" "),n("td",[e._v(e._s(i.errid?e.$t("errors.ids."+i.errid):i.message))])])})],2)])},__vue_staticRenderFns__$f=[];const __vue_inject_styles__$f=void 0,__vue_scope_id__$f=void 0,__vue_is_functional_template__$f=!1;function __vue_normalize__$f(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Errors.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i,o}var Errors=__vue_normalize__$f({render:__vue_render__$f,staticRenderFns:__vue_staticRenderFns__$f},__vue_inject_styles__$f,__vue_script__$f,__vue_scope_id__$f,__vue_is_functional_template__$f),script$e={inheritAttrs:!1,props:{cover:{type:String,reqired:!0},isRounded:{type:Boolean,required:!1},isCircle:{type:Boolean,required:!1},link:{type:String,reqired:!0}}};const __vue_script__$e=script$e;var __vue_render__$e=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{staticClass:"relative cover-container group"},[n("img",{staticClass:"block w-full opacity-100 coverart",class:{rounded:e.isRounded,"rounded-full":e.isCircle},attrs:{"aria-hidden":"true",src:e.cover}}),e._v(" "),n("button",e._g({staticClass:"absolute p-0 text-center bg-black border-0 rounded-full opacity-0 download_overlay hover:bg-primary",attrs:{role:"button","aria-label":"download","data-link":e.link,tabindex:"0"}},e.$listeners),[n("i",{staticClass:"text-white cursor-pointer material-icons",attrs:{title:e.$t("globals.download_hint")}},[e._v("get_app")])])])},__vue_staticRenderFns__$e=[];const __vue_inject_styles__$e=function(e){!e||e("data-v-5a73b889_0",{source:".cover-container[data-v-5a73b889]{width:156px;height:156px;margin-bottom:10px}.cover-container .coverart[data-v-5a73b889]{backface-visibility:hidden;transition:.5s ease;height:auto}.cover-container .download_overlay[data-v-5a73b889]{top:50%;left:50%;transform:translate(-50%,-50%);transition:.5s ease;opacity:0;min-width:2rem;height:2.75rem;text-align:center}.cover-container .download_overlay i[data-v-5a73b889]{padding:.625rem}.cover-container .download_overlay[data-v-5a73b889]:focus{opacity:1}.cover-container:hover .coverart[data-v-5a73b889]{opacity:.75}.cover-container:hover .download_overlay[data-v-5a73b889]{opacity:1;border:0}",map:void 0,media:void 0})},__vue_scope_id__$e="data-v-5a73b889",__vue_module_identifier__$2=void 0,__vue_is_functional_template__$e=!1;function __vue_normalize__$e(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};o.__file="CoverContainer.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__$2(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__$2.styles||(__vue_create_injector__$2.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+=` `)])])],1)}),0)])])])},__vue_staticRenderFns__$g=[];const __vue_inject_styles__$g=void 0,__vue_scope_id__$g=void 0,__vue_is_functional_template__$g=!1;function __vue_normalize__$g(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Charts.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i,o}var Charts=__vue_normalize__$g({render:__vue_render__$g,staticRenderFns:__vue_staticRenderFns__$g},__vue_inject_styles__$g,__vue_script__$g,__vue_scope_id__$g,__vue_is_functional_template__$g),script$f={computed:{...mapGetters(["getErrors"]),title(){return`${this.getErrors.artist} - ${this.getErrors.title}`},errors(){return this.getErrors.errors}}};const __vue_script__$f=script$f;var __vue_render__$f=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("errors.title",{name:e.title})))]),e._v(" "),n("table",{staticClass:"table table--tracklist"},[n("tr",[n("th",[e._v("ID")]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.artist",1)))]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.title",1)))]),e._v(" "),n("th",[e._v(e._s(e.$tc("globals.listTabs.error",1)))])]),e._v(" "),e._l(e.errors,function(i){return n("tr",{key:i.data.id},[n("td",[e._v(e._s(i.data.id))]),e._v(" "),n("td",[e._v(e._s(i.data.artist))]),e._v(" "),n("td",[e._v(e._s(i.data.title))]),e._v(" "),n("td",[e._v(e._s(i.errid?e.$t("errors.ids."+i.errid):i.message))])])})],2)])},__vue_staticRenderFns__$f=[];const __vue_inject_styles__$f=void 0,__vue_scope_id__$f=void 0,__vue_is_functional_template__$f=!1;function __vue_normalize__$f(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};return o.__file="Errors.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,r&&(o.functional=!0)),o._scopeId=i,o}var Errors=__vue_normalize__$f({render:__vue_render__$f,staticRenderFns:__vue_staticRenderFns__$f},__vue_inject_styles__$f,__vue_script__$f,__vue_scope_id__$f,__vue_is_functional_template__$f),script$e={inheritAttrs:!1,props:{cover:{type:String,reqired:!0},isRounded:{type:Boolean,required:!1},isCircle:{type:Boolean,required:!1},link:{type:String,reqired:!0}}};const __vue_script__$e=script$e;var __vue_render__$e=function(){var e=this,a=e.$createElement,n=e._self._c||a;return n("div",{staticClass:"relative cover-container group"},[n("img",{staticClass:"block w-full opacity-100 coverart",class:{rounded:e.isRounded,"rounded-full":e.isCircle},attrs:{"aria-hidden":"true",src:e.cover}}),e._v(" "),n("button",e._g({staticClass:"absolute p-0 text-center bg-black border-0 rounded-full opacity-0 download_overlay hover:bg-primary",attrs:{role:"button","aria-label":"download","data-link":e.link,tabindex:"0"}},e.$listeners),[n("i",{staticClass:"text-white cursor-pointer material-icons",attrs:{title:e.$t("globals.download_hint")}},[e._v("get_app")])])])},__vue_staticRenderFns__$e=[];const __vue_inject_styles__$e=function(e){!e||e("data-v-5a73b889_0",{source:".cover-container[data-v-5a73b889]{width:156px;height:156px;margin-bottom:10px}.cover-container .coverart[data-v-5a73b889]{backface-visibility:hidden;transition:.5s ease;height:auto}.cover-container .download_overlay[data-v-5a73b889]{top:50%;left:50%;transform:translate(-50%,-50%);transition:.5s ease;opacity:0;min-width:2rem;height:2.75rem;text-align:center}.cover-container .download_overlay i[data-v-5a73b889]{padding:.625rem}.cover-container .download_overlay[data-v-5a73b889]:focus{opacity:1}.cover-container:hover .coverart[data-v-5a73b889]{opacity:.75}.cover-container:hover .download_overlay[data-v-5a73b889]{opacity:1;border:0}",map:void 0,media:void 0})},__vue_scope_id__$e="data-v-5a73b889",__vue_module_identifier__$2=void 0,__vue_is_functional_template__$e=!1;function __vue_normalize__$e(e,a,n,i,r,s,l,c){const o=(typeof n=="function"?n.options:n)||{};o.__file="CoverContainer.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__$2(){const e=document.head||document.getElementsByTagName("head")[0],a=__vue_create_injector__$2.styles||(__vue_create_injector__$2.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+=` /*# sourceURL=`+s.map.sources[0]+" */",o+=`
@ -4902,5 +4902,5 @@ a {
`)]),e._v(" "),n("td",[e._v(e._s(i.artists[0].name))]),e._v(" "),n("td",[e._v(e._s(i.album.name))]),e._v(" "),n("td",[e._v(e._s(e.convertDuration(Math.floor(i.duration_ms/1e3))))]),e._v(" "),n("td",[n("input",{directives:[{name:"model",rawName:"v-model",value:i.selected,expression:"track.selected"}],staticClass:"clickable",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(i.selected)?e._i(i.selected,null)>-1:i.selected},on:{change:function(s){var l=i.selected,c=s.target,o=!!c.checked;if(Array.isArray(l)){var u=null,d=e._i(l,u);c.checked?d<0&&e.$set(i,"selected",l.concat([u])):d>-1&&e.$set(i,"selected",l.slice(0,d).concat(l.slice(d+1)))}else e.$set(i,"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(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(` `)]),e._v(" "),n("td",[e._v(e._s(i.artists[0].name))]),e._v(" "),n("td",[e._v(e._s(i.album.name))]),e._v(" "),n("td",[e._v(e._s(e.convertDuration(Math.floor(i.duration_ms/1e3))))]),e._v(" "),n("td",[n("input",{directives:[{name:"model",rawName:"v-model",value:i.selected,expression:"track.selected"}],staticClass:"clickable",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(i.selected)?e._i(i.selected,null)>-1:i.selected},on:{change:function(s){var l=i.selected,c=s.target,o=!!c.checked;if(Array.isArray(l)){var u=null,d=e._i(l,u);c.checked?d<0&&e.$set(i,"selected",l.concat([u])):d>-1&&e.$set(i,"selected",l.slice(0,d).concat(l.slice(d+1)))}else e.$set(i,"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(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(`
`+e._s(""+e.$t("globals.download",{thing:e.$tc("globals.listTabs."+e.type,1)}))+` `+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(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(` `)]),e._v(" "),n("button",{staticClass:"flex items-center btn btn-primary",attrs:{"data-link":e.selectedLinks()},on:{click:function(i){return i.stopPropagation(),e.addToQueue(i)}}},[e._v(`
`+e._s(e.$t("tracklist.downloadSelection"))),n("i",{staticClass:"ml-2 material-icons"},[e._v("file_download")])])])])},__vue_staticRenderFns__=[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__=void 0,__vue_scope_id__=void 0,__vue_is_functional_template__=!1;function __vue_normalize__(e,a,n,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var Tracklist=__vue_normalize__({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__);Vue$2.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:"/about",name:"About",component:About},{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)=>{switch(e.name){case"Tracklist":{console.warn("This should never happen.");break}case"Album":{const i={type:"album",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showAlbum",r)});break}case"Playlist":{const i={type:"playlist",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showPlaylist",r)});break}case"Spotify Playlist":{const i={type:"spotifyplaylist",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showSpotifyPlaylist",r)});break}}n()});async function startApp(){new Vue$2({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 i;n!==0?i=await fetchData("login-arl",{arl:a,force:!0,child:n||0},"POST"):i=await fetchData("login-arl",{arl:a},"POST"),loggedIn(i)}}}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(` `+e._s(e.$t("tracklist.downloadSelection"))),n("i",{staticClass:"ml-2 material-icons"},[e._v("file_download")])])])])},__vue_staticRenderFns__=[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__=void 0,__vue_scope_id__=void 0,__vue_is_functional_template__=!1;function __vue_normalize__(e,a,n,i,r,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,r&&(o.functional=!0)),o._scopeId=i,o}var Tracklist=__vue_normalize__({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__);Vue$2.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:"/about",name:"About",component:About},{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)=>{switch(e.name){case"Tracklist":{console.warn("This should never happen.");break}case"Album":{const i={type:"album",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showAlbum",r)});break}case"Playlist":{const i={type:"playlist",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showPlaylist",r)});break}case"Spotify Playlist":{const i={type:"spotifyplaylist",id:e.params.id};fetchData("getTracklist",i).then(r=>{EventBus.$emit("showSpotifyPlaylist",r)});break}}n()});async function startApp(){new Vue$2({store,router,i18n,render:n=>n(App)}).$mount("#app");const e=await(await fetch("connect")).json();store.dispatch("setAppInfo",e.update);let a=localStorage.getItem("arl");if(e.autologin){console.info("Autologin");const n=localStorage.getItem("accountNum");if(a){a=a.trim();let i;n!==0?i=await fetchData("login-arl",{arl:a,force:!0,child:n||0},"POST"):i=await fetchData("login-arl",{arl:a},"POST"),loggedIn(i)}}else loggedIn({status:3,user:e.currentUser,arl:a})}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)}); `)!=-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)});

View File

@ -38,10 +38,10 @@ async function startApp() {
const connectResponse = await (await fetch('connect')).json() const connectResponse = await (await fetch('connect')).json()
store.dispatch('setAppInfo', connectResponse.update) store.dispatch('setAppInfo', connectResponse.update)
let arl = localStorage.getItem('arl')
if (connectResponse.autologin) { if (connectResponse.autologin) {
console.info('Autologin') console.info('Autologin')
let arl = localStorage.getItem('arl')
const accountNum = localStorage.getItem('accountNum') const accountNum = localStorage.getItem('accountNum')
if (arl) { if (arl) {
@ -56,6 +56,8 @@ async function startApp() {
loggedIn(result) loggedIn(result)
} }
} else {
loggedIn({ status: 3, user: connectResponse.currentUser, arl })
} }
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<h1 class="mb-8 text-5xl">{{ $t('charts.title') }}</h1> <h1 class="mb-8 text-5xl">{{ $t('charts.title') }} {{ country ? (`- ${country}`) : '' }}</h1>
<div v-if="country === ''"> <div v-if="country === ''">
<div class="release-grid"> <div class="release-grid">
@ -14,7 +14,7 @@
role="button" role="button"
@click="getTrackList" @click="getTrackList"
> >
<img :src="release.picture_medium" class="w-full rounded coverart" /> <img :src="release.picture_medium" class="w-full rounded coverart" :alt="release.title"/>
</div> </div>
</div> </div>
</div> </div>
@ -26,9 +26,9 @@
</button> </button>
<table class="table table--charts"> <table class="table table--charts">
<tbody> <tbody>
<tr v-for="track in chart" class="track_row"> <tr v-for="track, pos in chart" class="track_row">
<td :class="{ first: track.position === 1 }" class="p-3 text-center cursor-default"> <td :class="{ first: pos === 0 }" class="p-3 text-center cursor-default">
{{ track.position }} {{ pos+1 }}
</td> </td>
<td class="table__icon table__icon--big"> <td class="table__icon table__icon--big">
<span <span
@ -85,7 +85,6 @@
</template> </template>
<script> <script>
import { socket } from '@/utils/socket'
import { sendAddToQueue } from '@/utils/downloads' import { sendAddToQueue } from '@/utils/downloads'
import { convertDuration } from '@/utils/utils' import { convertDuration } from '@/utils/utils'
import { getChartsData, getChartTracks } from '@/data/charts' import { getChartsData, getChartTracks } from '@/data/charts'
@ -175,7 +174,7 @@ export default {
if (i !== this.countries.length) { if (i !== this.countries.length) {
this.id = this.countries[i].id this.id = this.countries[i].id
socket.emit('getChartTracks', this.id) getChartTracks(this.id).then(response => this.setTracklist(response.data))
} else { } else {
this.country = '' this.country = ''
localStorage.setItem('chart', this.country) localStorage.setItem('chart', this.country)
@ -187,7 +186,7 @@ export default {
const isActualChart = newId !== 0 const isActualChart = newId !== 0
if (isActualChart) { if (isActualChart) {
getChartTracks(newId).then(response => this.setTracklist(response.result)) getChartTracks(newId).then(response => this.setTracklist(response.data))
} }
} }
} }