diff --git a/public/css/style.css b/public/css/style.css index 1bd90d9..fd6eefe 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -54,6 +54,7 @@ div#middle_section { border: 0px; border-radius: 6px; background-color: var(--secondary-background); + color: var(--primary-text) } #content{ background-color: var(--main-background); @@ -132,7 +133,7 @@ div#middle_section { margin: 0px; margin-bottom: 4px; } -.top_result > .info_box > p.subtitle, .release > p.subtitle { +.secondary-text { opacity: 0.75; font-size: 14px; } @@ -154,6 +155,14 @@ div#middle_section { display: inline-block; width: 156px; } +.release > img{ + width: 156px; + height: 156px; +} +.track_row > td > img{ + width: 32px; + height: 32px; +} /* Download tab section */ div#download_tab_container{ @@ -181,14 +190,59 @@ div#download_tab{ font-size: 24px; margin: 4px; } -.release > img{ - width: 156px; - height: 156px; + +#download_list{ + margin: 0px 8px; } -.track_row > td > img{ - width: 32px; - height: 32px; +#download_list > .download_object{ + padding-bottom: 8px; } + +#download_list > .download_object .download_info{ + display: flex; + align-items: center; +} +#download_list > .download_object .download_info img{ + width: 75px; + height: 75px; + display: inline-block; +} +#download_list > .download_object .download_info .download_line{ + display: block; +} +#download_list > .download_object .download_info .download_slim_separator{ + display: none; +} +#download_list > .download_object .download_info_data{ + width: calc(100% - 83px); + padding-left: 8px; +} +#download_list > .download_object .download_info_status{ + width: 80px; +} +#download_list.slim > .download_object .download_info img{ + display: none; +} +#download_list.slim > .download_object .download_info .download_line{ + display: inline-block; +} +#download_list.slim > .download_object .download_info .download_slim_separator{ + display: inline-block; +} +#download_list.slim > .download_object .download_info_data{ + width: auto; + display: inline-block; + padding-left: 0px; +} +#download_list.slim > .download_object .download_info_status{ + width: auto; + display: inline-block; + float: right; +} +#download_list.slim > .download_object .download_info{ + display: block; +} + /* Global stuff */ img.rounded { border-radius: 5px; @@ -196,7 +250,6 @@ img.rounded { img.circle { border-radius: 50%; } - .coverart{ background-color: var(--secondary-background); } @@ -208,7 +261,9 @@ span.tag { font-size: 10px; padding: 3px 6px; } - .tracks_table{ width: 100%; } +.clickable{ + cursor: pointer; +} diff --git a/public/index.html b/public/index.html index 964ac7b..33dfffd 100644 --- a/public/index.html +++ b/public/index.html @@ -49,8 +49,8 @@

{{ names[section] }}

-

{{ results.TOP_RESULT[0].__TYPE__ == 'artist' ? results.TOP_RESULT[0].ART_NAME : results.TOP_RESULT[0].__TYPE__ == 'album' ? results.TOP_RESULT[0].ALB_TITLE : results.TOP_RESULT[0].__TYPE__ == 'playlist' ? results.TOP_RESULT[0].TITLE : '' }}

-

{{ results.TOP_RESULT[0].__TYPE__ == 'artist' ? numberWithDots(results.TOP_RESULT[0].NB_FAN) + ' fans' : results.TOP_RESULT[0].__TYPE__ == 'album' ? 'by '+results.TOP_RESULT[0].ART_NAME+' - '+results.TOP_RESULT[0].NUMBER_TRACK+' tracks' : results.TOP_RESULT[0].__TYPE__ == 'playlist' ? 'by '+results.TOP_RESULT[0].PARENT_USERNAME+' - '+results.TOP_RESULT[0].NB_SONG+' tracks' : '' }}

+

{{ results.TOP_RESULT[0].__TYPE__ == 'artist' ? results.TOP_RESULT[0].ART_NAME : results.TOP_RESULT[0].__TYPE__ == 'album' ? results.TOP_RESULT[0].ALB_TITLE : results.TOP_RESULT[0].__TYPE__ == 'playlist' ? results.TOP_RESULT[0].TITLE : '' }}

+

{{ results.TOP_RESULT[0].__TYPE__ == 'artist' ? numberWithDots(results.TOP_RESULT[0].NB_FAN) + ' fans' : results.TOP_RESULT[0].__TYPE__ == 'album' ? 'by '+results.TOP_RESULT[0].ART_NAME+' - '+results.TOP_RESULT[0].NUMBER_TRACK+' tracks' : results.TOP_RESULT[0].__TYPE__ == 'playlist' ? 'by '+results.TOP_RESULT[0].PARENT_USERNAME+' - '+results.TOP_RESULT[0].NB_SONG+' tracks' : '' }}

{{ results.TOP_RESULT[0].__TYPE__.charAt(0).toUpperCase() + results.TOP_RESULT[0].__TYPE__.substring(1)}}
@@ -62,15 +62,15 @@

{{ names[section] }}

{{artist.ART_NAME}} {{track.ALB_TITLE}} {{convertDuration(track.DURATION)}} - get_app + get_app
-

{{ section == 'ARTIST' ? release.ART_NAME : section == 'ALBUM' ? release.ALB_TITLE : section == 'PLAYLIST' ? release.TITLE : '' }}

-

{{ section == 'ARTIST' ? numberWithDots(release.NB_FAN) + ' fans' : section == 'ALBUM' ? release.ART_NAME+' - '+release.NUMBER_TRACK+' tracks' : section == 'PLAYLIST' ? release.NB_SONG+' tracks' : '' }}

