Added support for abstract-ized library messages

This commit is contained in:
RemixDev 2020-06-05 10:46:22 +02:00
parent d957b47182
commit 5997c3762f
4 changed files with 73 additions and 1 deletions

View File

@ -11417,6 +11417,7 @@ function addToQueue(queueItem, current = false) {
result_icon.text('warning'); result_icon.text('warning');
} }
} }
if (!queueItem.init) toast(`${queueItem.title} added to queue`, 'playlist_add_check');
} }
function initQueue(data) { function initQueue(data) {
@ -11424,15 +11425,18 @@ function initQueue(data) {
if (queueComplete.length) { if (queueComplete.length) {
queueComplete.forEach(item => { queueComplete.forEach(item => {
queueList[item].init = true;
addToQueue(queueList[item]); addToQueue(queueList[item]);
}); });
} }
if (currentItem) { if (currentItem) {
queueList[currentItem].init = true;
addToQueue(queueList[currentItem], true); addToQueue(queueList[currentItem], true);
} }
queue.forEach(item => { queue.forEach(item => {
queueList[item].init = true;
addToQueue(queueList[item]); addToQueue(queueList[item]);
}); });
} }
@ -28198,4 +28202,36 @@ socket.on('logged_out', function () {
jquery('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`); jquery('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`);
document.getElementById('home_not_logged_in').classList.remove('hide'); document.getElementById('home_not_logged_in').classList.remove('hide');
}); });
socket.on('cancellingCurrentItem', function (uuid) {
toast('Cancelling current item.', 'loading', false, 'cancelling_'+uuid);
});
socket.on('currentItemCancelled', function (uuid) {
toast('Current item cancelled.', 'done', true, 'cancelling_'+uuid);
});
socket.on('startAddingArtist', function (data) {
toast(`Adding ${data.name} albums to queue`, 'loading', false, 'artist_'+data.id);
});
socket.on('finishAddingArtist', function (data) {
toast(`Added ${data.name} albums to queue`, 'done', true, 'artist_'+data.id);
});
socket.on('startConvertingSpotifyPlaylist', function (id) {
toast("Converting spotify tracks to deezer tracks", 'loading', false, 'spotifyplaylist_'+id);
});
socket.on('finishConvertingSpotifyPlaylist', function (id) {
toast("Spotify playlist converted", 'done', true, 'spotifyplaylist_'+id);
});
socket.on('errorMessage', function (error) {
toast(error, 'error');
});
socket.on('alreadyInQueue', function (data) {
toast(`${data.title} is already in queue!`, 'playlist_add_check');
});
//# sourceMappingURL=bundle.js.map //# sourceMappingURL=bundle.js.map

File diff suppressed because one or more lines are too long

View File

@ -128,3 +128,35 @@ socket.on('logged_out', function () {
$('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`) $('#settings_picture').attr('src', `https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`)
document.getElementById('home_not_logged_in').classList.remove('hide') document.getElementById('home_not_logged_in').classList.remove('hide')
}) })
socket.on('cancellingCurrentItem', function (uuid) {
toast('Cancelling current item.', 'loading', false, 'cancelling_'+uuid)
})
socket.on('currentItemCancelled', function (uuid) {
toast('Current item cancelled.', 'done', true, 'cancelling_'+uuid)
})
socket.on('startAddingArtist', function (data) {
toast(`Adding ${data.name} albums to queue`, 'loading', false, 'artist_'+data.id)
})
socket.on('finishAddingArtist', function (data) {
toast(`Added ${data.name} albums to queue`, 'done', true, 'artist_'+data.id)
})
socket.on('startConvertingSpotifyPlaylist', function (id) {
toast("Converting spotify tracks to deezer tracks", 'loading', false, 'spotifyplaylist_'+id)
})
socket.on('finishConvertingSpotifyPlaylist', function (id) {
toast("Spotify playlist converted", 'done', true, 'spotifyplaylist_'+id)
})
socket.on('errorMessage', function (error) {
toast(error, 'error')
})
socket.on('alreadyInQueue', function (data) {
toast(`${data.title} is already in queue!`, 'playlist_add_check')
})

View File

@ -158,6 +158,7 @@ function addToQueue(queueItem, current = false) {
result_icon.text('warning') result_icon.text('warning')
} }
} }
if (!queueItem.init) toast(`${queueItem.title} added to queue`, 'playlist_add_check')
} }
function initQueue(data) { function initQueue(data) {
@ -165,15 +166,18 @@ function initQueue(data) {
if (queueComplete.length) { if (queueComplete.length) {
queueComplete.forEach(item => { queueComplete.forEach(item => {
queueList[item].init = true
addToQueue(queueList[item]) addToQueue(queueList[item])
}) })
} }
if (currentItem) { if (currentItem) {
queueList[currentItem].init = true
addToQueue(queueList[currentItem], true) addToQueue(queueList[currentItem], true)
} }
queue.forEach(item => { queue.forEach(item => {
queueList[item].init = true
addToQueue(queueList[item]) addToQueue(queueList[item])
}) })
} }