From d20540f46ed0a8785a526a56bc79217f5d1ffdcd Mon Sep 17 00:00:00 2001 From: Roberto Tonino Date: Fri, 20 Nov 2020 17:31:12 +0100 Subject: [PATCH] feat: label to distinguish release type in All tab in Artist page; build: v1.3.6 --- public/js/bundle.js | 12 ++++++++---- src/components/pages/Artist.vue | 22 ++++++++++++---------- src/data/artist.js | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/public/js/bundle.js b/public/js/bundle.js index 24e4565..7579c68 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -2740,13 +2740,17 @@ PERFORMANCE OF THIS SOFTWARE. `)]),e._v(" "),a("p",{staticClass:"mb-2 text-base"},[e._v("For security reasons you will need to provide your own Client ID and Secret")]),e._v(" "),a("h2",{staticClass:"mt-6 text-3xl"},[e._v("How do I get my Client ID and Secret?")]),e._v(" "),e._m(0),e._v(" "),e._m(1),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),a("p",{staticClass:"mb-2 text-base"},[e._v("Now you can copy-paste those results in the appropriate fields in the settings.")]),e._v(" "),a("h2",{staticClass:"mt-6 text-3xl"},[e._v("How do I get my Spotify Username?")]),e._v(" "),e._m(4)])},__vue_staticRenderFns__$d=[function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v("Connect to "),a("a",{attrs:{href:"https://developer.spotify.com/dashboard",target:"_blank"}},[e._v("Spotify for Developers's Dashboard")]),e._v(" and login with your Spotify account.")])},function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v(` Click on "Create an App".`),a("br"),e._v(" "),a("img",{attrs:{src:"https://i.imgur.com/YFz7rHj.png",alt:"Create an App button on Spotify for Developers's Dashboard"}})])},function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v(` Fill out the "App name" and "App description" fields and check both checkboxes. Then click on the "Create" button.`),a("br"),e._v(" "),a("img",{attrs:{src:"https://i.imgur.com/A9cvDkK.png",alt:"Create an app form"}})])},function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v(` - Now you can see the Client ID. If you click on "Show Client Secret" the client secret will be revealed.`),a("br"),e._v(" "),a("img",{attrs:{src:"https://i.imgur.com/foEfIhO.png",alt:"Screen of client ID and Secret"}})])},function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v("You can get your Spotify Username from the "),a("a",{attrs:{href:"https://www.spotify.com/it/account/overview/",target:"_blank"}},[e._v("Overview page on Spotify's Website")]),e._v(".")])}];const __vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_is_functional_template__$d=!1;function __vue_normalize__$d(e,n,a,r,i,s,l,c){const o=(typeof a=="function"?a.options:a)||{};return o.__file="InfoSpotifyFeatures.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var InfoSpotifyFeatures=__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),freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto=Object.prototype,hasOwnProperty$2=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(e){var n=hasOwnProperty$2.call(e,symToStringTag),a=e[symToStringTag];try{e[symToStringTag]=void 0;var r=!0}catch(s){}var i=nativeObjectToString.call(e);return r&&(n?e[symToStringTag]=a:delete e[symToStringTag]),i}var objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return e!=null&&typeof e=="object"}var symbolTag="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==symbolTag}function arrayMap(e,n){for(var a=-1,r=e==null?0:e.length,i=Array(r);++a-1&&e%1==0)&&e-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction$2(e)}var objectProto$3=Object.prototype;function isPrototype(e){var n=e&&e.constructor,a=typeof n=="function"&&n.prototype||objectProto$3;return e===a}function baseTimes(e,n){for(var a=-1,r=Array(e);++a-1}function listCacheSet(e,n){var a=this.__data__,r=assocIndexOf(a,e);return r<0?(++this.size,a.push([e,n])):a[r][1]=n,this}function ListCache(e){var n=-1,a=e==null?0:e.length;for(this.clear();++nc))return!1;var u=s.get(e);if(u&&s.get(n))return u==n;var d=-1,f=!0,m=a&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(s.set(e,n),s.set(n,e);++d=n||C<0||f&&I>=s}function k(){var z=now();if(w(z))return x(z);c=setTimeout(k,y(z))}function x(z){return c=void 0,m&&r?h(z):(r=i=void 0,l)}function A(){c!==void 0&&clearTimeout(c),u=0,r=o=i=c=void 0}function R(){return c===void 0?l:x(now())}function D(){var z=now(),C=w(z);if(r=arguments,i=this,o=z,C){if(c===void 0)return b(o);if(f)return clearTimeout(c),c=setTimeout(k,n),h(o)}return c===void 0&&(c=setTimeout(k,n)),l}return D.cancel=A,D.flush=R,D}function baseMap(e,n){var a=-1,r=isArrayLike(e)?Array(e.length):[];return baseEach(e,function(i,s,l){r[++a]=n(i,s,l)}),r}var mapTag$3="[object Map]",setTag$3="[object Set]",objectProto$c=Object.prototype,hasOwnProperty$b=objectProto$c.hasOwnProperty;function isEmpty(e){if(e==null)return!0;if(isArrayLike(e)&&(isArray$2(e)||typeof e=="string"||typeof e.splice=="function"||isBuffer(e)||isTypedArray(e)||isArguments(e)))return!e.length;var n=getTag$1(e);if(n==mapTag$3||n==setTag$3)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var a in e)if(hasOwnProperty$b.call(e,a))return!1;return!0}function baseSortBy(e,n){var a=e.length;for(e.sort(n);a--;)e[a]=e[a].value;return e}function compareAscending(e,n){if(e!==n){var a=e!==void 0,r=e===null,i=e===e,s=isSymbol(e),l=n!==void 0,c=n===null,o=n===n,u=isSymbol(n);if(!c&&!u&&!s&&e>n||s&&l&&o&&!c&&!u||r&&l&&o||!a&&o||!i)return 1;if(!r&&!s&&!u&&e=c)return o;var u=a[r];return o*(u=="desc"?-1:1)}}return e.index-n.index}function baseOrderBy(e,n,a){var r=-1;n=arrayMap(n.length?n:[identity$1],baseUnary(baseIteratee));var i=baseMap(e,function(s,l,c){var o=arrayMap(n,function(u){return u(s)});return{criteria:o,index:++r,value:s}});return baseSortBy(i,function(s,l){return compareMultiple(s,l,a)})}function orderBy(e,n,a,r){return e==null?[]:(isArray$2(n)||(n=n==null?[]:[n]),a=r?void 0:a,isArray$2(a)||(a=a==null?[]:[a]),baseOrderBy(e,n,a))}const BaseTab=defineComponent({name:"BaseTab",functional:!0,render(e,n){return e("li",{class:[n.data.class,"section-tabs__tab","uppercase-first-letter"],on:n.data.on},n.slots().default)}}),BaseTabs=defineComponent({name:"BaseTabs",functional:!0,render(e,n){return e("ul",{class:[n.data.class,"my-8","section-tabs"],on:n.data.on},n.slots().default)}});function checkNewRelease(e){let n=new Date;return n.setHours(0,0,0,0),e=new Date(e),e.setDate(e.getDate()+3),n.getTime()<=e.getTime()}function formatArtistData(e){return{artistName:getPropertyWithFallback(e,"name"),artistPictureXL:getPropertyWithFallback(e,"picture_xl"),artistReleases:formatArtistReleases(getPropertyWithFallback(e,"releases"))}}function formatArtistReleases(e){let n={};for(const a in e)if(e.hasOwnProperty(a)){const r=e[a];n[a]=[];for(const i of r)n[a].push({releaseID:getPropertyWithFallback(i,"id"),releaseCover:getPropertyWithFallback(i,"cover_small"),releaseTitle:getPropertyWithFallback(i,"title"),releaseDate:getPropertyWithFallback(i,"release_date"),releaseTracksNumber:getPropertyWithFallback(i,"nb_tracks"),releaseLink:getPropertyWithFallback(i,"link"),releaseType:getPropertyWithFallback(i,"type"),isReleaseExplicit:getPropertyWithFallback(i,"explicit_lyrics")})}return n}function getArtistData(e){return socket.emit("getTracklist",{type:"artist",id:e}),new Promise((n,a)=>{socket.on("show_artist",r=>{socket.off("show_artist"),n(r)})})}function standardizeData(e,n){if(e.hasLoaded){const{data:a}=e,r=[];for(const i of a){let s=n(i);r.push(s)}return{data:r,hasLoaded:e.hasLoaded}}else return null}var script$c=defineComponent({components:{BaseTabs,BaseTab},setup(e,n){const a=reactive({currentTab:"",sortKey:"releaseDate",sortOrder:"desc",artistReleases:{},artistName:"",artistPicture:"",currentRelease:computed(()=>a.artistReleases[a.currentTab])}),r=computed(()=>n.root.$router.currentRoute.params.id),i=ref$2(!1);getArtistData(unref(r)).then(l=>{i.value=!0;const c={data:[l],hasLoaded:unref(i)},{data:[{artistName:o,artistPictureXL:u,artistReleases:d}]}=standardizeData(c,formatArtistData);Object.assign(a,{artistName:o,artistPicture:u,artistReleases:d,currentTab:Object.keys(d)[0]})}).catch(l=>console.error(l));const s=computed(()=>{if(!unref(i))return[];let l=a.sortKey;return l==="releaseTracksNumber"&&(l=c=>new Number(c.releaseTracksNumber)),orderBy(a.currentRelease,l,a.sortOrder)});return{...toRefs(a),downloadLink:computed(()=>`https://www.deezer.com/artist/${unref(r)}`),headerStyle:computed(()=>({backgroundImage:`linear-gradient(to bottom, transparent 0%, var(--main-background) 100%), url(${a.artistPicture})`})),sortedData:s,sendAddToQueue,checkNewRelease}},data(){const e=this.$t.bind(this),n=this.$tc.bind(this);return{head:[{title:n("globals.listTabs.title",1),sortKey:"releaseTitle"},{title:e("globals.listTabs.releaseDate"),sortKey:"releaseDate"},{title:n("globals.listTabs.track",2),sortKey:"releaseTracksNumber"},{title:"",width:null}]}},methods:{sortBy(e){e===this.sortKey?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortKey=e,this.sortOrder="asc")}}});const __vue_script__$c=script$c;var __vue_render__$e=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"relative image-header"},[a("header",{staticClass:"flex items-center",style:e.headerStyle},[a("h1",{staticClass:"m-0"},[e._v(e._s(e.artistName))]),e._v(" "),a("div",{staticClass:"grid w-16 h-16 ml-auto rounded-full cursor-pointer bg-primary text-grayscale-870 place-items-center",attrs:{"aria-label":"download",role:"button"},on:{click:function(r){return r.stopPropagation(),e.sendAddToQueue(e.downloadLink)}}},[a("i",{staticClass:"text-4xl material-icons",attrs:{title:e.$t("globals.download_hint")}},[e._v("get_app")])])]),e._v(" "),a("BaseTabs",e._l(e.artistReleases,function(r,i){return a("BaseTab",{key:i,class:{active:e.currentTab===i},on:{click:function(s){e.currentTab=i}}},[e._v(` + Now you can see the Client ID. If you click on "Show Client Secret" the client secret will be revealed.`),a("br"),e._v(" "),a("img",{attrs:{src:"https://i.imgur.com/foEfIhO.png",alt:"Screen of client ID and Secret"}})])},function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("p",{staticClass:"mb-2 text-base"},[e._v("You can get your Spotify Username from the "),a("a",{attrs:{href:"https://www.spotify.com/it/account/overview/",target:"_blank"}},[e._v("Overview page on Spotify's Website")]),e._v(".")])}];const __vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_is_functional_template__$d=!1;function __vue_normalize__$d(e,n,a,r,i,s,l,c){const o=(typeof a=="function"?a.options:a)||{};return o.__file="InfoSpotifyFeatures.vue",o.render||(o.render=e.render,o.staticRenderFns=e.staticRenderFns,o._compiled=!0,i&&(o.functional=!0)),o._scopeId=r,o}var InfoSpotifyFeatures=__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),freeGlobal=typeof global=="object"&&global&&global.Object===Object&&global,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto=Object.prototype,hasOwnProperty$2=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(e){var n=hasOwnProperty$2.call(e,symToStringTag),a=e[symToStringTag];try{e[symToStringTag]=void 0;var r=!0}catch(s){}var i=nativeObjectToString.call(e);return r&&(n?e[symToStringTag]=a:delete e[symToStringTag]),i}var objectProto$1=Object.prototype,nativeObjectToString$1=objectProto$1.toString;function objectToString(e){return nativeObjectToString$1.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(e){return e==null?e===void 0?undefinedTag:nullTag:symToStringTag$1&&symToStringTag$1 in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return e!=null&&typeof e=="object"}var symbolTag="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==symbolTag}function arrayMap(e,n){for(var a=-1,r=e==null?0:e.length,i=Array(r);++a-1&&e%1==0)&&e-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction$2(e)}var objectProto$3=Object.prototype;function isPrototype(e){var n=e&&e.constructor,a=typeof n=="function"&&n.prototype||objectProto$3;return e===a}function baseTimes(e,n){for(var a=-1,r=Array(e);++a-1}function listCacheSet(e,n){var a=this.__data__,r=assocIndexOf(a,e);return r<0?(++this.size,a.push([e,n])):a[r][1]=n,this}function ListCache(e){var n=-1,a=e==null?0:e.length;for(this.clear();++nc))return!1;var u=s.get(e);if(u&&s.get(n))return u==n;var d=-1,f=!0,m=a&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(s.set(e,n),s.set(n,e);++d=n||C<0||f&&I>=s}function k(){var z=now();if(w(z))return x(z);c=setTimeout(k,y(z))}function x(z){return c=void 0,m&&r?h(z):(r=i=void 0,l)}function A(){c!==void 0&&clearTimeout(c),u=0,r=o=i=c=void 0}function R(){return c===void 0?l:x(now())}function D(){var z=now(),C=w(z);if(r=arguments,i=this,o=z,C){if(c===void 0)return b(o);if(f)return clearTimeout(c),c=setTimeout(k,n),h(o)}return c===void 0&&(c=setTimeout(k,n)),l}return D.cancel=A,D.flush=R,D}function baseMap(e,n){var a=-1,r=isArrayLike(e)?Array(e.length):[];return baseEach(e,function(i,s,l){r[++a]=n(i,s,l)}),r}var mapTag$3="[object Map]",setTag$3="[object Set]",objectProto$c=Object.prototype,hasOwnProperty$b=objectProto$c.hasOwnProperty;function isEmpty(e){if(e==null)return!0;if(isArrayLike(e)&&(isArray$2(e)||typeof e=="string"||typeof e.splice=="function"||isBuffer(e)||isTypedArray(e)||isArguments(e)))return!e.length;var n=getTag$1(e);if(n==mapTag$3||n==setTag$3)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var a in e)if(hasOwnProperty$b.call(e,a))return!1;return!0}function baseSortBy(e,n){var a=e.length;for(e.sort(n);a--;)e[a]=e[a].value;return e}function compareAscending(e,n){if(e!==n){var a=e!==void 0,r=e===null,i=e===e,s=isSymbol(e),l=n!==void 0,c=n===null,o=n===n,u=isSymbol(n);if(!c&&!u&&!s&&e>n||s&&l&&o&&!c&&!u||r&&l&&o||!a&&o||!i)return 1;if(!r&&!s&&!u&&e=c)return o;var u=a[r];return o*(u=="desc"?-1:1)}}return e.index-n.index}function baseOrderBy(e,n,a){var r=-1;n=arrayMap(n.length?n:[identity$1],baseUnary(baseIteratee));var i=baseMap(e,function(s,l,c){var o=arrayMap(n,function(u){return u(s)});return{criteria:o,index:++r,value:s}});return baseSortBy(i,function(s,l){return compareMultiple(s,l,a)})}function orderBy(e,n,a,r){return e==null?[]:(isArray$2(n)||(n=n==null?[]:[n]),a=r?void 0:a,isArray$2(a)||(a=a==null?[]:[a]),baseOrderBy(e,n,a))}const BaseTab=defineComponent({name:"BaseTab",functional:!0,render(e,n){return e("li",{class:[n.data.class,"section-tabs__tab","uppercase-first-letter"],on:n.data.on},n.slots().default)}}),BaseTabs=defineComponent({name:"BaseTabs",functional:!0,render(e,n){return e("ul",{class:[n.data.class,"my-8","section-tabs"],on:n.data.on},n.slots().default)}});function checkNewRelease(e){let n=new Date;return n.setHours(0,0,0,0),e=new Date(e),e.setDate(e.getDate()+3),n.getTime()<=e.getTime()}function formatArtistData(e){return{artistName:getPropertyWithFallback(e,"name"),artistPictureXL:getPropertyWithFallback(e,"picture_xl"),artistReleases:formatArtistReleases(getPropertyWithFallback(e,"releases"))}}function formatArtistReleases(e){let n={};for(const a in e)if(e.hasOwnProperty(a)){const r=e[a];n[a]=[];for(const i of r)n[a].push({releaseID:getPropertyWithFallback(i,"id"),releaseCover:getPropertyWithFallback(i,"cover_small"),releaseTitle:getPropertyWithFallback(i,"title"),releaseDate:getPropertyWithFallback(i,"release_date"),releaseTracksNumber:getPropertyWithFallback(i,"nb_tracks"),releaseLink:getPropertyWithFallback(i,"link"),releaseType:getPropertyWithFallback(i,"record_type"),isReleaseExplicit:getPropertyWithFallback(i,"explicit_lyrics")})}return n}function getArtistData(e){return socket.emit("getTracklist",{type:"artist",id:e}),new Promise((n,a)=>{socket.on("show_artist",r=>{socket.off("show_artist"),n(r)})})}function standardizeData(e,n){if(e.hasLoaded){const{data:a}=e,r=[];for(const i of a){let s=n(i);r.push(s)}return{data:r,hasLoaded:e.hasLoaded}}else return null}var script$c=defineComponent({components:{BaseTabs,BaseTab},setup(e,n){const a=reactive({currentTab:"",sortKey:"releaseDate",sortOrder:"desc",artistReleases:{},artistName:"",artistPicture:"",currentRelease:computed(()=>a.artistReleases[a.currentTab])}),r=computed(()=>n.root.$router.currentRoute.params.id),i=ref$2(!1);getArtistData(unref(r)).then(l=>{i.value=!0;const c={data:[l],hasLoaded:unref(i)},{data:[{artistName:o,artistPictureXL:u,artistReleases:d}]}=standardizeData(c,formatArtistData);Object.assign(a,{artistName:o,artistPicture:u,artistReleases:d,currentTab:Object.keys(d)[0]})}).catch(l=>console.error(l));const s=computed(()=>{if(!unref(i))return[];let l=a.sortKey;return l==="releaseTracksNumber"&&(l=c=>new Number(c.releaseTracksNumber)),orderBy(a.currentRelease,l,a.sortOrder)});return{...toRefs(a),downloadLink:computed(()=>`https://www.deezer.com/artist/${unref(r)}`),headerStyle:computed(()=>({backgroundImage:`linear-gradient(to bottom, transparent 0%, var(--main-background) 100%), url(${a.artistPicture})`})),sortedData:s,sendAddToQueue,checkNewRelease}},data(){const e=this.$t.bind(this),n=this.$tc.bind(this);return{head:[{title:n("globals.listTabs.title",1),sortKey:"releaseTitle"},{title:e("globals.listTabs.releaseDate"),sortKey:"releaseDate"},{title:n("globals.listTabs.track",2),sortKey:"releaseTracksNumber"},{title:"",width:null}]}},methods:{sortBy(e){e===this.sortKey?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortKey=e,this.sortOrder="asc")}}});const __vue_script__$c=script$c;var __vue_render__$e=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"relative image-header"},[a("header",{staticClass:"flex items-center",style:e.headerStyle},[a("h1",{staticClass:"m-0"},[e._v(e._s(e.artistName))]),e._v(" "),a("div",{staticClass:"grid w-16 h-16 ml-auto rounded-full cursor-pointer bg-primary text-grayscale-870 place-items-center",attrs:{"aria-label":"download",role:"button"},on:{click:function(r){return r.stopPropagation(),e.sendAddToQueue(e.downloadLink)}}},[a("i",{staticClass:"text-4xl material-icons",attrs:{title:e.$t("globals.download_hint")}},[e._v("get_app")])])]),e._v(" "),a("BaseTabs",e._l(e.artistReleases,function(r,i){return a("BaseTab",{key:i,class:{active:e.currentTab===i},on:{click:function(s){e.currentTab=i}}},[e._v(` `+e._s(e.$tc("globals.listTabs."+i,2))+` `)])}),1),e._v(" "),a("table",{staticClass:"table"},[a("thead",[a("tr",e._l(e.head,function(r){return a("th",{key:r.title,staticClass:"uppercase-first-letter",class:{"sort-asc":r.sortKey===e.sortKey&&e.sortOrder=="asc","sort-desc":r.sortKey===e.sortKey&&e.sortOrder=="desc",sortable:r.sortKey,clickable:r.sortKey},style:{width:r.width?r.width:"auto"},on:{click:function(i){r.sortKey&&e.sortBy(r.sortKey)}}},[e._v(` `+e._s(r.title)+` - `)])}),0)]),e._v(" "),a("tbody",e._l(e.sortedData,function(r){return a("tr",{key:r.releaseID},[a("RouterLink",{staticClass:"flex items-center clickable",attrs:{tag:"td","data-cm-link":r.releaseLink,to:{name:"Album",params:{id:r.releaseID}}}},[a("img",{staticClass:"mr-4 rounded coverart",staticStyle:{width:"56px",height:"56px"},attrs:{src:r.releaseCover}}),e._v(" "),r.isReleaseExplicit?a("i",{staticClass:"material-icons title-icon title-icon--explicit"},[e._v("explicit")]):e._e(),e._v(" "),a("div",[a("span",{staticClass:"flex hover:text-primary"},[e._v(e._s(r.releaseTitle))])]),e._v(" "),e.checkNewRelease(r.releaseDate)?a("i",{staticClass:"material-icons title-icon title-icon--right title-icon--new"},[e._v(` - fiber_new - `)]):e._e()]),e._v(" "),a("td",{staticClass:"w-32 text-center xl:w-40"},[e._v(e._s(r.releaseDate))]),e._v(" "),a("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(r.releaseTracksNumber))]),e._v(" "),a("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":r.releaseLink},on:{click:function(i){return i.stopPropagation(),e.sendAddToQueue(r.releaseLink)}}},[a("i",{staticClass:"material-icons hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v("file_download")])])],1)}),0)])],1)},__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,n,a,r,i,s,l,c){const o=(typeof a=="function"?a.options:a)||{};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__$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);let chartsData={},cached$1=!1;function getChartsData(){return cached$1?chartsData:(socket.emit("get_charts_data"),new Promise((e,n)=>{socket.on("init_charts",a=>{chartsData=a,cached$1=!0,socket.off("init_charts"),e(a)})}))}var script$d={methods:{previewMouseEnter(e){EventBus.$emit("trackPreview:previewMouseEnter",e)},previewMouseLeave(e){EventBus.$emit("trackPreview:previewMouseLeave",e)}}};const __vue_script__$d=script$d;var __vue_render__$f=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("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(` + `)])}),0)]),e._v(" "),a("tbody",e._l(e.sortedData,function(r){return a("tr",{key:r.releaseID},[a("RouterLink",{staticClass:"flex items-center clickable",attrs:{tag:"td","data-cm-link":r.releaseLink,to:{name:"Album",params:{id:r.releaseID}}}},[a("img",{staticClass:"mr-4 rounded coverart",staticStyle:{width:"56px",height:"56px"},attrs:{src:r.releaseCover}}),e._v(" "),r.isReleaseExplicit?a("i",{staticClass:"material-icons title-icon title-icon--explicit"},[e._v("explicit")]):e._e(),e._v(" "),a("div",[a("span",{staticClass:"flex hover:text-primary"},[e._v(` + `+e._s(r.releaseTitle)+` + `),e.checkNewRelease(r.releaseDate)?a("i",{staticClass:"material-icons title-icon title-icon--right title-icon--new"},[e._v(` + fiber_new + `)]):e._e()]),e._v(" "),a("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(" "),a("td",{staticClass:"w-32 text-center xl:w-40"},[e._v(e._s(r.releaseDate))]),e._v(" "),a("td",{staticClass:"w-20 text-center xl:w-32"},[e._v(e._s(r.releaseTracksNumber))]),e._v(" "),a("td",{staticClass:"w-8 cursor-pointer",attrs:{"data-cm-link":r.releaseLink},on:{click:function(i){return i.stopPropagation(),e.sendAddToQueue(r.releaseLink)}}},[a("i",{staticClass:"material-icons hover:text-primary",attrs:{title:e.$t("globals.download_hint")}},[e._v("file_download")])])],1)}),0)])],1)},__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,n,a,r,i,s,l,c){const o=(typeof a=="function"?a.options:a)||{};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__$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);let chartsData={},cached$1=!1;function getChartsData(){return cached$1?chartsData:(socket.emit("get_charts_data"),new Promise((e,n)=>{socket.on("init_charts",a=>{chartsData=a,cached$1=!0,socket.off("init_charts"),e(a)})}))}var script$d={methods:{previewMouseEnter(e){EventBus.$emit("trackPreview:previewMouseEnter",e)},previewMouseLeave(e){EventBus.$emit("trackPreview:previewMouseLeave",e)}}};const __vue_script__$d=script$d;var __vue_render__$f=function(){var e=this,n=e.$createElement,a=e._self._c||n;return a("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__$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,n,a,r,i,s,l,c){const o=(typeof a=="function"?a.options:a)||{};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__$f({render:__vue_render__$f,staticRenderFns:__vue_staticRenderFns__$f},__vue_inject_styles__$f,__vue_script__$d,__vue_scope_id__$f,__vue_is_functional_template__$f),script$e={components:{PreviewControls},data(){return{country:"",id:0,countries:[],chart:[]}},computed:{worldwideRelease(){let e=this.countries.filter(n=>n.title==="Worldwide");return e[0]}},async created(){socket.on("setChartTracks",this.setTracklist),this.$on("hook:destroyed",()=>{socket.off("setChartTracks")});let e=await getChartsData(),n;e=e.filter(a=>(a.title==="Worldwide"&&(n=a),a.title!=="Worldwide")),e.unshift(n),this.initCharts(e)},methods:{convertDuration,playPausePreview(e){EventBus.$emit("trackPreview:playPausePreview",e)},addToQueue(e){e.stopPropagation(),sendAddToQueue(e.currentTarget.dataset.link)},getTrackList(e){document.getElementById("content").scrollTo(0,0);const{currentTarget:{dataset:{title:n}},currentTarget:{dataset:{id:a}}}=e;this.country=n,localStorage.setItem("chart",this.country),this.id=a,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 n=0;for(;n explicit
- {{ release.releaseTitle }} - + + {{ release.releaseTitle }} + + fiber_new + + + + {{ $tc(`globals.listTabs.${release.releaseType}`) }} +
- - fiber_new - {{ release.releaseDate }} {{ release.releaseTracksNumber }} diff --git a/src/data/artist.js b/src/data/artist.js index be9762c..a4a17cd 100644 --- a/src/data/artist.js +++ b/src/data/artist.js @@ -25,7 +25,7 @@ function formatArtistReleases(artistReleases) { releaseDate: getPropertyWithFallback(release, 'release_date'), releaseTracksNumber: getPropertyWithFallback(release, 'nb_tracks'), releaseLink: getPropertyWithFallback(release, 'link'), - releaseType: getPropertyWithFallback(release, 'type'), + releaseType: getPropertyWithFallback(release, 'record_type'), isReleaseExplicit: getPropertyWithFallback(release, 'explicit_lyrics') }) }