Implemented download selection
This commit is contained in:
parent
20ae210fd0
commit
3339bf87bc
@ -436,7 +436,7 @@ <h2><span v-if="metadata">{{ metadata }}</span><span v-if="release_date">{{ rele
|
||||
<span v-if="label" style="opacity: 0.40;margin-top: 8px;display: inline-block;font-size: 13px;">{{ label }}</span>
|
||||
<footer>
|
||||
<button v-on:contextmenu="openQualityModal(event)" v-on:click="addToQueue(event)" v-bind:data-link="link">Download {{ type }}</button>
|
||||
<button>Download selection<i class="material-icons right">file_download</i></button>
|
||||
<button v-on:contextmenu="openQualityModal(event)" v-on:click="addToQueue(event)" v-bind:data-link="selectedLinks()">Download selection<i class="material-icons right">file_download</i></button>
|
||||
<button onclick="backTab()">Back</button>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -221,13 +221,6 @@ function openQualityModal(link){
|
||||
|
||||
function modalQualityButton(bitrate){
|
||||
var url=$(modalQuality).data("url")
|
||||
if (url.indexOf(";") != -1){
|
||||
urls = url.split(";")
|
||||
urls.forEach(url=>{
|
||||
sendAddToQueue(url, bitrate)
|
||||
})
|
||||
}else{
|
||||
sendAddToQueue(url, bitrate)
|
||||
}
|
||||
$(modalQuality).addClass('animated fadeOut')
|
||||
}
|
||||
|
@ -53,7 +53,14 @@ function clickElement(button) {
|
||||
}
|
||||
|
||||
function sendAddToQueue(url, bitrate = null) {
|
||||
if (url.indexOf(";") != -1){
|
||||
urls = url.split(";")
|
||||
urls.forEach(url=>{
|
||||
socket.emit('addToQueue', { url: url, bitrate: bitrate })
|
||||
})
|
||||
}else{
|
||||
socket.emit('addToQueue', { url: url, bitrate: bitrate })
|
||||
}
|
||||
}
|
||||
|
||||
let MainSearch = new Vue({
|
||||
|
@ -69,11 +69,20 @@ var tracklistTab = new Vue({
|
||||
addToQueue: function(e){e.stopPropagation(); sendAddToQueue(e.currentTarget.dataset.link)},
|
||||
openQualityModal: function(e){e.preventDefault(); openQualityModal(e.currentTarget.dataset.link)},
|
||||
toggleAll: function(e){
|
||||
tracklistTab.body.forEach((item) => {
|
||||
this.body.forEach((item) => {
|
||||
if (item.type == 'track'){
|
||||
item.selected = e.currentTarget.checked
|
||||
}
|
||||
});
|
||||
},
|
||||
selectedLinks: function(){
|
||||
selected = []
|
||||
if (this.body){
|
||||
this.body.forEach((item) => {
|
||||
if (item.type == 'track' && item.selected) selected.push(item.link)
|
||||
})
|
||||
}
|
||||
return selected.join(";")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user