[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 })
.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
})

View File

@ -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) {

View File

@ -150,7 +150,6 @@ export default {
}
},
watch: {
state() {
if (this.interval_id > 0) {

View File

@ -121,8 +121,12 @@ 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]
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
})

View File

@ -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
},