Removed screen toast spam when adding more albums / tracks in one go

This commit is contained in:
RemixDev 2020-08-17 11:06:24 +02:00
parent ede8f7a6e1
commit 40c7ba9a0c
5 changed files with 22 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -119,10 +119,6 @@ i /deep/ svg {
width: 20px; width: 20px;
} }
.bitcoin /deep/ svg {
fill: #ff9900;
}
.ethereum /deep/ svg { .ethereum /deep/ svg {
fill: var(--foreground); fill: var(--foreground);
} }
@ -196,14 +192,12 @@ ul {
</style> </style>
<script> <script>
import paypal from '@/assets/paypal.svg' import paypal from '@/assets/paypal.svg'
import bitcoin from '@/assets/bitcoin.svg'
import ethereum from '@/assets/ethereum.svg' import ethereum from '@/assets/ethereum.svg'
export default { export default {
data: () => ({ data: () => ({
paypal, paypal,
ethereum, ethereum
bitcoin
}) })
} }
</script> </script>

View File

@ -100,18 +100,18 @@ export default {
if (initQueueComplete.length) { if (initQueueComplete.length) {
initQueueComplete.forEach(item => { initQueueComplete.forEach(item => {
initQueueList[item].init = true initQueueList[item].silent = true
this.addToQueue(initQueueList[item]) this.addToQueue(initQueueList[item])
}) })
} }
if (currentItem) { if (currentItem) {
initQueueList[currentItem].init = true initQueueList[currentItem].silent = true
this.addToQueue(initQueueList[currentItem], true) this.addToQueue(initQueueList[currentItem], true)
} }
initQueue.forEach(item => { initQueue.forEach(item => {
initQueueList[item].init = true initQueueList[item].silent = true
this.addToQueue(initQueueList[item]) this.addToQueue(initQueueList[item])
}) })
@ -121,6 +121,18 @@ export default {
} }
}, },
addToQueue(queueItem, current = false) { addToQueue(queueItem, current = false) {
if (Array.isArray(queueItem)){
if (queueItem.length > 1){
queueItem.forEach((item, i) => {
item.silent = true
this.addToQueue(item)
});
toast(this.$t('toasts.addedMoreToQueue', [queueItem.length]), 'playlist_add_check')
return
}else{
queueItem = queueItem[0]
}
}
this.queueList[queueItem.uuid] = queueItem this.queueList[queueItem.uuid] = queueItem
if (queueItem.downloaded + queueItem.failed == queueItem.size) { if (queueItem.downloaded + queueItem.failed == queueItem.size) {
@ -192,7 +204,7 @@ export default {
} }
} }
if (!queueItem.init) { if (!queueItem.silent) {
toast(this.$t('toasts.addedToQueue', [queueItem.title]), 'playlist_add_check') toast(this.$t('toasts.addedToQueue', [queueItem.title]), 'playlist_add_check')
} }
}, },

View File

@ -155,6 +155,7 @@ const en = {
restoringQueue: 'Restoring download queue...', restoringQueue: 'Restoring download queue...',
queueRestored: 'Download queue restored!', queueRestored: 'Download queue restored!',
addedToQueue: '{0} added to queue', addedToQueue: '{0} added to queue',
addedMoreToQueue: '{0} items added to queue',
alreadyInQueue: '{0} is already in queue!', alreadyInQueue: '{0} is already in queue!',
finishDownload: '{0} finished downloading.', finishDownload: '{0} finished downloading.',
allDownloaded: 'All downloads completed!', allDownloaded: 'All downloads completed!',

View File

@ -157,6 +157,7 @@ const it = {
restoringQueue: 'Ripristinando la coda di download...', restoringQueue: 'Ripristinando la coda di download...',
queueRestored: 'Coda di download ripristinata!', queueRestored: 'Coda di download ripristinata!',
addedToQueue: '{0} aggiunto alla coda', addedToQueue: '{0} aggiunto alla coda',
addedMoreToQueue: '{0} oggetti aggiunti alla coda',
alreadyInQueue: '{0} è già nella coda!', alreadyInQueue: '{0} è già nella coda!',
finishDownload: '{0} ha finito di scaricarsi.', finishDownload: '{0} ha finito di scaricarsi.',
allDownloaded: 'Tutti i download completati!', allDownloaded: 'Tutti i download completati!',