+

{{ section == 'ARTIST' ? release.ART_NAME : section == 'ALBUM' ? release.ALB_TITLE : section == 'PLAYLIST' ? release.TITLE : '' }}

+

{{ section == 'ARTIST' ? numberWithDots(release.NB_FAN) + ' fans' : section == 'ALBUM' ? release.ART_NAME+' - '+release.NUMBER_TRACK+' tracks' : section == 'PLAYLIST' ? release.NB_SONG+' tracks' : '' }}

@@ -94,12 +94,12 @@

No Tracks found

- + {{track.SNG_TITLE + (track.VERSION ? ' '+track.VERSION : '')}} {{artist.ART_NAME}} {{track.ALB_TITLE}} {{convertDuration(track.DURATION)}} - get_app + get_app @@ -111,8 +111,8 @@

No Albums found

-

{{ release.ALB_TITLE }}

-

{{ 'by '+release.ART_NAME }}

+

{{ release.ALB_TITLE }}

+

{{ 'by '+release.ART_NAME }}

@@ -124,8 +124,8 @@

No Artists found

-

{{ release.ART_NAME }}

-

{{ numberWithDots(release.NB_FAN) + ' fans' }}

+

{{ release.ART_NAME }}

+

{{ numberWithDots(release.NB_FAN) + ' fans' }}

@@ -137,8 +137,8 @@

No Playlists found

-

{{ release.TITLE }}

-

{{ release.NB_SONG+' tracks' }}

+

{{ release.TITLE }}

+

{{ release.NB_SONG+' tracks' }}

@@ -159,10 +159,8 @@

No Playlists found

chevron_right -
-
- {{ item.artist }} - {{ item.title }} | {{ item.downloaded }} {{ item.size }} -
+
+
diff --git a/public/js/app.js b/public/js/app.js index d66dcd4..5409e83 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -99,7 +99,7 @@ var mainSearch = new Vue({ "ALBUM": "Albums", "PLAYLIST": "Playlists" }, - results: { + results: { QUERY: "", ORDER: [], ALBUM: {}, @@ -113,7 +113,9 @@ var mainSearch = new Vue({ changeSearchTab: function (section) { if (section != "TOP_RESULT") clickElement('search_'+section.toLowerCase()+'_tab') - } + }, + addToQueue: function(url){socket.emit("addToQueue", {url: url}) + console.log(url)} } }) @@ -123,12 +125,15 @@ var trackSearch = new Vue({ type: "TRACK", nb: 40, query: "", - results: { + results: { data: [], next: 0, total: 0 } - } + }, + methods: { + addToQueue: function(url){socket.emit("addToQueue", {url: url})} + } }) var albumSearch = new Vue({ @@ -137,12 +142,15 @@ var albumSearch = new Vue({ type: "ALBUM", nb: 20, query: "", - results: { + results: { data: [], next: 0, total: 0 } - } + }, + methods: { + addToQueue: function(url){socket.emit("addToQueue", {url: url})} + } }) var artistSearch = new Vue({ @@ -151,12 +159,15 @@ var artistSearch = new Vue({ type: "ARTIST", nb: 20, query: "", - results: { + results: { data: [], next: 0, total: 0 } - } + }, + methods: { + addToQueue: function(url){socket.emit("addToQueue", {url: url})} + } }) var playlistSearch = new Vue({ @@ -165,12 +176,15 @@ var playlistSearch = new Vue({ type: "PLAYLIST", nb: 20, query: "", - results: { + results: { data: [], next: 0, total: 0 } - } + }, + methods: { + addToQueue: function(url){socket.emit("addToQueue", {url: url})} + } }) // Search section diff --git a/public/js/downloadList.js b/public/js/downloadList.js index a0350b9..75ce578 100644 --- a/public/js/downloadList.js +++ b/public/js/downloadList.js @@ -1,21 +1,42 @@ -var downloadList = new Vue({ - el: '#download_list', - data: { - queue: [], - queueList: {} - } -}) +var queueList = {} +var queue = [] socket.on("addedToQueue", function(queueItem){ - downloadList.queueList[queueItem.uuid] = queueItem - downloadList.queue.push(queueItem) + queueList[queueItem.uuid] = queueItem + queue.push(queueItem.uuid) + $("#download_list").append( + `
+
+ Cover ${queueItem.title} +
+ ${queueItem.title} - + ${queueItem.artist} +
+
+ 0/${queueItem.size} +
+
+
+
`) }) socket.on("updateQueue", function(update){ - if (update.uuid && downloadList.queue.indexOf(update.uuid) > -1){ + if (update.uuid && queue.indexOf(update.uuid) > -1){ console.log(update) - if (update.downloaded) downloadList.queueList[update.uuid].downloaded++ - if (update.failed) downloadList.queueList[update.uuid].failed++ - if (update.progress) downloadList.queueList[update.uuid].progress = update.progress + if (update.downloaded){ + queueList[update.uuid].downloaded++ + $("#download_"+update.uuid+" .queue_downloaded").text(queueList[update.uuid].downloaded) + } + if (update.failed){ + queueList[update.uuid].failed++ + if (queueList[update.uuid].failed == 1){ + $("#download_"+update.uuid+" .download_info_status").append(`(1 Failed)`) + }else{ + $("#download_"+update.uuid+" .queue_failed").text(queueList[update.uuid].failed) + } + } + if (update.progress){ + queueList[update.uuid].progress = update.progress + } } })