From cef3e3d8d429b02f350ec9cf00f3710ab7516017 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 19 Aug 2022 22:47:50 +0200 Subject: [PATCH] Made usage of wrong account license more apparent --- src/app.js | 15 ++++++++++++++- src/components/pages/Errors.vue | 21 ++++++++++++++++++++- src/lang/en.mjs | 3 ++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 5f016dc..398742d 100644 --- a/src/app.js +++ b/src/app.js @@ -245,9 +245,22 @@ socket.on('alreadyInQueue', function (data) { toast(i18n.t('toasts.alreadyInQueue', { item: data.title }), 'playlist_add_check') }) -socket.on('loginNeededToDownload', function () { +socket.on('queueErrorNotLoggedIn', function () { toast(i18n.t('toasts.loginNeededToDownload'), 'report') }) +const bitrateLabels = { + 15: '360 HQ', + 14: '360 MQ', + 13: '360 LQ', + 9: 'FLAC', + 3: '320kbps', + 1: '128kbps', + 8: '128kbps', + 0: 'MP3' +} +socket.on('queueErrorCantStream', function (bitrate) { + toast(i18n.t('toasts.queueErrorCantStream', {bitrate: bitrateLabels[bitrate]}), 'report') +}) socket.on('startGeneratingItems', function (data) { toast(i18n.t('toasts.startGeneratingItems', { n: data.total }), 'loading', false, 'batch_' + data.uuid) diff --git a/src/components/pages/Errors.vue b/src/components/pages/Errors.vue index e5fe4fd..0dd3573 100644 --- a/src/components/pages/Errors.vue +++ b/src/components/pages/Errors.vue @@ -13,7 +13,9 @@ {{ error.data.id }} {{ error.data.artist }} {{ error.data.title }} - {{ error.errid ? $t(`errors.ids.${error.errid}`) : error.message }} + + {{ error.errid ? $t(`errors.ids.${error.errid}`, { 'bitrate': downloadBitrate }) : error.message }} +
@@ -38,6 +40,20 @@ import { mapGetters } from 'vuex' export default { + data() { + return { + BITRATE_LABELS: { + 15: '360 HQ', + 14: '360 MQ', + 13: '360 LQ', + 9: 'FLAC', + 3: '320kbps', + 1: '128kbps', + 8: '128kbps', + 0: 'MP3' + } + } + }, computed: { ...mapGetters(['getErrors']), title() { @@ -56,6 +72,9 @@ export default { if(error.type === "post") errors.push(error) }) return errors + }, + downloadBitrate(){ + return this.BITRATE_LABELS[this.getErrors.bitrate] } } } diff --git a/src/lang/en.mjs b/src/lang/en.mjs index d25de0b..83e9d12 100644 --- a/src/lang/en.mjs +++ b/src/lang/en.mjs @@ -135,7 +135,7 @@ const en = { notAvailableNoAlternative: "Track not available on Deezer's servers and no alternative found!", noSpaceLeft: 'No space left on the device!', albumDoesntExists: "Track's album doesn't exist, failed to gather info.", - wrongLicense: "Your account can't stream the track at the desired bitrate.", + wrongLicense: "Your account can't stream tracks in {bitrate}.", wrongGeolocation: "Your account can't stream the track from your current country.", wrongGeolocationNoAlternative: "Your account can't stream the track from your current country and no alternative found." @@ -216,6 +216,7 @@ const en = { startConvertingSpotifyPlaylist: 'Converting spotify tracks to Deezer tracks', finishConvertingSpotifyPlaylist: 'Spotify playlist converted', loginNeededToDownload: 'You need to log in to download tracks!', + queueErrorCantStream: `Your account can't stream at {bitrate}!`, deezerNotAvailable: 'Deezer is not available in your country. You should use a VPN.', deezerNotReachable: "The app can't reach Deezer. Check your internet connection, your firewall or your antivirus.", startGeneratingItems: 'Processing {n} items...',