Fixed removing/adding to library, label tag

This commit is contained in:
exttex 2020-11-05 22:00:29 +01:00
parent 7eb047bae1
commit 416d65f310
38 changed files with 514 additions and 180 deletions

View File

@ -37,7 +37,7 @@
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
<!-- Add to library --> <!-- Add to library -->
<v-list-item dense @click='addLibrary'> <v-list-item dense @click='library' v-if='!album.library'>
<v-list-item-icon> <v-list-item-icon>
<v-icon>mdi-heart</v-icon> <v-icon>mdi-heart</v-icon>
</v-list-item-icon> </v-list-item-icon>
@ -45,6 +45,15 @@
<v-list-item-title>{{$t("Add to library")}}</v-list-item-title> <v-list-item-title>{{$t("Add to library")}}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
<!-- Remove from library -->
<v-list-item dense @click='library' v-if='album.library'>
<v-list-item-icon>
<v-icon>mdi-heart-remove</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{$t("Remove from library")}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<!-- Download --> <!-- Download -->
<v-list-item dense @click='download'> <v-list-item dense @click='download'>
<v-list-item-icon> <v-list-item-icon>
@ -134,9 +143,19 @@ export default {
}); });
this.$emit('clicked') this.$emit('clicked')
}, },
async addLibrary() { 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}`); await this.$axios.put(`/library/album?id=${this.album.id}`);
this.$root.globalSnackbar = this.$t('Added to library!'); this.$root.globalSnackbar = this.$t('Added to library!');
this.album.library = true;
}
}, },
//Add to downloads //Add to downloads
async download() { async download() {

View File

@ -18,7 +18,7 @@
</template> </template>
<v-list dense> <v-list dense>
<!-- Add library --> <!-- Add library -->
<v-list-item dense @click='addLibrary'> <v-list-item dense @click='library' v-if='!artist.library'>
<v-list-item-icon> <v-list-item-icon>
<v-icon>mdi-heart</v-icon> <v-icon>mdi-heart</v-icon>
</v-list-item-icon> </v-list-item-icon>
@ -26,6 +26,15 @@
<v-list-item-title>{{$t("Add to library")}}</v-list-item-title> <v-list-item-title>{{$t("Add to library")}}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
<!-- Remvoe from library -->
<v-list-item dense @click='library' v-if='artist.library'>
<v-list-item-icon>
<v-icon>mdi-heart-remove</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{$t("Remove from library")}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list> </v-list>
</v-menu> </v-menu>
@ -67,9 +76,19 @@ export default {
} }
}, },
methods: { methods: {
async addLibrary() { async library() {
await this.$axios.put(`/library/artist&id=${this.artist.id}`); 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.$root.globalSnackbar = this.$t('Added to library!');
this.artist.library = true;
}
}, },
click() { click() {
//Navigate to details //Navigate to details

View File

@ -5,8 +5,8 @@
<v-progress-circular indeterminate></v-progress-circular> <v-progress-circular indeterminate></v-progress-circular>
</v-overlay> </v-overlay>
<v-lazy max-height="100" v-for='album in albums' :key='album.id'> <v-lazy max-height="100" v-for='(album, index) in albums' :key='album.id'>
<AlbumTile :album='album'></AlbumTile> <AlbumTile :album='album' @remove='removed(index)'></AlbumTile>
</v-lazy> </v-lazy>
</v-list> </v-list>
@ -32,6 +32,9 @@ export default {
this.albums = res.data.data; this.albums = res.data.data;
} }
this.loading = false; this.loading = false;
},
removed(index) {
this.albums.splice(index, 1);
} }
}, },
components: { components: {

View File

@ -5,8 +5,8 @@
<v-progress-circular indeterminate></v-progress-circular> <v-progress-circular indeterminate></v-progress-circular>
</v-overlay> </v-overlay>
<v-lazy max-height="100" v-for='artist in artists' :key='artist.id'> <v-lazy max-height="100" v-for='(artist, index) in artists' :key='artist.id'>
<ArtistTile :artist='artist'></ArtistTile> <ArtistTile :artist='artist' @remove='removed(index)'></ArtistTile>
</v-lazy> </v-lazy>
</v-list> </v-list>
@ -35,6 +35,9 @@ export default {
this.artists = res.data.data; this.artists = res.data.data;
} }
this.loading = false; this.loading = false;
},
removed(index) {
this.artists.splice(index, 1);
} }
}, },
mounted() { mounted() {

View File

@ -36,13 +36,23 @@
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
<!-- Add to library -->
<v-list-item dense v-if='!canRemove && !playlist.library' @click='library'>
<v-list-item-icon>
<v-icon>mdi-heart</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{$t('Add to library')}}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<!-- Remove --> <!-- Remove -->
<v-list-item dense v-if='canRemove' @click='remove'> <v-list-item dense v-if='canRemove' @click='remove'>
<v-list-item-icon> <v-list-item-icon>
<v-icon>mdi-playlist-remove</v-icon> <v-icon>mdi-playlist-remove</v-icon>
</v-list-item-icon> </v-list-item-icon>
<v-list-item-content> <v-list-item-content>
<v-list-item-title>{{$t('Remove')}}</v-list-item-title> <v-list-item-title>{{$t('Remove from library')}}</v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
@ -157,12 +167,17 @@ export default {
} }
this.tracks = tracks; this.tracks = tracks;
this.downloadDialog = true; 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: { computed: {
canRemove() { canRemove() {
//Own playlist //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; return false;
} }
} }

View File

@ -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!": "تم حذف قائمة التشغيل!",
"Delete": "Delete",
"Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Zur Mediathek hinzufügen!", "Added to library!": "Zur Mediathek hinzufügen!",
"Removed from library!": "Aus der Mediathek entfernen!", "Removed from library!": "Aus der Mediathek entfernen!",
"Removed from playlist!": "Aus der Wiedergabeliste entfernt!", "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?"
} }

View File

@ -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!": "Η λίστα αναπαραγωγής διαγράφηκε!",
"Delete": "Delete",
"Are you sure you want to delete this playlist?": "Are you sure you want to delete this playlist?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -121,10 +121,12 @@
"Telegram Android Group": "Grupo de Android en Telegram", "Telegram Android Group": "Grupo de Android en Telegram",
"Credits:": "Créditos:", "Credits:": "Créditos:",
"Agree": "Acepto", "Agree": "Acepto",
"Dismiss": "Dismiss", "Dismiss": "Descartar",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "¡Añadido a la lista de reproducción!",
"Added to library!": "Added to library!", "Added to library!": "¡Agregado a la biblioteca!",
"Removed from library!": "Removed from library!", "Removed from library!": "¡Eliminado de la biblioteca!",
"Removed from playlist!": "Removed from playlist!", "Removed from playlist!": "¡Eliminado de la lista de reproducción!",
"Playlist deleted!": "Playlist deleted!" "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -25,7 +25,7 @@
"Create new playlist": "Gumawa ng bagong playlist", "Create new playlist": "Gumawa ng bagong playlist",
"TRACKS": "TRACKS", "TRACKS": "TRACKS",
"Sort by": "Sort by", "Sort by": "Sort by",
"Date Added": "Date Added", "Date Added": "Petsa kung kailan idinagdag",
"Name (A-Z)": "Name (A-Z)", "Name (A-Z)": "Name (A-Z)",
"Artist (A-Z)": "Artista (A-Z)", "Artist (A-Z)": "Artista (A-Z)",
"Album (A-Z)": "Album (A-Z)", "Album (A-Z)": "Album (A-Z)",
@ -60,7 +60,7 @@
"Clear queue": "Clear queue", "Clear queue": "Clear queue",
"Playing from": "Playing from", "Playing from": "Playing from",
"Info": "Info", "Info": "Info",
"Lyrics": "Lyrics", "Lyrics": "Liriko",
"Track number": "Track number", "Track number": "Track number",
"Disk number": "Disk number", "Disk number": "Disk number",
"Explicit": "Explicit", "Explicit": "Explicit",
@ -110,13 +110,13 @@
"Settings saved!": "Na-save ang settings!", "Settings saved!": "Na-save ang settings!",
"Available only in Electron version!": "Meron lamang sa Electron version!", "Available only in Electron version!": "Meron lamang sa Electron version!",
"Crossfade (ms)": "Crossfade (ms)", "Crossfade (ms)": "Crossfade (ms)",
"Select primary color": "Select primary color", "Select primary color": "Pumili ng pangunahing kulay",
"Light theme": "Light theme", "Light theme": "Maliwanag na tema",
"Create folders for playlists": "Create folders for playlists", "Create folders for playlists": "Gumawa ng folder para sa mga playlist",
"About": "About", "About": "About",
"Links:": "Links:", "Links:": "Links:",
"Telegram Releases": "Telegram Releases", "Telegram Releases": "Telegram Releases",
"Telegram Group": "Telegram Group", "Telegram Group": "Grupo sa Telegram",
"Discord": "Discord", "Discord": "Discord",
"Telegram Android Group": "Telegram Android Group", "Telegram Android Group": "Telegram Android Group",
"Credits:": "Credits:", "Credits:": "Credits:",
@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -9,9 +9,9 @@
"More": "Plus", "More": "Plus",
"Settings": "Paramètres", "Settings": "Paramètres",
"Downloads": "Téléchargements", "Downloads": "Téléchargements",
"Search or paste Deezer URL. Use / to quickly focus.": "Search or paste Deezer URL. Use \"/\" to quickly focus.", "Search or paste Deezer URL. Use / to quickly focus.": "Recherchez ou collez une URL Deezer. Utilisez \"/\" pour lancer rapidement la recherche.",
"Play": "Play", "Play": "Lire",
"Add to library": "Add to library", "Add to library": "Ajouter à la bibliothèque",
"Download": "Télécharger", "Download": "Télécharger",
"fans": "fans", "fans": "fans",
"tracks": "pistes", "tracks": "pistes",
@ -19,8 +19,8 @@
"Estimated size:": "Durée estimée:", "Estimated size:": "Durée estimée:",
"Start downloading": "Lancer le téléchargement", "Start downloading": "Lancer le téléchargement",
"Cancel": "Annuler", "Cancel": "Annuler",
"Stream logging is disabled!": "Stream logging is disabled!", "Stream logging is disabled!": "La journalisation du stream est désactivée !",
"Enable it in settings for history to work properly.": "Enable it in settings for history to work properly.", "Enable it in settings for history to work properly.": "Activez-le dans les paramètres pour que l'historique fonctionne correctement.",
"History": "Historique", "History": "Historique",
"Create new playlist": "Créer une nouvelle playlist", "Create new playlist": "Créer une nouvelle playlist",
"TRACKS": "PISTES", "TRACKS": "PISTES",
@ -29,44 +29,44 @@
"Name (A-Z)": "Nom (A-Z)", "Name (A-Z)": "Nom (A-Z)",
"Artist (A-Z)": "Artiste (A-Z)", "Artist (A-Z)": "Artiste (A-Z)",
"Album (A-Z)": "Album (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 playlist": "Créer une playlist",
"Create": "Créer", "Create": "Créer",
"Add to playlist": "Ajouter à une playlist", "Add to playlist": "Ajouter à une playlist",
"Create new": "Create new", "Create new": "Créer un nouveau",
"Remove": "Supprimer", "Remove": "Supprimer",
"Play next": "Play next", "Play next": "Lire juste après",
"Add to queue": "Ajouter à la file d'attente", "Add to queue": "Ajouter à la file d'attente",
"Remove from library": "Supprimer de la bibliothèque", "Remove from library": "Supprimer de la bibliothèque",
"Remove from playlist": "Supprimer de la playlist", "Remove from playlist": "Supprimer de la playlist",
"Play track mix": "Play track mix", "Play track mix": "Jouer un mélange de pistes",
"Go to": "Go to", "Go to": "Aller à",
"Track Mix": "Track Mix", "Track Mix": "Mélange de piste",
"Duration": "Durée", "Duration": "Durée",
"Released": "Released", "Released": "Publié",
"Disk": "Disque", "Disk": "Disque",
"albums": "albums", "albums": "albums",
"Play top": "Play top", "Play top": "Lire en haut",
"Radio": "Radio", "Radio": "Radio",
"Show all albums": "Afficher tous les albums", "Show all albums": "Afficher tous les albums",
"Show all singles": "Afficher tous les singles", "Show all singles": "Afficher tous les singles",
"Show more": "Afficher plus", "Show more": "Afficher plus",
"Downloaded": "Téléchargés", "Downloaded": "Téléchargés",
"Queue": "Queue", "Queue": "File d'attente",
"Total": "Total", "Total": "Total",
"Stop": "Arrêter", "Stop": "Arrêter",
"Start": "Start", "Start": "Début",
"Show folder": "Afficher le dossier", "Show folder": "Afficher le dossier",
"Clear queue": "Clear queue", "Clear queue": "Effacer la liste d'attente",
"Playing from": "Playing from", "Playing from": "Lecture depuis",
"Info": "Info", "Info": "Infos",
"Lyrics": "Lyrics", "Lyrics": "Paroles",
"Track number": "Track number", "Track number": "Numéro de piste",
"Disk number": "Disk number", "Disk number": "Numéro de disque",
"Explicit": "Explicit", "Explicit": "Explicite",
"Source": "Source", "Source": "Source",
"ID": "ID", "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.", "Please try again later, or try another account.": "Veuillez réessayer plus tard, ou essayez avec un autre compte.",
"Logout": "Déconnexion", "Logout": "Déconnexion",
"Login using browser": "Connexion via navigateur", "Login using browser": "Connexion via navigateur",
@ -74,57 +74,59 @@
"...or paste your ARL/Token below:": "...ou copiez votre ARL/Token ici:", "...or paste your ARL/Token below:": "...ou copiez votre ARL/Token ici:",
"ARL/Token": "ARL/Token", "ARL/Token": "ARL/Token",
"Login": "Connexion", "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 !", "Only in Electron version!": "Uniquement en version Electron !",
"Search results for:": "Résultats de la recherche pour:", "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 !", "Try again later!": "Réessayez plus tard !",
"Search": "Recherche", "Search": "Recherche",
"Streaming Quality": "Qualité en streaming", "Streaming Quality": "Qualité en streaming",
"Download Quality": "Qualité de téléchargement", "Download Quality": "Qualité de téléchargement",
"Downloads Directory": "Chemin de sauvegarde", "Downloads Directory": "Chemin de sauvegarde",
"Simultaneous downloads": "Limite téléchargements simultanés", "Simultaneous downloads": "Limite téléchargements simultanés",
"Always show download confirm dialog before downloading.": "Always show download confirm dialog before downloading.", "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": "Show download dialog", "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 artists": "Générer des dossiers par artiste",
"Create folders for albums": "Générer des dossiers par album", "Create folders for albums": "Générer des dossiers par album",
"Download lyrics": "Télécharger les paroles", "Download lyrics": "Télécharger les paroles",
"Variables": "Variables", "Variables": "Variables",
"UI": "Interface", "UI": "Interface",
"Show autocomplete in search": "Show autocomplete in search", "Show autocomplete in search": "Afficher la saisie automatique dans la recherche",
"Integrations": "Intégrations", "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.", "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": "Log track listens to Deezer", "Log track listens to Deezer": "Journaliser la piste écoutée sur Deezer",
"Connect your LastFM account to allow scrobbling.": "Connect your LastFM account to allow scrobbling.", "Connect your LastFM account to allow scrobbling.": "Connectez votre compte LastFM pour autoriser le scrobbling.",
"Login with LastFM": "Login with LastFM", "Login with LastFM": "Se connecter avec LastFM",
"Disconnect LastFM": "Disconnect LastFM", "Disconnect LastFM": "Déconnecté LastFM",
"Requires restart to apply!": "Redémarrage nécessaire pour prendre effet !", "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 !", "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 !", "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", "Discord Join Button": "Bouton rejoindre sur Discord",
"Other": "Autre", "Other": "Autre",
"Minimize to tray": "Réduire dans la zone de notification", "Minimize to tray": "Réduire dans la zone de notification",
"Don't minimize to tray": "Ne pas 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 !", "Settings saved!": "Paramètres sauvegardés !",
"Available only in Electron version!": "Uniquement disponible en version Electron !", "Available only in Electron version!": "Uniquement disponible en version Electron !",
"Crossfade (ms)": "Crossfade (ms)", "Crossfade (ms)": "Fondu enchaîné (ms)",
"Select primary color": "Select primary color", "Select primary color": "Sélectionner la couleur principale",
"Light theme": "Light theme", "Light theme": "Thème clair",
"Create folders for playlists": "Create folders for playlists", "Create folders for playlists": "Créer des dossiers par playlist",
"About": "About", "About": "À propos",
"Links:": "Links:", "Links:": "Liens:",
"Telegram Releases": "Telegram Releases", "Telegram Releases": "Publications Telegram",
"Telegram Group": "Telegram Group", "Telegram Group": "Groupe Telegram",
"Discord": "Discord", "Discord": "Discord",
"Telegram Android Group": "Telegram Android Group", "Telegram Android Group": "Groupe Telegram Android",
"Credits:": "Credits:", "Credits:": "Crédits:",
"Agree": "Agree", "Agree": "Accepter",
"Dismiss": "Dismiss", "Dismiss": "Cacher",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "Ajouté à la playlist !",
"Added to library!": "Added to library!", "Added to library!": "Ajouté à la bibliothèque !",
"Removed from library!": "Removed from library!", "Removed from library!": "Supprimé de la bibliothèque !",
"Removed from playlist!": "Removed from playlist!", "Removed from playlist!": "Supprimé de la playlist !",
"Playlist deleted!": "Playlist deleted!" "Playlist deleted!": "Playlist supprimée !",
"Delete": "Supprimer",
"Are you sure you want to delete this playlist?": "Voulez-vous vraiment supprimer cette liste de lecture ?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -9,36 +9,36 @@
"More": "Továbbiak", "More": "Továbbiak",
"Settings": "Beállítások", "Settings": "Beállítások",
"Downloads": "Letöltések", "Downloads": "Letöltések",
"Search or paste Deezer URL. Use / to quickly focus.": "Search or paste Deezer URL. Use \"/\" to quickly focus.", "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": "Play", "Play": "Lejátszás",
"Add to library": "Add to library", "Add to library": "Hozzáadás a könyvtárhoz",
"Download": "Download", "Download": "Letöltés",
"fans": "fans", "fans": "rajongók",
"tracks": "tracks", "tracks": "dalok",
"Quality": "Quality", "Quality": "Minőség",
"Estimated size:": "Estimated size:", "Estimated size:": "Becsült fájl méret:",
"Start downloading": "Start downloading", "Start downloading": "Letöltés indítása",
"Cancel": "Cancel", "Cancel": "Mégse",
"Stream logging is disabled!": "Stream logging is disabled!", "Stream logging is disabled!": "Stream naplózás le van tiltva!",
"Enable it in settings for history to work properly.": "Enable it in settings for history to work properly.", "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": "History", "History": "Előzmények",
"Create new playlist": "Create new playlist", "Create new playlist": "Új lejátszási lista létrehozása",
"TRACKS": "TRACKS", "TRACKS": "DALOK",
"Sort by": "Sort by", "Sort by": "Rendezési elv",
"Date Added": "Date Added", "Date Added": "Hozzáadás dátuma",
"Name (A-Z)": "Name (A-Z)", "Name (A-Z)": "Név (A-Z)",
"Artist (A-Z)": "Artist (A-Z)", "Artist (A-Z)": "Előadó (A-Z)",
"Album (A-Z)": "Album (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!": "Hiba a dalszöveg betöltésekor, vagy nem található dalszöveg!",
"Create playlist": "Create playlist", "Create playlist": "Lejátszási lista létrehozása",
"Create": "Create", "Create": "Létrehozás",
"Add to playlist": "Add to playlist", "Add to playlist": "Hozzáadás a lejátszási listához",
"Create new": "Create new", "Create new": "Új létrehozása",
"Remove": "Remove", "Remove": "Eltávolítás",
"Play next": "Play next", "Play next": "Következő lejátszása",
"Add to queue": "Add to queue", "Add to queue": "Hozzáadás a várólistához",
"Remove from library": "Remove from library", "Remove from library": "Eltávolítás a könyvtárból",
"Remove from playlist": "Remove from playlist", "Remove from playlist": "Eltávolítás a lejátszási listáról",
"Play track mix": "Play track mix", "Play track mix": "Play track mix",
"Go to": "Go to", "Go to": "Go to",
"Track Mix": "Track Mix", "Track Mix": "Track Mix",
@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -121,10 +121,12 @@
"Telegram Android Group": "Telegram Grub Android", "Telegram Android Group": "Telegram Grub Android",
"Credits:": "Kredit:", "Credits:": "Kredit:",
"Agree": "Setuju", "Agree": "Setuju",
"Dismiss": "Dismiss", "Dismiss": "Abaikan",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "Ditambahkan ke daftar putar!",
"Added to library!": "Added to library!", "Added to library!": "Ditambahkan ke koleksi!",
"Removed from library!": "Removed from library!", "Removed from library!": "Dihapus dari koleksi!",
"Removed from playlist!": "Removed from playlist!", "Removed from playlist!": "Dihapus dari daftar putar!",
"Playlist deleted!": "Playlist deleted!" "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -121,10 +121,12 @@
"Telegram Android Group": "Grupa Telegram dla wydań na Android", "Telegram Android Group": "Grupa Telegram dla wydań na Android",
"Credits:": "Twórcy:", "Credits:": "Twórcy:",
"Agree": "Akceptuję", "Agree": "Akceptuję",
"Dismiss": "Dismiss", "Dismiss": "Odrzuć",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "Dodano do playlisty!",
"Added to library!": "Added to library!", "Added to library!": "Dodano do biblioteki!",
"Removed from library!": "Removed from library!", "Removed from library!": "Usunięto z biblioteki!",
"Removed from playlist!": "Removed from playlist!", "Removed from playlist!": "Usunięto z playlisty!",
"Playlist deleted!": "Playlist deleted!" "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -110,21 +110,23 @@
"Settings saved!": "Настройки сохранены!", "Settings saved!": "Настройки сохранены!",
"Available only in Electron version!": "Доступно только в версии на Electron!", "Available only in Electron version!": "Доступно только в версии на Electron!",
"Crossfade (ms)": "Кроссфейд (мс)", "Crossfade (ms)": "Кроссфейд (мс)",
"Select primary color": "Select primary color", "Select primary color": "Выберите основной цвет",
"Light theme": "Light theme", "Light theme": "Светлая тема",
"Create folders for playlists": "Create folders for playlists", "Create folders for playlists": "Создавать папки для плейлистов",
"About": "About", "About": "О приложении",
"Links:": "Links:", "Links:": "Ссылки:",
"Telegram Releases": "Telegram Releases", "Telegram Releases": "Релизы в Telegram",
"Telegram Group": "Telegram Group", "Telegram Group": "Группа в Telegram",
"Discord": "Discord", "Discord": "Discord",
"Telegram Android Group": "Telegram Android Group", "Telegram Android Group": "Обсуждение Freezer Android",
"Credits:": "Credits:", "Credits:": "Благодарность:",
"Agree": "Agree", "Agree": "Agree",
"Dismiss": "Dismiss", "Dismiss": "Dismiss",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "Added to playlist!",
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -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?"
}

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -46,7 +46,7 @@
"Released": "Реліз", "Released": "Реліз",
"Disk": "Диск", "Disk": "Диск",
"albums": "альбоми", "albums": "альбоми",
"Play top": "Грати зверху", "Play top": "Відтворити top",
"Radio": "Радіо", "Radio": "Радіо",
"Show all albums": "Показати всі альбоми", "Show all albums": "Показати всі альбоми",
"Show all singles": "Показати всі композиції", "Show all singles": "Показати всі композиції",
@ -109,7 +109,7 @@
"Close on exit": "Закрити при виході", "Close on exit": "Закрити при виході",
"Settings saved!": "Налаштування збережено!", "Settings saved!": "Налаштування збережено!",
"Available only in Electron version!": "Доступно лише в Electron версії!", "Available only in Electron version!": "Доступно лише в Electron версії!",
"Crossfade (ms)": ерехресне затухання (мс)", "Crossfade (ms)": лавний перехід (мс)",
"Select primary color": "Вибрати основний колір", "Select primary color": "Вибрати основний колір",
"Light theme": "Світла тема", "Light theme": "Світла тема",
"Create folders for playlists": "Створити теки для плейлистів", "Create folders for playlists": "Створити теки для плейлистів",
@ -121,10 +121,12 @@
"Telegram Android Group": "Група Android в Telegram", "Telegram Android Group": "Група Android в Telegram",
"Credits:": "Автори:", "Credits:": "Автори:",
"Agree": "Погоджуюсь", "Agree": "Погоджуюсь",
"Dismiss": "Dismiss", "Dismiss": "Відхилити",
"Added to playlist!": "Added to playlist!", "Added to playlist!": "Додано до плейлиста!",
"Added to library!": "Added to library!", "Added to library!": "Додано до бібліотеки!",
"Removed from library!": "Removed from library!", "Removed from library!": "Видалено з бібліотеки!",
"Removed from playlist!": "Removed from playlist!", "Removed from playlist!": "Видалено з плейлиста!",
"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?"
} }

View File

@ -126,5 +126,7 @@
"Added to library!": "Added to library!", "Added to library!": "Added to library!",
"Removed from library!": "Removed from library!", "Removed from library!": "Removed from library!",
"Removed from playlist!": "Removed from playlist!", "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?"
} }

View File

@ -321,6 +321,13 @@ new Vue({
await this.savePlaybackInfo(); await this.savePlaybackInfo();
return; return;
} }
//End of queue
if (this.queue.index+1 == this.queue.data.length) {
this.state = 1;
return;
}
//Skip to next track //Skip to next track
this.skip(1); this.skip(1);
this.savePlaybackInfo(); this.savePlaybackInfo();

View File

@ -143,7 +143,6 @@ export default {
}, },
created() { created() {
this.$axios.get('/about').then((res) => { this.$axios.get('/about').then((res) => {
console.log(res);
this.data = res.data; this.data = res.data;
}); });
} }

View File

@ -32,8 +32,14 @@
{{$t("Play")}} {{$t("Play")}}
</v-btn> </v-btn>
<v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading'> <v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading'>
<div v-if='!album.library'>
<v-icon left>mdi-heart</v-icon> <v-icon left>mdi-heart</v-icon>
{{$t("Library")}} {{$t("Library")}}
</div>
<div v-if='album.library'>
<v-icon left>mdi-heart-remove</v-icon>
{{$t("Remove")}}
</div>
</v-btn> </v-btn>
<v-btn color='green' class='mx-1' @click='download'> <v-btn color='green' class='mx-1' @click='download'>
<v-icon left>mdi-download</v-icon> <v-icon left>mdi-download</v-icon>
@ -103,9 +109,18 @@ export default {
//Add to library //Add to library
async library() { async library() {
this.libraryLoading = true; this.libraryLoading = true;
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}`); await this.$axios.put(`/library/album?id=${this.album.id}`);
this.libraryLoading = false;
this.$root.globalSnackbar = this.$t('Added to library!'); this.$root.globalSnackbar = this.$t('Added to library!');
this.album.library = true;
}
this.libraryLoading = false;
}, },
async download() { async download() {
this.downloadDialog = true; this.downloadDialog = true;
@ -123,7 +138,10 @@ export default {
this.loading = true; this.loading = true;
let data = await this.$axios.get(`/album/${this.album.id}`); let data = await this.$axios.get(`/album/${this.album.id}`);
if (data && data.data && data.data.tracks) { if (data && data.data && data.data.tracks) {
//Preserve library
let library = this.album.library;
this.album = data.data; this.album = data.data;
this.album.library = library;
} }
this.loading = false; this.loading = false;
} }

View File

@ -26,8 +26,15 @@
{{$t("Play top")}} {{$t("Play top")}}
</v-btn> </v-btn>
<v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading'> <v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading'>
<div v-if='!artist.library'>
<v-icon left>mdi-heart</v-icon> <v-icon left>mdi-heart</v-icon>
{{$t("Library")}} {{$t("Library")}}
</div>
<div v-if='artist.library'>
<v-icon left>mdi-heart-remove</v-icon>
{{$t("Remove")}}
</div>
</v-btn> </v-btn>
<v-btn color='green' class='mx-1' @click='radio' v-if='artist.radio'> <v-btn color='green' class='mx-1' @click='radio' v-if='artist.radio'>
<v-icon left>mdi-radio</v-icon> <v-icon left>mdi-radio</v-icon>
@ -150,8 +157,17 @@ export default {
//Add to library //Add to library
async library() { async library() {
this.libraryLoading = true; this.libraryLoading = true;
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}`); await this.$axios.put(`/library/artist?id=${this.artist.id}`);
this.$root.globalSnackbar = this.$t('Added to library!'); this.$root.globalSnackbar = this.$t('Added to library!');
this.artist.library = true;
}
this.libraryLoading = false; this.libraryLoading = false;
}, },
async load() { async load() {
@ -160,7 +176,10 @@ export default {
this.loading = true; this.loading = true;
let data = await this.$axios.get(`/artist/${this.artist.id}`); let data = await this.$axios.get(`/artist/${this.artist.id}`);
if (data && data.data && data.data.topTracks) { if (data && data.data && data.data.topTracks) {
//Preserve library
let library = this.artist.library;
this.artist = data.data; this.artist = data.data;
this.artist.library = library;
} }
this.loading = false; this.loading = false;
} }

View File

@ -22,19 +22,29 @@
<span class='text-subtitle-2'>{{$numberString(playlist.fans)}} {{$t('fans')}}</span><br> <span class='text-subtitle-2'>{{$numberString(playlist.fans)}} {{$t('fans')}}</span><br>
</div> </div>
<div class='my-1'> <div class='my-2'>
<v-btn color='primary' class='mr-1' @click='play'> <v-btn color='primary' class='mr-1' @click='play'>
<v-icon left>mdi-play</v-icon> <v-icon left>mdi-play</v-icon>
{{$t('Play')}} {{$t('Play')}}
</v-btn> </v-btn>
<v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading'> <v-btn color='red' class='mx-1' @click='library' :loading='libraryLoading' v-if='!isOwn'>
<div v-if='!playlist.library'>
<v-icon left>mdi-heart</v-icon> <v-icon left>mdi-heart</v-icon>
{{$t('Library')}} {{$t('Library')}}
</div>
<div v-if='playlist.library'>
<v-icon left>mdi-heart-remove</v-icon>
{{$t('Remove')}}
</div>
</v-btn> </v-btn>
<v-btn color='green' class='mx-1' @click='download'> <v-btn color='green' class='mx-1' @click='download'>
<v-icon left>mdi-download</v-icon> <v-icon left>mdi-download</v-icon>
{{$t('Download')}} {{$t('Download')}}
</v-btn> </v-btn>
<v-btn color='red' class='mx-1' v-if='isOwn' @click='deleteDialog = true'>
<v-icon left>mdi-delete</v-icon>
{{$t('Delete')}}
</v-btn>
</div> </div>
</div> </div>
</v-card> </v-card>
@ -57,6 +67,23 @@
<DownloadDialog :playlistName='playlist.title' :tracks='playlist.tracks' v-if='downloadDialog' @close='downloadDialog = false'></DownloadDialog> <DownloadDialog :playlistName='playlist.title' :tracks='playlist.tracks' v-if='downloadDialog' @close='downloadDialog = false'></DownloadDialog>
<!-- Delete playlist -->
<v-dialog v-model='deleteDialog' max-width='256px'>
<v-card>
<v-card-title>
{{$t("Delete")}}
</v-card-title>
<v-card-text>
{{$t("Are you sure you want to delete this playlist?")}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click='deleteDialog = false' class='mx-2'>{{$t("Cancel")}}</v-btn>
<v-btn text color='red' @click='deleteDialog = false; deletePlaylist();'>{{$t("Delete")}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-list> </v-list>
</template> </template>
@ -70,7 +97,7 @@ export default {
TrackTile, DownloadDialog TrackTile, DownloadDialog
}, },
props: { props: {
playlistData: Object playlistData: Object,
}, },
data() { data() {
return { return {
@ -81,7 +108,8 @@ export default {
loadingTracks: false, loadingTracks: false,
//Add to library button //Add to library button
libraryLoading: false, libraryLoading: false,
downloadDialog: false downloadDialog: false,
deleteDialog: false
} }
}, },
methods: { methods: {
@ -139,9 +167,18 @@ export default {
}, },
async library() { async library() {
this.libraryLoading = true; this.libraryLoading = true;
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}`); await this.$axios.put(`/library/playlist?id=${this.playlist.id}`);
this.libraryLoading = false;
this.$root.globalSnackbar = this.$t('Added to library!'); this.$root.globalSnackbar = this.$t('Added to library!');
this.playlist.library = true;
}
this.libraryLoading = false;
}, },
async initialLoad() { async initialLoad() {
@ -150,7 +187,10 @@ export default {
this.loading = true; this.loading = true;
let data = await this.$axios.get(`/playlist/${this.playlist.id}?start=0`); let data = await this.$axios.get(`/playlist/${this.playlist.id}?start=0`);
if (data && data.data && data.data.tracks) { if (data && data.data && data.data.tracks) {
//Preserve library state
let inLib = this.playlist.library;
this.playlist = data.data; this.playlist = data.data;
this.playlist.library = inLib;
} }
this.loading = false; this.loading = false;
} }
@ -165,11 +205,21 @@ export default {
await this.loadAllTracks(); await this.loadAllTracks();
} }
this.downloadDialog = true; this.downloadDialog = true;
},
async deletePlaylist() {
await this.$axios.delete(`/playlist/${this.playlist.id}`);
this.$router.go(-1);
} }
}, },
mounted() { mounted() {
this.initialLoad(); this.initialLoad();
}, },
computed: {
isOwn() {
if (this.$root.profile.id == this.playlist.user.id) return true;
return false;
}
},
watch: { watch: {
//Reload on playlist change from drawer //Reload on playlist change from drawer
playlistData(n, o) { playlistData(n, o) {

View File

@ -96,7 +96,7 @@
label='Download Filename' label='Download Filename'
persistent-hint persistent-hint
v-model='$root.settings.downloadFilename' 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%"'
></v-text-field> ></v-text-field>
<!-- Crossfade --> <!-- Crossfade -->
@ -301,6 +301,7 @@ export default {
{code: 'pt', name: 'Portuguese'}, {code: 'pt', name: 'Portuguese'},
{code: 'ro', name: 'Romanian'}, {code: 'ro', name: 'Romanian'},
{code: 'ru', name: 'Russian'}, {code: 'ru', name: 'Russian'},
{code: 'sk', name: 'Slovak'},
{code: 'es', name: 'Spanish'}, {code: 'es', name: 'Spanish'},
{code: 'tr', name: 'Turkish'}, {code: 'tr', name: 'Turkish'},
{code: 'uk', name: 'Ukrainian'} {code: 'uk', name: 'Ukrainian'}

View File

@ -1,7 +1,7 @@
{ {
"name": "freezer", "name": "freezer",
"private": true, "private": true,
"version": "1.1.3", "version": "1.1.4",
"description": "", "description": "",
"main": "background.js", "main": "background.js",
"scripts": { "scripts": {

View File

@ -41,7 +41,7 @@ class Track {
} }
class Album { class Album {
constructor(json, tracksJson = {data: []}) { constructor(json, tracksJson = {data: []}, library = false) {
this.id = json.ALB_ID.toString(); this.id = json.ALB_ID.toString();
this.title = json.ALB_TITLE; this.title = json.ALB_TITLE;
this.art = new DeezerImage(json.ALB_PICTURE); this.art = new DeezerImage(json.ALB_PICTURE);
@ -65,11 +65,13 @@ class Album {
//Helpers //Helpers
this.artistString = this.artists.map((a) => a.name).join(', '); this.artistString = this.artists.map((a) => a.name).join(', ');
this.library = library;
} }
} }
class Artist { class Artist {
constructor(json, albumsJson = {data: []}, topJson = {data: []}) { constructor(json, albumsJson = {data: []}, topJson = {data: []}, library = false) {
this.id = json.ART_ID.toString(); this.id = json.ART_ID.toString();
this.name = json.ART_NAME; this.name = json.ART_NAME;
this.fans = json.NB_FAN; this.fans = json.NB_FAN;
@ -78,11 +80,12 @@ class Artist {
this.albums = albumsJson.data.map((a) => new Album(a)); this.albums = albumsJson.data.map((a) => new Album(a));
this.topTracks = topJson.data.map((t) => new Track(t)); this.topTracks = topJson.data.map((t) => new Track(t));
this.radio = json.SMARTRADIO; this.radio = json.SMARTRADIO;
this.library = library;
} }
} }
class Playlist { class Playlist {
constructor(json, tracksJson = {data: []}) { constructor(json, tracksJson = {data: []}, library = false) {
this.id = json.PLAYLIST_ID.toString(), this.id = json.PLAYLIST_ID.toString(),
this.title = json.TITLE, this.title = json.TITLE,
this.trackCount = json.NB_SONG ? json.NB_SONG : tracksJson.total; this.trackCount = json.NB_SONG ? json.NB_SONG : tracksJson.total;
@ -96,6 +99,7 @@ class Playlist {
new DeezerImage(json.PARENT_USER_PICTURE, 'user') new DeezerImage(json.PARENT_USER_PICTURE, 'user')
); );
this.tracks = tracksJson.data.map((t) => new Track(t)); this.tracks = tracksJson.data.map((t) => new Track(t));
this.library = library;
} }
//Extend tracks //Extend tracks
@ -159,15 +163,15 @@ class DeezerLibrary {
break; break;
case 'albums': case 'albums':
this.count = json.albums.total; 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; break;
case 'artists': case 'artists':
this.count = json.artists.total; 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; break;
case 'playlists': case 'playlists':
this.count = json.playlists.total; 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; break;
} }
} }

View File

@ -480,6 +480,7 @@ class DownloadThread {
'%0trackNumber%': (this.track.trackNumber ? this.track.trackNumber : 1).toString().padStart(2, '0'), '%0trackNumber%': (this.track.trackNumber ? this.track.trackNumber : 1).toString().padStart(2, '0'),
'%album%': this.track.album.title, '%album%': this.track.album.title,
'%year%': date.getFullYear().toString(), '%year%': date.getFullYear().toString(),
'%label%': (this.publicAlbum.label) ? this.publicAlbum.label : ''
}; };
for (let k of Object.keys(props)) { for (let k of Object.keys(props)) {
fn = fn.replace(new RegExp(k, 'g'), sanitize(props[k])); fn = fn.replace(new RegExp(k, 'g'), sanitize(props[k]));

View File

@ -1,7 +1,7 @@
{ {
"name": "freezer", "name": "freezer",
"private": true, "private": true,
"version": "1.1.3", "version": "1.1.4",
"description": "", "description": "",
"scripts": { "scripts": {
"pack": "electron-builder --dir", "pack": "electron-builder --dir",