Moved autologin on server connection
Fixed download entries duplication on desync
This commit is contained in:
parent
812f018896
commit
62b3bb77c2
42157
public/js/bundle.js
42157
public/js/bundle.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -18,6 +18,11 @@ socket.on('logging_in', function () {
|
||||
toast('Logging in', 'loading', false, 'login-toast')
|
||||
})
|
||||
|
||||
socket.on('init_autologin', function() {
|
||||
let arl = localStorage.getItem('arl')
|
||||
if (arl) socket.emit('login', arl)
|
||||
})
|
||||
|
||||
socket.on('logged_in', function (data) {
|
||||
switch (data.status) {
|
||||
case 1:
|
||||
@ -96,7 +101,6 @@ function startApp() {
|
||||
if (localStorage.getItem('arl')) {
|
||||
let arl = localStorage.getItem('arl')
|
||||
|
||||
socket.emit('login', arl)
|
||||
$('#login_input_arl').val(arl)
|
||||
document.getElementById('home_not_logged_in').classList.add('hide')
|
||||
}
|
||||
|
@ -100,10 +100,12 @@ function sendAddToQueue(url, bitrate = null) {
|
||||
function addToQueue(queueItem, current = false) {
|
||||
queueList[queueItem.uuid] = queueItem
|
||||
if (queueItem.downloaded + queueItem.failed == queueItem.size) {
|
||||
queueComplete.push(queueItem.uuid)
|
||||
if (queueComplete.indexOf(queueItem.uuid) == -1) queueComplete.push(queueItem.uuid)
|
||||
} else {
|
||||
queue.push(queueItem.uuid)
|
||||
if (queue.indexOf(queueItem.uuid) == -1) queue.push(queueItem.uuid)
|
||||
}
|
||||
let queueDOM = document.getElementById("download_"+queueItem.uuid)
|
||||
if (typeof(queueDOM) == 'undefined' || queueDOM == null){
|
||||
$(listEl).append(
|
||||
`<div class="download_object" id="download_${queueItem.uuid}" data-deezerid="${queueItem.id}">
|
||||
<div class="download_info">
|
||||
@ -124,13 +126,14 @@ function addToQueue(queueItem, current = false) {
|
||||
</div>
|
||||
</div>`
|
||||
)
|
||||
}
|
||||
if (queueItem.progress > 0 || current) {
|
||||
$('#bar_' + queueItem.uuid)
|
||||
.removeClass('indeterminate')
|
||||
.addClass('determinate')
|
||||
}
|
||||
$('#bar_' + queueItem.uuid).css('width', queueItem.progress + '%')
|
||||
if (queueItem.failed >= 1) {
|
||||
if (queueItem.failed >= 1 && $('#download_' + update.uuid + ' .queue_failed').length == 0) {
|
||||
$('#download_' + queueItem.uuid + ' .download_info_status').append(
|
||||
`<span class="secondary-text inline-flex"><span class="download_slim_separator">(</span><span class="queue_failed">${queueItem.failed}</span><i class="material-icons">error_outline</i><span class="download_slim_separator">)</span></span>`
|
||||
)
|
||||
@ -283,7 +286,7 @@ function updateQueue(update) {
|
||||
$('#download_' + update.uuid + ' .queue_downloaded').text(
|
||||
queueList[update.uuid].downloaded + queueList[update.uuid].failed
|
||||
)
|
||||
if (queueList[update.uuid].failed == 1) {
|
||||
if (queueList[update.uuid].failed == 1 && $('#download_' + update.uuid + ' .queue_failed').length == 0) {
|
||||
$('#download_' + update.uuid + ' .download_info_status').append(
|
||||
`<span class="secondary-text inline-flex"><span class="download_slim_separator">(</span><span class="queue_failed">1</span> <i class="material-icons">error_outline</i><span class="download_slim_separator">)</span></span>`
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user