mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[web] Lint source code
This commit is contained in:
parent
9b12618b93
commit
152891f6cd
@ -78,6 +78,11 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
open_dialog(track) {
|
||||
this.selected_track = track
|
||||
this.show_details_modal = true
|
||||
},
|
||||
|
||||
play_track(track) {
|
||||
if (this.uris) {
|
||||
webapi.player_play_uri(
|
||||
@ -94,11 +99,6 @@ export default {
|
||||
} else {
|
||||
webapi.player_play_uri(track.uri, false)
|
||||
}
|
||||
},
|
||||
|
||||
open_dialog(track) {
|
||||
this.selected_track = track
|
||||
this.show_details_modal = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,16 +6,12 @@ const toColor = (string) => {
|
||||
return (hash & 0x00ffffff).toString(16)
|
||||
}
|
||||
|
||||
const luminance = (color) => {
|
||||
return (
|
||||
[0.2126, 0.7152, 0.0722].reduce(
|
||||
(luminance, factor, index) =>
|
||||
luminance +
|
||||
Number('0x' + color.slice(index * 2, index * 2 + 2)) * factor,
|
||||
0
|
||||
) / 255
|
||||
)
|
||||
}
|
||||
const luminance = (color) =>
|
||||
[0.2126, 0.7152, 0.0722].reduce(
|
||||
(luminance, factor, index) =>
|
||||
luminance + Number(`0x${color.slice(index * 2, index * 2 + 2)}`) * factor,
|
||||
0
|
||||
) / 255
|
||||
|
||||
export const renderSVG = (data) => {
|
||||
const color = toColor(data.alternate),
|
||||
|
@ -83,8 +83,8 @@ export default {
|
||||
name: 'PagePodcasts',
|
||||
components: {
|
||||
ContentWithHeading,
|
||||
ListTracks,
|
||||
ListAlbums,
|
||||
ListTracks,
|
||||
ModalDialogAddRss
|
||||
},
|
||||
|
||||
|
@ -70,51 +70,32 @@ export default createStore({
|
||||
},
|
||||
|
||||
getters: {
|
||||
now_playing: (state) => {
|
||||
return state.queue.items.find((e) => e.id === state.player.item_id) ?? {}
|
||||
},
|
||||
settings_option_recently_added_limit: (state, getters) => {
|
||||
return (
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'recently_added_limit'
|
||||
)?.value ?? 100
|
||||
)
|
||||
},
|
||||
settings_option: (state) => (categoryName, optionName) => {
|
||||
return (
|
||||
state.settings.categories
|
||||
.find((category) => category.name === categoryName)
|
||||
?.options.find((option) => option.name === optionName) ?? {}
|
||||
)
|
||||
},
|
||||
settings_option_show_composer_for_genre: (state, getters) => {
|
||||
return (
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_for_genre'
|
||||
)?.value ?? null
|
||||
)
|
||||
},
|
||||
settings_option_show_composer_now_playing: (state, getters) => {
|
||||
return (
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_now_playing'
|
||||
)?.value ?? false
|
||||
)
|
||||
},
|
||||
settings_option_show_filepath_now_playing: (state, getters) => {
|
||||
return (
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_filepath_now_playing'
|
||||
)?.value ?? false
|
||||
)
|
||||
},
|
||||
settings_webinterface: (state) => {
|
||||
return (
|
||||
state.settings?.categories.find(
|
||||
(category) => category.name === 'webinterface'
|
||||
) ?? null
|
||||
)
|
||||
}
|
||||
now_playing: (state) =>
|
||||
state.queue.items.find((e) => e.id === state.player.item_id) ?? {},
|
||||
settings_option_recently_added_limit: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'recently_added_limit'
|
||||
)?.value ?? 100,
|
||||
settings_option: (state) => (categoryName, optionName) =>
|
||||
state.settings.categories
|
||||
.find((category) => category.name === categoryName)
|
||||
?.options.find((option) => option.name === optionName) ?? {},
|
||||
settings_option_show_composer_for_genre: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_for_genre'
|
||||
)?.value ?? null,
|
||||
settings_option_show_composer_now_playing: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_composer_now_playing'
|
||||
)?.value ?? false,
|
||||
settings_option_show_filepath_now_playing: (state, getters) =>
|
||||
getters.settings_webinterface?.options.find(
|
||||
(option) => option.name === 'show_filepath_now_playing'
|
||||
)?.value ?? false,
|
||||
settings_webinterface: (state) =>
|
||||
state.settings?.categories.find(
|
||||
(category) => category.name === 'webinterface'
|
||||
) ?? null
|
||||
},
|
||||
|
||||
mutations: {
|
||||
|
Loading…
Reference in New Issue
Block a user