From 416d65f310715700b76289a38155383c425c0ec9 Mon Sep 17 00:00:00 2001 From: exttex Date: Thu, 5 Nov 2020 22:00:29 +0100 Subject: [PATCH] Fixed removing/adding to library, label tag --- app/client/src/components/AlbumTile.vue | 27 +++- app/client/src/components/ArtistTile.vue | 27 +++- app/client/src/components/LibraryAlbums.vue | 7 +- app/client/src/components/LibraryArtists.vue | 7 +- app/client/src/components/PlaylistTile.vue | 19 ++- app/client/src/locales/ar.json | 4 +- app/client/src/locales/de.json | 4 +- app/client/src/locales/el.json | 4 +- app/client/src/locales/en.json | 4 +- app/client/src/locales/es.json | 14 +- app/client/src/locales/fa.json | 4 +- app/client/src/locales/fil.json | 16 ++- app/client/src/locales/fr.json | 106 +++++++-------- app/client/src/locales/he.json | 4 +- app/client/src/locales/hi.json | 4 +- app/client/src/locales/hr.json | 4 +- app/client/src/locales/hu.json | 62 ++++----- app/client/src/locales/id.json | 14 +- app/client/src/locales/it.json | 4 +- app/client/src/locales/ko.json | 4 +- app/client/src/locales/pl.json | 14 +- app/client/src/locales/pt.json | 4 +- app/client/src/locales/ro.json | 4 +- app/client/src/locales/ru.json | 22 ++-- app/client/src/locales/sk.json | 132 +++++++++++++++++++ app/client/src/locales/tr.json | 4 +- app/client/src/locales/uk.json | 18 +-- app/client/src/locales/ur.json | 4 +- app/client/src/main.js | 7 + app/client/src/views/About.vue | 1 - app/client/src/views/AlbumPage.vue | 26 +++- app/client/src/views/ArtistPage.vue | 27 +++- app/client/src/views/PlaylistPage.vue | 68 ++++++++-- app/client/src/views/Settings.vue | 3 +- app/package.json | 2 +- app/src/definitions.js | 16 ++- app/src/downloads.js | 1 + package.json | 2 +- 38 files changed, 514 insertions(+), 180 deletions(-) create mode 100644 app/client/src/locales/sk.json diff --git a/app/client/src/components/AlbumTile.vue b/app/client/src/components/AlbumTile.vue index 91c5997..5991128 100644 --- a/app/client/src/components/AlbumTile.vue +++ b/app/client/src/components/AlbumTile.vue @@ -37,7 +37,7 @@ - + mdi-heart @@ -45,6 +45,15 @@ {{$t("Add to library")}} + + + + mdi-heart-remove + + + {{$t("Remove from library")}} + + @@ -134,9 +143,19 @@ export default { }); this.$emit('clicked') }, - async addLibrary() { - await this.$axios.put(`/library/album?id=${this.album.id}`); - this.$root.globalSnackbar = this.$t('Added to library!'); + async library() { + if (this.album.library) { + //Remove + await this.$axios.delete('/library/album?id=' + this.album.id); + this.$root.globalSnackbar = this.$t('Removed from library!'); + this.album.library = false; + this.$emit('remove'); + } else { + //Add + await this.$axios.put(`/library/album?id=${this.album.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.album.library = true; + } }, //Add to downloads async download() { diff --git a/app/client/src/components/ArtistTile.vue b/app/client/src/components/ArtistTile.vue index 6a4e0bd..3d3ec70 100644 --- a/app/client/src/components/ArtistTile.vue +++ b/app/client/src/components/ArtistTile.vue @@ -18,7 +18,7 @@ - + mdi-heart @@ -26,6 +26,15 @@ {{$t("Add to library")}} + + + + mdi-heart-remove + + + {{$t("Remove from library")}} + + @@ -67,9 +76,19 @@ export default { } }, methods: { - async addLibrary() { - await this.$axios.put(`/library/artist&id=${this.artist.id}`); - this.$root.globalSnackbar = this.$t('Added to library!'); + async library() { + if (this.artist.library) { + //Remove + await this.$axios.delete('/library/artist?id=' + this.artist.id); + this.$root.globalSnackbar = this.$t('Removed from library!'); + this.artist.library = false; + this.$emit('remove'); + } else { + //Add + await this.$axios.put(`/library/artist?id=${this.artist.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.artist.library = true; + } }, click() { //Navigate to details diff --git a/app/client/src/components/LibraryAlbums.vue b/app/client/src/components/LibraryAlbums.vue index a32343a..ceafff4 100644 --- a/app/client/src/components/LibraryAlbums.vue +++ b/app/client/src/components/LibraryAlbums.vue @@ -5,8 +5,8 @@ - - + + @@ -32,6 +32,9 @@ export default { this.albums = res.data.data; } this.loading = false; + }, + removed(index) { + this.albums.splice(index, 1); } }, components: { diff --git a/app/client/src/components/LibraryArtists.vue b/app/client/src/components/LibraryArtists.vue index 2522629..ce45428 100644 --- a/app/client/src/components/LibraryArtists.vue +++ b/app/client/src/components/LibraryArtists.vue @@ -5,8 +5,8 @@ - - + + @@ -35,6 +35,9 @@ export default { this.artists = res.data.data; } this.loading = false; + }, + removed(index) { + this.artists.splice(index, 1); } }, mounted() { diff --git a/app/client/src/components/PlaylistTile.vue b/app/client/src/components/PlaylistTile.vue index 95ead7c..9757657 100644 --- a/app/client/src/components/PlaylistTile.vue +++ b/app/client/src/components/PlaylistTile.vue @@ -36,13 +36,23 @@ + + + + mdi-heart + + + {{$t('Add to library')}} + + + mdi-playlist-remove - {{$t('Remove')}} + {{$t('Remove from library')}} @@ -157,12 +167,17 @@ export default { } this.tracks = tracks; this.downloadDialog = true; + }, + async library() { + await this.$axios.put(`/library/playlist?id=${this.playlist.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.playlist.library = true; } }, computed: { canRemove() { //Own playlist - if (this.$root.profile.id == this.playlist.user.id) return true; + if (this.$root.profile.id == this.playlist.user.id || this.playlist.library) return true; return false; } } diff --git a/app/client/src/locales/ar.json b/app/client/src/locales/ar.json index 184eef9..fefcb15 100644 --- a/app/client/src/locales/ar.json +++ b/app/client/src/locales/ar.json @@ -126,5 +126,7 @@ "Added to library!": "تمت الاضافة الى المكتبة!", "Removed from library!": "الإزالة من المكتبة!", "Removed from playlist!": "تمت الإزالة من قائمة التشغيل!", - "Playlist deleted!": "تم حذف قائمة التشغيل!" + "Playlist deleted!": "تم حذف قائمة التشغيل!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/de.json b/app/client/src/locales/de.json index 84b4579..2d58dd1 100644 --- a/app/client/src/locales/de.json +++ b/app/client/src/locales/de.json @@ -126,5 +126,7 @@ "Added to library!": "Zur Mediathek hinzufügen!", "Removed from library!": "Aus der Mediathek entfernen!", "Removed from playlist!": "Aus der Wiedergabeliste entfernt!", - "Playlist deleted!": "Wiedergabeliste gelöscht!" + "Playlist deleted!": "Wiedergabeliste gelöscht!", + "Delete": "Löschen", + "Are you sure you want to delete this playlist?": "Bist du sicher, dass du diese Wiedergabeliste löschen willst?" } \ No newline at end of file diff --git a/app/client/src/locales/el.json b/app/client/src/locales/el.json index c7215d9..a301842 100644 --- a/app/client/src/locales/el.json +++ b/app/client/src/locales/el.json @@ -126,5 +126,7 @@ "Added to library!": "Προστέθηκε στη βιβλιοθήκη!", "Removed from library!": "Καταργήθηκε από τη βιβλιοθήκη!", "Removed from playlist!": "Καταργήθηκε από τη λίστα αναπαραγωγής!", - "Playlist deleted!": "Η λίστα αναπαραγωγής διαγράφηκε!" + "Playlist deleted!": "Η λίστα αναπαραγωγής διαγράφηκε!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/en.json b/app/client/src/locales/en.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/en.json +++ b/app/client/src/locales/en.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/es.json b/app/client/src/locales/es.json index c2512b1..1e69cdf 100644 --- a/app/client/src/locales/es.json +++ b/app/client/src/locales/es.json @@ -121,10 +121,12 @@ "Telegram Android Group": "Grupo de Android en Telegram", "Credits:": "Créditos:", "Agree": "Acepto", - "Dismiss": "Dismiss", - "Added to playlist!": "Added to playlist!", - "Added to library!": "Added to library!", - "Removed from library!": "Removed from library!", - "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Dismiss": "Descartar", + "Added to playlist!": "¡Añadido a la lista de reproducción!", + "Added to library!": "¡Agregado a la biblioteca!", + "Removed from library!": "¡Eliminado de la biblioteca!", + "Removed from playlist!": "¡Eliminado de la lista de reproducción!", + "Playlist deleted!": "¡Lista de reproducción eliminada!", + "Delete": "Eliminar", + "Are you sure you want to delete this playlist?": "¿Está seguro de querer eliminar la lista de reproducción?" } \ No newline at end of file diff --git a/app/client/src/locales/fa.json b/app/client/src/locales/fa.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/fa.json +++ b/app/client/src/locales/fa.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/fil.json b/app/client/src/locales/fil.json index 50fcf15..a4b9c51 100644 --- a/app/client/src/locales/fil.json +++ b/app/client/src/locales/fil.json @@ -25,7 +25,7 @@ "Create new playlist": "Gumawa ng bagong playlist", "TRACKS": "TRACKS", "Sort by": "Sort by", - "Date Added": "Date Added", + "Date Added": "Petsa kung kailan idinagdag", "Name (A-Z)": "Name (A-Z)", "Artist (A-Z)": "Artista (A-Z)", "Album (A-Z)": "Album (A-Z)", @@ -60,7 +60,7 @@ "Clear queue": "Clear queue", "Playing from": "Playing from", "Info": "Info", - "Lyrics": "Lyrics", + "Lyrics": "Liriko", "Track number": "Track number", "Disk number": "Disk number", "Explicit": "Explicit", @@ -110,13 +110,13 @@ "Settings saved!": "Na-save ang settings!", "Available only in Electron version!": "Meron lamang sa Electron version!", "Crossfade (ms)": "Crossfade (ms)", - "Select primary color": "Select primary color", - "Light theme": "Light theme", - "Create folders for playlists": "Create folders for playlists", + "Select primary color": "Pumili ng pangunahing kulay", + "Light theme": "Maliwanag na tema", + "Create folders for playlists": "Gumawa ng folder para sa mga playlist", "About": "About", "Links:": "Links:", "Telegram Releases": "Telegram Releases", - "Telegram Group": "Telegram Group", + "Telegram Group": "Grupo sa Telegram", "Discord": "Discord", "Telegram Android Group": "Telegram Android Group", "Credits:": "Credits:", @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/fr.json b/app/client/src/locales/fr.json index 8794adb..79c8d3c 100644 --- a/app/client/src/locales/fr.json +++ b/app/client/src/locales/fr.json @@ -9,9 +9,9 @@ "More": "Plus", "Settings": "Paramètres", "Downloads": "Téléchargements", - "Search or paste Deezer URL. Use / to quickly focus.": "Search or paste Deezer URL. Use \"/\" to quickly focus.", - "Play": "Play", - "Add to library": "Add to library", + "Search or paste Deezer URL. Use / to quickly focus.": "Recherchez ou collez une URL Deezer. Utilisez \"/\" pour lancer rapidement la recherche.", + "Play": "Lire", + "Add to library": "Ajouter à la bibliothèque", "Download": "Télécharger", "fans": "fans", "tracks": "pistes", @@ -19,8 +19,8 @@ "Estimated size:": "Durée estimée:", "Start downloading": "Lancer le téléchargement", "Cancel": "Annuler", - "Stream logging is disabled!": "Stream logging is disabled!", - "Enable it in settings for history to work properly.": "Enable it in settings for history to work properly.", + "Stream logging is disabled!": "La journalisation du stream est désactivée !", + "Enable it in settings for history to work properly.": "Activez-le dans les paramètres pour que l'historique fonctionne correctement.", "History": "Historique", "Create new playlist": "Créer une nouvelle playlist", "TRACKS": "PISTES", @@ -29,44 +29,44 @@ "Name (A-Z)": "Nom (A-Z)", "Artist (A-Z)": "Artiste (A-Z)", "Album (A-Z)": "Album (A-Z)", - "Error loading lyrics or lyrics not found!": "Error loading lyrics or lyrics not found!", + "Error loading lyrics or lyrics not found!": "Erreur lors du chargement des paroles ou paroles introuvables !", "Create playlist": "Créer une playlist", "Create": "Créer", "Add to playlist": "Ajouter à une playlist", - "Create new": "Create new", + "Create new": "Créer un nouveau", "Remove": "Supprimer", - "Play next": "Play next", + "Play next": "Lire juste après", "Add to queue": "Ajouter à la file d'attente", "Remove from library": "Supprimer de la bibliothèque", "Remove from playlist": "Supprimer de la playlist", - "Play track mix": "Play track mix", - "Go to": "Go to", - "Track Mix": "Track Mix", + "Play track mix": "Jouer un mélange de pistes", + "Go to": "Aller à", + "Track Mix": "Mélange de piste", "Duration": "Durée", - "Released": "Released", + "Released": "Publié", "Disk": "Disque", "albums": "albums", - "Play top": "Play top", + "Play top": "Lire en haut", "Radio": "Radio", "Show all albums": "Afficher tous les albums", "Show all singles": "Afficher tous les singles", "Show more": "Afficher plus", "Downloaded": "Téléchargés", - "Queue": "Queue", + "Queue": "File d'attente", "Total": "Total", "Stop": "Arrêter", - "Start": "Start", + "Start": "Début", "Show folder": "Afficher le dossier", - "Clear queue": "Clear queue", - "Playing from": "Playing from", - "Info": "Info", - "Lyrics": "Lyrics", - "Track number": "Track number", - "Disk number": "Disk number", - "Explicit": "Explicit", + "Clear queue": "Effacer la liste d'attente", + "Playing from": "Lecture depuis", + "Info": "Infos", + "Lyrics": "Paroles", + "Track number": "Numéro de piste", + "Disk number": "Numéro de disque", + "Explicit": "Explicite", "Source": "Source", "ID": "ID", - "Error logging in!": "Error logging in!", + "Error logging in!": "Erreur de connexion !", "Please try again later, or try another account.": "Veuillez réessayer plus tard, ou essayez avec un autre compte.", "Logout": "Déconnexion", "Login using browser": "Connexion via navigateur", @@ -74,57 +74,59 @@ "...or paste your ARL/Token below:": "...ou copiez votre ARL/Token ici:", "ARL/Token": "ARL/Token", "Login": "Connexion", - "By using this program, you disagree with Deezer's ToS.": "By using this program, you disagree with Deezer's ToS.", + "By using this program, you disagree with Deezer's ToS.": "En utilisant ce programme, vous désagréez avec les conditions générales d'utilisation et de vente de Deezer.", "Only in Electron version!": "Uniquement en version Electron !", "Search results for:": "Résultats de la recherche pour:", - "Error loading data!": "Error loading data!", + "Error loading data!": "Erreur lors du chargement des données !", "Try again later!": "Réessayez plus tard !", "Search": "Recherche", "Streaming Quality": "Qualité en streaming", "Download Quality": "Qualité de téléchargement", "Downloads Directory": "Chemin de sauvegarde", "Simultaneous downloads": "Limite téléchargements simultanés", - "Always show download confirm dialog before downloading.": "Always show download confirm dialog before downloading.", - "Show download dialog": "Show download dialog", + "Always show download confirm dialog before downloading.": "Toujours afficher une boîte de dialogue pour confirmer le téléchargement avant de le commencer.", + "Show download dialog": "Afficher une boîte de dialogue pour chaque téléchargement", "Create folders for artists": "Générer des dossiers par artiste", "Create folders for albums": "Générer des dossiers par album", "Download lyrics": "Télécharger les paroles", "Variables": "Variables", "UI": "Interface", - "Show autocomplete in search": "Show autocomplete in search", + "Show autocomplete in search": "Afficher la saisie automatique dans la recherche", "Integrations": "Intégrations", - "This allows listening history, flow and recommendations to work properly.": "Cela permet à l'historique des titres écoutés, flow et aux recommandations de fonctionner correctement.", - "Log track listens to Deezer": "Log track listens to Deezer", - "Connect your LastFM account to allow scrobbling.": "Connect your LastFM account to allow scrobbling.", - "Login with LastFM": "Login with LastFM", - "Disconnect LastFM": "Disconnect LastFM", + "This allows listening history, flow and recommendations to work properly.": "Cela permet à l'historique des titres écoutés, au flow et aux recommandations de fonctionner correctement.", + "Log track listens to Deezer": "Journaliser la piste écoutée sur Deezer", + "Connect your LastFM account to allow scrobbling.": "Connectez votre compte LastFM pour autoriser le scrobbling.", + "Login with LastFM": "Se connecter avec LastFM", + "Disconnect LastFM": "Déconnecté LastFM", "Requires restart to apply!": "Redémarrage nécessaire pour prendre effet !", "Enable Discord Rich Presence, requires restart to toggle!": "Activer la présence Discord, nécessite un redémarrage pour prendre effet !", - "Discord Rich Presence": "Présence Discord", + "Discord Rich Presence": "Présence sur Discord", "Enable Discord join button for syncing tracks, requires restart to toggle!": "Activer le bouton \"rejoindre\" sur Discord pour synchroniser les pistes, nécessite un redémarrage pour prendre effet !", "Discord Join Button": "Bouton rejoindre sur Discord", "Other": "Autre", "Minimize to tray": "Réduire dans la zone de notification", "Don't minimize to tray": "Ne pas réduire dans la zone de notification", - "Close on exit": "Close on exit", + "Close on exit": "Fermer en quittant", "Settings saved!": "Paramètres sauvegardés !", "Available only in Electron version!": "Uniquement disponible en version Electron !", - "Crossfade (ms)": "Crossfade (ms)", - "Select primary color": "Select primary color", - "Light theme": "Light theme", - "Create folders for playlists": "Create folders for playlists", - "About": "About", - "Links:": "Links:", - "Telegram Releases": "Telegram Releases", - "Telegram Group": "Telegram Group", + "Crossfade (ms)": "Fondu enchaîné (ms)", + "Select primary color": "Sélectionner la couleur principale", + "Light theme": "Thème clair", + "Create folders for playlists": "Créer des dossiers par playlist", + "About": "À propos", + "Links:": "Liens:", + "Telegram Releases": "Publications Telegram", + "Telegram Group": "Groupe Telegram", "Discord": "Discord", - "Telegram Android Group": "Telegram Android Group", - "Credits:": "Credits:", - "Agree": "Agree", - "Dismiss": "Dismiss", - "Added to playlist!": "Added to playlist!", - "Added to library!": "Added to library!", - "Removed from library!": "Removed from library!", - "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Telegram Android Group": "Groupe Telegram Android", + "Credits:": "Crédits:", + "Agree": "Accepter", + "Dismiss": "Cacher", + "Added to playlist!": "Ajouté à la playlist !", + "Added to library!": "Ajouté à la bibliothèque !", + "Removed from library!": "Supprimé de la bibliothèque !", + "Removed from playlist!": "Supprimé de la playlist !", + "Playlist deleted!": "Playlist supprimée !", + "Delete": "Supprimer", + "Are you sure you want to delete this playlist?": "Voulez-vous vraiment supprimer cette liste de lecture ?" } \ No newline at end of file diff --git a/app/client/src/locales/he.json b/app/client/src/locales/he.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/he.json +++ b/app/client/src/locales/he.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/hi.json b/app/client/src/locales/hi.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/hi.json +++ b/app/client/src/locales/hi.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/hr.json b/app/client/src/locales/hr.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/hr.json +++ b/app/client/src/locales/hr.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/hu.json b/app/client/src/locales/hu.json index 0e94fee..8f13d6e 100644 --- a/app/client/src/locales/hu.json +++ b/app/client/src/locales/hu.json @@ -9,36 +9,36 @@ "More": "Továbbiak", "Settings": "Beállítások", "Downloads": "Letöltések", - "Search or paste Deezer URL. Use / to quickly focus.": "Search or paste Deezer URL. Use \"/\" to quickly focus.", - "Play": "Play", - "Add to library": "Add to library", - "Download": "Download", - "fans": "fans", - "tracks": "tracks", - "Quality": "Quality", - "Estimated size:": "Estimated size:", - "Start downloading": "Start downloading", - "Cancel": "Cancel", - "Stream logging is disabled!": "Stream logging is disabled!", - "Enable it in settings for history to work properly.": "Enable it in settings for history to work properly.", - "History": "History", - "Create new playlist": "Create new playlist", - "TRACKS": "TRACKS", - "Sort by": "Sort by", - "Date Added": "Date Added", - "Name (A-Z)": "Name (A-Z)", - "Artist (A-Z)": "Artist (A-Z)", + "Search or paste Deezer URL. Use / to quickly focus.": "Keressen, vagy illesszen be Deezer URL linket. Használja a \"/\" karaktert, hogy gyorsan ősszpontosítson.", + "Play": "Lejátszás", + "Add to library": "Hozzáadás a könyvtárhoz", + "Download": "Letöltés", + "fans": "rajongók", + "tracks": "dalok", + "Quality": "Minőség", + "Estimated size:": "Becsült fájl méret:", + "Start downloading": "Letöltés indítása", + "Cancel": "Mégse", + "Stream logging is disabled!": "Stream naplózás le van tiltva!", + "Enable it in settings for history to work properly.": "Engedélyezze a beállításokban, hogy az előzmények megfelelően működjenek.", + "History": "Előzmények", + "Create new playlist": "Új lejátszási lista létrehozása", + "TRACKS": "DALOK", + "Sort by": "Rendezési elv", + "Date Added": "Hozzáadás dátuma", + "Name (A-Z)": "Név (A-Z)", + "Artist (A-Z)": "Előadó (A-Z)", "Album (A-Z)": "Album (A-Z)", - "Error loading lyrics or lyrics not found!": "Error loading lyrics or lyrics not found!", - "Create playlist": "Create playlist", - "Create": "Create", - "Add to playlist": "Add to playlist", - "Create new": "Create new", - "Remove": "Remove", - "Play next": "Play next", - "Add to queue": "Add to queue", - "Remove from library": "Remove from library", - "Remove from playlist": "Remove from playlist", + "Error loading lyrics or lyrics not found!": "Hiba a dalszöveg betöltésekor, vagy nem található dalszöveg!", + "Create playlist": "Lejátszási lista létrehozása", + "Create": "Létrehozás", + "Add to playlist": "Hozzáadás a lejátszási listához", + "Create new": "Új létrehozása", + "Remove": "Eltávolítás", + "Play next": "Következő lejátszása", + "Add to queue": "Hozzáadás a várólistához", + "Remove from library": "Eltávolítás a könyvtárból", + "Remove from playlist": "Eltávolítás a lejátszási listáról", "Play track mix": "Play track mix", "Go to": "Go to", "Track Mix": "Track Mix", @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/id.json b/app/client/src/locales/id.json index 4cbeb7e..3526b2f 100644 --- a/app/client/src/locales/id.json +++ b/app/client/src/locales/id.json @@ -121,10 +121,12 @@ "Telegram Android Group": "Telegram Grub Android", "Credits:": "Kredit:", "Agree": "Setuju", - "Dismiss": "Dismiss", - "Added to playlist!": "Added to playlist!", - "Added to library!": "Added to library!", - "Removed from library!": "Removed from library!", - "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Dismiss": "Abaikan", + "Added to playlist!": "Ditambahkan ke daftar putar!", + "Added to library!": "Ditambahkan ke koleksi!", + "Removed from library!": "Dihapus dari koleksi!", + "Removed from playlist!": "Dihapus dari daftar putar!", + "Playlist deleted!": "Daftar putar dihapus!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/it.json b/app/client/src/locales/it.json index 921e82d..e1a8aa7 100644 --- a/app/client/src/locales/it.json +++ b/app/client/src/locales/it.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/ko.json b/app/client/src/locales/ko.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/ko.json +++ b/app/client/src/locales/ko.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/pl.json b/app/client/src/locales/pl.json index 45cb7f5..372a2a3 100644 --- a/app/client/src/locales/pl.json +++ b/app/client/src/locales/pl.json @@ -121,10 +121,12 @@ "Telegram Android Group": "Grupa Telegram dla wydań na Android", "Credits:": "Twórcy:", "Agree": "Akceptuję", - "Dismiss": "Dismiss", - "Added to playlist!": "Added to playlist!", - "Added to library!": "Added to library!", - "Removed from library!": "Removed from library!", - "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Dismiss": "Odrzuć", + "Added to playlist!": "Dodano do playlisty!", + "Added to library!": "Dodano do biblioteki!", + "Removed from library!": "Usunięto z biblioteki!", + "Removed from playlist!": "Usunięto z playlisty!", + "Playlist deleted!": "Playlista została usunięta!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/pt.json b/app/client/src/locales/pt.json index ffa97b1..72077b9 100644 --- a/app/client/src/locales/pt.json +++ b/app/client/src/locales/pt.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/ro.json b/app/client/src/locales/ro.json index c4e8a58..f551f66 100644 --- a/app/client/src/locales/ro.json +++ b/app/client/src/locales/ro.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/ru.json b/app/client/src/locales/ru.json index fee73a9..3d793a2 100644 --- a/app/client/src/locales/ru.json +++ b/app/client/src/locales/ru.json @@ -110,21 +110,23 @@ "Settings saved!": "Настройки сохранены!", "Available only in Electron version!": "Доступно только в версии на Electron!", "Crossfade (ms)": "Кроссфейд (мс)", - "Select primary color": "Select primary color", - "Light theme": "Light theme", - "Create folders for playlists": "Create folders for playlists", - "About": "About", - "Links:": "Links:", - "Telegram Releases": "Telegram Releases", - "Telegram Group": "Telegram Group", + "Select primary color": "Выберите основной цвет", + "Light theme": "Светлая тема", + "Create folders for playlists": "Создавать папки для плейлистов", + "About": "О приложении", + "Links:": "Ссылки:", + "Telegram Releases": "Релизы в Telegram", + "Telegram Group": "Группа в Telegram", "Discord": "Discord", - "Telegram Android Group": "Telegram Android Group", - "Credits:": "Credits:", + "Telegram Android Group": "Обсуждение Freezer Android", + "Credits:": "Благодарность:", "Agree": "Agree", "Dismiss": "Dismiss", "Added to playlist!": "Added to playlist!", "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/sk.json b/app/client/src/locales/sk.json new file mode 100644 index 0000000..6db9d32 --- /dev/null +++ b/app/client/src/locales/sk.json @@ -0,0 +1,132 @@ +{ + "Home": "Domov", + "Browse": "Prehliadať", + "Library": "Knižnica", + "Tracks": "Skladby", + "Playlists": "Playlisty", + "Albums": "Albumy", + "Artists": "Umelci", + "More": "Viac", + "Settings": "Nastavenia", + "Downloads": "K stiahnutiu", + "Search or paste Deezer URL. Use / to quickly focus.": "Vyhľadať alebo vložiť Deezer URL. Použite \"/\" pre rýchly náhľad.", + "Play": "Prehrať", + "Add to library": "Pridať do knižnice", + "Download": "Stiahnuť", + "fans": "fanúšikovia", + "tracks": "skladby", + "Quality": "Kvalita", + "Estimated size:": "Odhadovaná veľkosť:", + "Start downloading": "Začať sťahovať", + "Cancel": "Zrušiť", + "Stream logging is disabled!": "Zaznamenávanie streamu je zakázané!", + "Enable it in settings for history to work properly.": "Povoliť v nastaveniach pre správne fungovanie histórie.", + "History": "História", + "Create new playlist": "Vytvoriť nový playlist", + "TRACKS": "SKLADBY", + "Sort by": "Zoradiť podľa", + "Date Added": "Dátum pridania", + "Name (A-Z)": "Meno (A-Z)", + "Artist (A-Z)": "Umelec (А-Z)", + "Album (A-Z)": "Album (А-Z)", + "Error loading lyrics or lyrics not found!": "Chyba načítania textu alebo, text nie je dostupný!", + "Create playlist": "Vytvoriť playlist", + "Create": "Vytvoriť", + "Add to playlist": "Pridať do playlistu", + "Create new": "Vytvoriť nový", + "Remove": "Odstrániť", + "Play next": "Prehrať ďalšie", + "Add to queue": "Pridať do poradia", + "Remove from library": "Odstrániť z knižnice", + "Remove from playlist": "Odstrániť z playlistu", + "Play track mix": "Prehrať mix skladieb", + "Go to": "Ísť na", + "Track Mix": "Mix skladieb", + "Duration": "Trvanie", + "Released": "Vydané", + "Disk": "Disk", + "albums": "albumy", + "Play top": "Prehrať najlepšie", + "Radio": "Rádio", + "Show all albums": "Zobraziť všetky albumy", + "Show all singles": "Zobraziť všetky single", + "Show more": "Zobraziť viac", + "Downloaded": "Stiahnuté", + "Queue": "Poradie", + "Total": "Spolu", + "Stop": "Stop", + "Start": "Štart", + "Show folder": "Zobraziť priečinok", + "Clear queue": "Vyčistiť poradie", + "Playing from": "Prehráva sa", + "Info": "Info", + "Lyrics": "Texty", + "Track number": "Číslo skladby", + "Disk number": "Číslo disku", + "Explicit": "Výslovné", + "Source": "Zdroj", + "ID": "ID", + "Error logging in!": "Chyba prihlásenia!", + "Please try again later, or try another account.": "Prosím skúste znova alebo použite iný účet.", + "Logout": "Odhlásiť", + "Login using browser": "Prihlásenie cez prehliadač", + "Please login using your Deezer account:": "Prosím prihláste sa s použitím Deezer účtu:", + "...or paste your ARL/Token below:": "...alebo použite váš ARL/Token nižšie:", + "ARL/Token": "ARL/Token", + "Login": "Prihlásiť", + "By using this program, you disagree with Deezer's ToS.": "Použitím tejto aplikácie nesúhlasíte s Deezer ToS.", + "Only in Electron version!": "Iba vo verzii Electron!", + "Search results for:": "Výsledok hľadanie pre:", + "Error loading data!": "Chyba načítania dát!", + "Try again later!": "Skúste znova neskôr!", + "Search": "Hľadať", + "Streaming Quality": "Kvalita streamu", + "Download Quality": "Kvalita sťahovania", + "Downloads Directory": "Priečinok sťahovania", + "Simultaneous downloads": "Simultánne sťahovanie", + "Always show download confirm dialog before downloading.": "Pred stiahnutím vždy zobraziť dialógové okno s potvrdením stiahnutia.", + "Show download dialog": "Zobraziť dialógové okno sťahovania", + "Create folders for artists": "Vytvoriť pričinky pre umelcov", + "Create folders for albums": "Vytvoriť pričinky pre albumy", + "Download lyrics": "Sťahovať texty", + "Variables": "Premenné", + "UI": "Používateľské rozhranie", + "Show autocomplete in search": "Automatické dopĺňanie pri vyhľadávaní", + "Integrations": "Integrácia", + "This allows listening history, flow and recommendations to work properly.": "Umožňuje správne fungovanie histórie, flow a odporúčaní počúvania.", + "Log track listens to Deezer": "Zaznamenávia počúvania pre Deezer", + "Connect your LastFM account to allow scrobbling.": "Pripojte sa na váš LastFM účet pre použitie scrobblingu.", + "Login with LastFM": "Prihlásiť s LastFM", + "Disconnect LastFM": "Odpojiť od LastFM", + "Requires restart to apply!": "Vyžadovaný reštart pre použitie!", + "Enable Discord Rich Presence, requires restart to toggle!": "Povoliť funkciu Discord Rich Presence, na prepnutie je potrebný reštart!", + "Discord Rich Presence": "Discord Rich Presence", + "Enable Discord join button for syncing tracks, requires restart to toggle!": "Povoliť tlačidlo Discord join na synchronizáciu skladieb, na prepnutie je potrebný reštart!", + "Discord Join Button": "Discord Join tlačidlo", + "Other": "Iné", + "Minimize to tray": "Minimalizovať do lišty", + "Don't minimize to tray": "Neminimalizovať do lišty", + "Close on exit": "Zatvoriť pri ukončení", + "Settings saved!": "Nastavenia uložené!", + "Available only in Electron version!": "Iba vo verzii Electron!", + "Crossfade (ms)": "Prelínanie (ms)", + "Select primary color": "Vybrať primárnu farbu", + "Light theme": "Svetlá téma", + "Create folders for playlists": "Vytvoriť priečinky pre playlisty", + "About": "O aplikácii", + "Links:": "Linky:", + "Telegram Releases": "Telegram vydania", + "Telegram Group": "Telegram skupina", + "Discord": "Discord", + "Telegram Android Group": "Telegram Android skupina", + "Credits:": "Autori:", + "Agree": "Súhlasím", + "Dismiss": "Odmietnuť", + "Added to playlist!": "Pridané do playlistu!", + "Added to library!": "Pridané do knižnice!", + "Removed from library!": "Odstránené z knižnice!", + "Removed from playlist!": "Odstránené z playlistu!", + "Playlist deleted!": "Playlist odstránený!", + "Delete": "Odstrániť", + "Are you sure you want to delete this playlist?": "Naozaj chcete odstrániť tento zoznam skladieb?" +} \ No newline at end of file diff --git a/app/client/src/locales/tr.json b/app/client/src/locales/tr.json index d0260fa..de39b3d 100644 --- a/app/client/src/locales/tr.json +++ b/app/client/src/locales/tr.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/uk.json b/app/client/src/locales/uk.json index c1918a6..ea2bf2d 100644 --- a/app/client/src/locales/uk.json +++ b/app/client/src/locales/uk.json @@ -46,7 +46,7 @@ "Released": "Реліз", "Disk": "Диск", "albums": "альбоми", - "Play top": "Грати зверху", + "Play top": "Відтворити top", "Radio": "Радіо", "Show all albums": "Показати всі альбоми", "Show all singles": "Показати всі композиції", @@ -109,7 +109,7 @@ "Close on exit": "Закрити при виході", "Settings saved!": "Налаштування збережено!", "Available only in Electron version!": "Доступно лише в Electron версії!", - "Crossfade (ms)": "Перехресне затухання (мс)", + "Crossfade (ms)": "Плавний перехід (мс)", "Select primary color": "Вибрати основний колір", "Light theme": "Світла тема", "Create folders for playlists": "Створити теки для плейлистів", @@ -121,10 +121,12 @@ "Telegram Android Group": "Група Android в Telegram", "Credits:": "Автори:", "Agree": "Погоджуюсь", - "Dismiss": "Dismiss", - "Added to playlist!": "Added to playlist!", - "Added to library!": "Added to library!", - "Removed from library!": "Removed from library!", - "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Dismiss": "Відхилити", + "Added to playlist!": "Додано до плейлиста!", + "Added to library!": "Додано до бібліотеки!", + "Removed from library!": "Видалено з бібліотеки!", + "Removed from playlist!": "Видалено з плейлиста!", + "Playlist deleted!": "Плейлист видалено!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/locales/ur.json b/app/client/src/locales/ur.json index d3cf79e..70d97dd 100644 --- a/app/client/src/locales/ur.json +++ b/app/client/src/locales/ur.json @@ -126,5 +126,7 @@ "Added to library!": "Added to library!", "Removed from library!": "Removed from library!", "Removed from playlist!": "Removed from playlist!", - "Playlist deleted!": "Playlist deleted!" + "Playlist deleted!": "Playlist deleted!", + "Delete": "Delete", + "Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?" } \ No newline at end of file diff --git a/app/client/src/main.js b/app/client/src/main.js index f221415..2d4be7b 100644 --- a/app/client/src/main.js +++ b/app/client/src/main.js @@ -321,6 +321,13 @@ new Vue({ await this.savePlaybackInfo(); return; } + + //End of queue + if (this.queue.index+1 == this.queue.data.length) { + this.state = 1; + return; + } + //Skip to next track this.skip(1); this.savePlaybackInfo(); diff --git a/app/client/src/views/About.vue b/app/client/src/views/About.vue index 8e3d4cf..fd32676 100644 --- a/app/client/src/views/About.vue +++ b/app/client/src/views/About.vue @@ -143,7 +143,6 @@ export default { }, created() { this.$axios.get('/about').then((res) => { - console.log(res); this.data = res.data; }); } diff --git a/app/client/src/views/AlbumPage.vue b/app/client/src/views/AlbumPage.vue index 7bc8eea..eddca08 100644 --- a/app/client/src/views/AlbumPage.vue +++ b/app/client/src/views/AlbumPage.vue @@ -32,8 +32,14 @@ {{$t("Play")}} - mdi-heart - {{$t("Library")}} +
+ mdi-heart + {{$t("Library")}} +
+
+ mdi-heart-remove + {{$t("Remove")}} +
mdi-download @@ -103,9 +109,18 @@ export default { //Add to library async library() { this.libraryLoading = true; - await this.$axios.put(`/library/album?id=${this.album.id}`); + if (this.album.library) { + //Remove + await this.$axios.delete('/library/album?id=' + this.album.id); + this.$root.globalSnackbar = this.$t('Removed from library!'); + this.album.library = false; + } else { + //Add + await this.$axios.put(`/library/album?id=${this.album.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.album.library = true; + } this.libraryLoading = false; - this.$root.globalSnackbar = this.$t('Added to library!'); }, async download() { this.downloadDialog = true; @@ -123,7 +138,10 @@ export default { this.loading = true; let data = await this.$axios.get(`/album/${this.album.id}`); if (data && data.data && data.data.tracks) { + //Preserve library + let library = this.album.library; this.album = data.data; + this.album.library = library; } this.loading = false; } diff --git a/app/client/src/views/ArtistPage.vue b/app/client/src/views/ArtistPage.vue index 194eff3..1af94b7 100644 --- a/app/client/src/views/ArtistPage.vue +++ b/app/client/src/views/ArtistPage.vue @@ -26,8 +26,15 @@ {{$t("Play top")}} - mdi-heart - {{$t("Library")}} +
+ mdi-heart + {{$t("Library")}} +
+
+ mdi-heart-remove + {{$t("Remove")}} +
+
mdi-radio @@ -150,8 +157,17 @@ export default { //Add to library async library() { this.libraryLoading = true; - await this.$axios.put(`/library/artist?id=${this.artist.id}`); - this.$root.globalSnackbar = this.$t('Added to library!'); + if (this.artist.library) { + //Remove + await this.$axios.delete('/library/artist?id=' + this.artist.id); + this.$root.globalSnackbar = this.$t('Removed from library!'); + this.artist.library = false; + } else { + //Add + await this.$axios.put(`/library/artist?id=${this.artist.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.artist.library = true; + } this.libraryLoading = false; }, async load() { @@ -160,7 +176,10 @@ export default { this.loading = true; let data = await this.$axios.get(`/artist/${this.artist.id}`); if (data && data.data && data.data.topTracks) { + //Preserve library + let library = this.artist.library; this.artist = data.data; + this.artist.library = library; } this.loading = false; } diff --git a/app/client/src/views/PlaylistPage.vue b/app/client/src/views/PlaylistPage.vue index d25efb2..694213f 100644 --- a/app/client/src/views/PlaylistPage.vue +++ b/app/client/src/views/PlaylistPage.vue @@ -22,19 +22,29 @@ {{$numberString(playlist.fans)}} {{$t('fans')}}
-
+
mdi-play {{$t('Play')}} - - mdi-heart - {{$t('Library')}} + +
+ mdi-heart + {{$t('Library')}} +
+
+ mdi-heart-remove + {{$t('Remove')}} +
mdi-download {{$t('Download')}} + + mdi-delete + {{$t('Delete')}} +
@@ -57,6 +67,23 @@ + + + + + {{$t("Delete")}} + + + {{$t("Are you sure you want to delete this playlist?")}} + + + + {{$t("Cancel")}} + {{$t("Delete")}} + + + + @@ -70,7 +97,7 @@ export default { TrackTile, DownloadDialog }, props: { - playlistData: Object + playlistData: Object, }, data() { return { @@ -81,7 +108,8 @@ export default { loadingTracks: false, //Add to library button libraryLoading: false, - downloadDialog: false + downloadDialog: false, + deleteDialog: false } }, methods: { @@ -139,9 +167,18 @@ export default { }, async library() { this.libraryLoading = true; - await this.$axios.put(`/library/playlist?id=${this.playlist.id}`); + if (this.playlist.library) { + //Remove + await this.$axios.delete('/library/playlist?id=' + this.playlist.id); + this.$root.globalSnackbar = this.$t('Removed from library!'); + this.playlist.library = false; + } else { + //Add + await this.$axios.put(`/library/playlist?id=${this.playlist.id}`); + this.$root.globalSnackbar = this.$t('Added to library!'); + this.playlist.library = true; + } this.libraryLoading = false; - this.$root.globalSnackbar = this.$t('Added to library!'); }, async initialLoad() { @@ -150,7 +187,10 @@ export default { this.loading = true; let data = await this.$axios.get(`/playlist/${this.playlist.id}?start=0`); if (data && data.data && data.data.tracks) { + //Preserve library state + let inLib = this.playlist.library; this.playlist = data.data; + this.playlist.library = inLib; } this.loading = false; } @@ -165,10 +205,20 @@ export default { await this.loadAllTracks(); } this.downloadDialog = true; + }, + async deletePlaylist() { + await this.$axios.delete(`/playlist/${this.playlist.id}`); + this.$router.go(-1); } }, mounted() { - this.initialLoad(); + this.initialLoad(); + }, + computed: { + isOwn() { + if (this.$root.profile.id == this.playlist.user.id) return true; + return false; + } }, watch: { //Reload on playlist change from drawer diff --git a/app/client/src/views/Settings.vue b/app/client/src/views/Settings.vue index 4ce85e0..cd7dcfd 100644 --- a/app/client/src/views/Settings.vue +++ b/app/client/src/views/Settings.vue @@ -96,7 +96,7 @@ label='Download Filename' persistent-hint v-model='$root.settings.downloadFilename' - :hint='$t("Variables") + ": %title%, %artists%, %artist%, %feats%, %trackNumber%, %0trackNumber%, %album%, %year%"' + :hint='$t("Variables") + ": %title%, %artists%, %artist%, %feats%, %trackNumber%, %0trackNumber%, %album%, %year%, %label%"' > @@ -301,6 +301,7 @@ export default { {code: 'pt', name: 'Portuguese'}, {code: 'ro', name: 'Romanian'}, {code: 'ru', name: 'Russian'}, + {code: 'sk', name: 'Slovak'}, {code: 'es', name: 'Spanish'}, {code: 'tr', name: 'Turkish'}, {code: 'uk', name: 'Ukrainian'} diff --git a/app/package.json b/app/package.json index 37148d6..6c5df77 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "freezer", "private": true, - "version": "1.1.3", + "version": "1.1.4", "description": "", "main": "background.js", "scripts": { diff --git a/app/src/definitions.js b/app/src/definitions.js index 7b9df57..7668aea 100644 --- a/app/src/definitions.js +++ b/app/src/definitions.js @@ -41,7 +41,7 @@ class Track { } class Album { - constructor(json, tracksJson = {data: []}) { + constructor(json, tracksJson = {data: []}, library = false) { this.id = json.ALB_ID.toString(); this.title = json.ALB_TITLE; this.art = new DeezerImage(json.ALB_PICTURE); @@ -65,11 +65,13 @@ class Album { //Helpers this.artistString = this.artists.map((a) => a.name).join(', '); + + this.library = library; } } class Artist { - constructor(json, albumsJson = {data: []}, topJson = {data: []}) { + constructor(json, albumsJson = {data: []}, topJson = {data: []}, library = false) { this.id = json.ART_ID.toString(); this.name = json.ART_NAME; this.fans = json.NB_FAN; @@ -78,11 +80,12 @@ class Artist { this.albums = albumsJson.data.map((a) => new Album(a)); this.topTracks = topJson.data.map((t) => new Track(t)); this.radio = json.SMARTRADIO; + this.library = library; } } class Playlist { - constructor(json, tracksJson = {data: []}) { + constructor(json, tracksJson = {data: []}, library = false) { this.id = json.PLAYLIST_ID.toString(), this.title = json.TITLE, this.trackCount = json.NB_SONG ? json.NB_SONG : tracksJson.total; @@ -96,6 +99,7 @@ class Playlist { new DeezerImage(json.PARENT_USER_PICTURE, 'user') ); this.tracks = tracksJson.data.map((t) => new Track(t)); + this.library = library; } //Extend tracks @@ -159,15 +163,15 @@ class DeezerLibrary { break; case 'albums': this.count = json.albums.total; - this.data = json.albums.data.map((a) => new Album(a)); + this.data = json.albums.data.map((a) => new Album(a, {data: []}, true)); break; case 'artists': this.count = json.artists.total; - this.data = json.artists.data.map((a) => new Artist(a)); + this.data = json.artists.data.map((a) => new Artist(a, {data: []}, {data: []}, true)); break; case 'playlists': this.count = json.playlists.total; - this.data = json.playlists.data.map((p) => new Playlist(p)); + this.data = json.playlists.data.map((p) => new Playlist(p, {data: []}, true)); break; } } diff --git a/app/src/downloads.js b/app/src/downloads.js index 83cac04..153406f 100644 --- a/app/src/downloads.js +++ b/app/src/downloads.js @@ -480,6 +480,7 @@ class DownloadThread { '%0trackNumber%': (this.track.trackNumber ? this.track.trackNumber : 1).toString().padStart(2, '0'), '%album%': this.track.album.title, '%year%': date.getFullYear().toString(), + '%label%': (this.publicAlbum.label) ? this.publicAlbum.label : '' }; for (let k of Object.keys(props)) { fn = fn.replace(new RegExp(k, 'g'), sanitize(props[k])); diff --git a/package.json b/package.json index a87912c..8b39b6f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "freezer", "private": true, - "version": "1.1.3", + "version": "1.1.4", "description": "", "scripts": { "pack": "electron-builder --dir",