From aa3127167b3ad4c46862695085387de7aa5c8261 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Sat, 3 Jun 2023 18:52:17 +0200 Subject: [PATCH] [web] Beautify code The source code has been beautified to follow the coding standards. --- web-src/src/components/ListAlbums.vue | 4 +++- web-src/src/filter/index.js | 8 ++++++-- web-src/src/i18n.js | 2 +- web-src/src/locales/de.json | 4 ++-- web-src/src/locales/fr.json | 2 +- web-src/src/pages/PageNowPlaying.vue | 7 +++---- web-src/src/pages/PagePodcast.vue | 14 +++++++++----- web-src/src/pages/SettingsPageWebinterface.vue | 6 +++--- web-src/src/store/index.js | 2 +- 9 files changed, 29 insertions(+), 20 deletions(-) diff --git a/web-src/src/components/ListAlbums.vue b/web-src/src/components/ListAlbums.vue index 965925c7..4a729baa 100644 --- a/web-src/src/components/ListAlbums.vue +++ b/web-src/src/components/ListAlbums.vue @@ -146,7 +146,9 @@ export default { .library_album_tracks(this.selected_album.id, { limit: 1 }) .then(({ data }) => { webapi.library_track_playlists(data.items[0].id).then(({ data }) => { - this.rss_playlist_to_remove = data.items.filter((pl) => pl.type === 'rss')[0] + this.rss_playlist_to_remove = data.items.filter( + (pl) => pl.type === 'rss' + )[0] this.show_remove_podcast_modal = true this.show_details_modal = false }) diff --git a/web-src/src/filter/index.js b/web-src/src/filter/index.js index 14db17dc..4bfb33de 100644 --- a/web-src/src/filter/index.js +++ b/web-src/src/filter/index.js @@ -34,11 +34,15 @@ export const filters = { }, date: function (value) { - return DateTime.fromISO(value).setLocale(locale.value).toLocaleString(DateTime.DATE_FULL) + return DateTime.fromISO(value) + .setLocale(locale.value) + .toLocaleString(DateTime.DATE_FULL) }, datetime: function (value) { - return DateTime.fromISO(value).setLocale(locale.value).toLocaleString(DateTime.DATETIME_MED) + return DateTime.fromISO(value) + .setLocale(locale.value) + .toLocaleString(DateTime.DATETIME_MED) }, timeFromNow: function (value) { diff --git a/web-src/src/i18n.js b/web-src/src/i18n.js index 25bcfa5c..08aa0e51 100644 --- a/web-src/src/i18n.js +++ b/web-src/src/i18n.js @@ -9,7 +9,7 @@ import messages from '@intlify/vite-plugin-vue-i18n/messages' export default createI18n({ legacy: false, globalInjection: true, - availableLocales: ('de','en','fr'), + availableLocales: ('de', 'en', 'fr'), locale: navigator.language, fallbackLocale: 'en', fallbackWarn: false, diff --git a/web-src/src/locales/de.json b/web-src/src/locales/de.json index ef8e74ba..32b87ff8 100644 --- a/web-src/src/locales/de.json +++ b/web-src/src/locales/de.json @@ -194,7 +194,7 @@ "info-1": "Diesen Podcast dauerhaft aus der Bibliothek löschen?", "info-2": "Dies wir auch RSS-Playlisten löschen ", "remove": "Entfernen", - "remove-podcast":"Entferne podcast" + "remove-podcast": "Entferne podcast" }, "spotify": { "not-playable-track": "Track kann nicht gespielt werden", @@ -381,7 +381,7 @@ "remove": "Entfernen", "remove-info-1": "Diesen Podcast wirklich dauerhaft aus der Bibliothek löschen?", "remove-info-2": "Damit wird auch die RSS-Playliste gelöscht. ", - "remove-podcast":"Entferne podcast", + "remove-podcast": "Entferne podcast", "track-count": "{count} Tracks" }, "podcasts": { diff --git a/web-src/src/locales/fr.json b/web-src/src/locales/fr.json index 102e4139..80938496 100644 --- a/web-src/src/locales/fr.json +++ b/web-src/src/locales/fr.json @@ -381,7 +381,7 @@ "remove": "Supprimer", "remove-info-1": "Supprimer ce podcast de manière permanente de la bibliothèque ?", "remove-info-2": "Cela supprimera également la liste de lecture RSS ", - "remove-podcast":"Supprimer le podcast", + "remove-podcast": "Supprimer le podcast", "track-count": "{count} pistes" }, "podcasts": { diff --git a/web-src/src/pages/PageNowPlaying.vue b/web-src/src/pages/PageNowPlaying.vue index c6400159..202da7dc 100644 --- a/web-src/src/pages/PageNowPlaying.vue +++ b/web-src/src/pages/PageNowPlaying.vue @@ -49,9 +49,9 @@ v-text="composer" />

-

@@ -147,10 +147,9 @@ export default { return this.now_playing.path } return null - } + } }, - watch: { state() { if (this.interval_id > 0) { diff --git a/web-src/src/pages/PagePodcast.vue b/web-src/src/pages/PagePodcast.vue index fb917b80..b6ee4b5d 100644 --- a/web-src/src/pages/PagePodcast.vue +++ b/web-src/src/pages/PagePodcast.vue @@ -121,11 +121,15 @@ export default { }, open_remove_podcast_dialog: function () { - webapi.library_track_playlists(this.tracks.items[0].id).then(({ data }) => { - this.rss_playlist_to_remove = data.items.filter((pl) => pl.type === 'rss')[0] - this.show_remove_podcast_modal = true - this.show_details_modal = false - }) + webapi + .library_track_playlists(this.tracks.items[0].id) + .then(({ data }) => { + this.rss_playlist_to_remove = data.items.filter( + (pl) => pl.type === 'rss' + )[0] + this.show_remove_podcast_modal = true + this.show_details_modal = false + }) }, remove_podcast: function () { diff --git a/web-src/src/pages/SettingsPageWebinterface.vue b/web-src/src/pages/SettingsPageWebinterface.vue index f47e22af..4decc9aa 100644 --- a/web-src/src/pages/SettingsPageWebinterface.vue +++ b/web-src/src/pages/SettingsPageWebinterface.vue @@ -208,13 +208,13 @@ export default { locale: { get() { let languages = this.$i18n.availableLocales - let locale = languages.find(lang => lang === this.$i18n.locale) + let locale = languages.find((lang) => lang === this.$i18n.locale) let partial = this.$i18n.locale.split('-')[0] if (!locale) { - locale = languages.find(lang => lang === partial) + locale = languages.find((lang) => lang === partial) } if (!locale) { - locale = languages.forEach(lang => lang.split('-')[0] === partial) + locale = languages.forEach((lang) => lang.split('-')[0] === partial) } return locale }, diff --git a/web-src/src/store/index.js b/web-src/src/store/index.js index 475f3f25..e21dfb43 100644 --- a/web-src/src/store/index.js +++ b/web-src/src/store/index.js @@ -133,7 +133,7 @@ export default createStore({ } return false }, - + settings_category: (state) => (categoryName) => { return state.settings.categories.find( (elem) => elem.name === categoryName