[web] Beautify code

The source code has been beautified to follow the coding standards.
This commit is contained in:
Alain Nussbaumer 2023-06-03 18:52:17 +02:00
parent 025a1c73a8
commit aa3127167b
9 changed files with 29 additions and 20 deletions

View File

@ -146,7 +146,9 @@ export default {
.library_album_tracks(this.selected_album.id, { limit: 1 }) .library_album_tracks(this.selected_album.id, { limit: 1 })
.then(({ data }) => { .then(({ data }) => {
webapi.library_track_playlists(data.items[0].id).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_remove_podcast_modal = true
this.show_details_modal = false this.show_details_modal = false
}) })

View File

@ -34,11 +34,15 @@ export const filters = {
}, },
date: function (value) { 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) { 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) { timeFromNow: function (value) {

View File

@ -9,7 +9,7 @@ import messages from '@intlify/vite-plugin-vue-i18n/messages'
export default createI18n({ export default createI18n({
legacy: false, legacy: false,
globalInjection: true, globalInjection: true,
availableLocales: ('de','en','fr'), availableLocales: ('de', 'en', 'fr'),
locale: navigator.language, locale: navigator.language,
fallbackLocale: 'en', fallbackLocale: 'en',
fallbackWarn: false, fallbackWarn: false,

View File

@ -194,7 +194,7 @@
"info-1": "Diesen Podcast dauerhaft aus der Bibliothek löschen?", "info-1": "Diesen Podcast dauerhaft aus der Bibliothek löschen?",
"info-2": "Dies wir auch RSS-Playlisten löschen ", "info-2": "Dies wir auch RSS-Playlisten löschen ",
"remove": "Entfernen", "remove": "Entfernen",
"remove-podcast":"Entferne podcast" "remove-podcast": "Entferne podcast"
}, },
"spotify": { "spotify": {
"not-playable-track": "Track kann nicht gespielt werden", "not-playable-track": "Track kann nicht gespielt werden",
@ -381,7 +381,7 @@
"remove": "Entfernen", "remove": "Entfernen",
"remove-info-1": "Diesen Podcast wirklich dauerhaft aus der Bibliothek löschen?", "remove-info-1": "Diesen Podcast wirklich dauerhaft aus der Bibliothek löschen?",
"remove-info-2": "Damit wird auch die RSS-Playliste gelöscht. ", "remove-info-2": "Damit wird auch die RSS-Playliste gelöscht. ",
"remove-podcast":"Entferne podcast", "remove-podcast": "Entferne podcast",
"track-count": "{count} Tracks" "track-count": "{count} Tracks"
}, },
"podcasts": { "podcasts": {

View File

@ -381,7 +381,7 @@
"remove": "Supprimer", "remove": "Supprimer",
"remove-info-1": "Supprimer ce podcast de manière permanente de la bibliothèque ?", "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-info-2": "Cela supprimera également la liste de lecture RSS ",
"remove-podcast":"Supprimer le podcast", "remove-podcast": "Supprimer le podcast",
"track-count": "{count} pistes" "track-count": "{count} pistes"
}, },
"podcasts": { "podcasts": {

View File

@ -51,7 +51,7 @@
<h3 class="subtitle is-6" v-text="now_playing.album" /> <h3 class="subtitle is-6" v-text="now_playing.album" />
<h3 <h3
v-if="filepath" v-if="filepath"
class="subtitle is-6 has-text-grey " class="subtitle is-6 has-text-grey"
v-text="filepath" v-text="filepath"
/> />
</div> </div>
@ -150,7 +150,6 @@ export default {
} }
}, },
watch: { watch: {
state() { state() {
if (this.interval_id > 0) { if (this.interval_id > 0) {

View File

@ -121,11 +121,15 @@ export default {
}, },
open_remove_podcast_dialog: function () { open_remove_podcast_dialog: function () {
webapi.library_track_playlists(this.tracks.items[0].id).then(({ data }) => { webapi
this.rss_playlist_to_remove = data.items.filter((pl) => pl.type === 'rss')[0] .library_track_playlists(this.tracks.items[0].id)
this.show_remove_podcast_modal = true .then(({ data }) => {
this.show_details_modal = false 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 () { remove_podcast: function () {

View File

@ -208,13 +208,13 @@ export default {
locale: { locale: {
get() { get() {
let languages = this.$i18n.availableLocales 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] let partial = this.$i18n.locale.split('-')[0]
if (!locale) { if (!locale) {
locale = languages.find(lang => lang === partial) locale = languages.find((lang) => lang === partial)
} }
if (!locale) { if (!locale) {
locale = languages.forEach(lang => lang.split('-')[0] === partial) locale = languages.forEach((lang) => lang.split('-')[0] === partial)
} }
return locale return locale
}, },