[web] Transition to camel case

This commit is contained in:
Alain Nussbaumer
2025-03-08 22:27:06 +01:00
parent c22372daa6
commit 905d0ca88b
36 changed files with 188 additions and 203 deletions

View File

@@ -1,5 +1,5 @@
<template>
<a :class="{ 'is-dark': is_active }" @click="toggle">
<a :class="{ 'is-dark': isActive }" @click="toggle">
<mdicon
class="icon"
:name="icon"
@@ -14,22 +14,19 @@ import { useLyricsStore } from '@/stores/lyrics'
export default {
name: 'ControlPlayerLyrics',
setup() {
return {
lyricsStore: useLyricsStore()
}
},
computed: {
icon() {
return this.is_active ? 'script-text-play' : 'script-text-outline'
return this.isActive ? 'script-text-play' : 'script-text-outline'
},
is_active() {
isActive() {
return this.lyricsStore.pane
}
},
methods: {
toggle() {
this.lyricsStore.pane = !this.lyricsStore.pane

View File

@@ -1,5 +1,5 @@
<template>
<a :disabled="disabled" @click="play_previous">
<a :disabled="disabled" @click="playPrevious">
<mdicon
class="icon"
name="skip-backward"
@@ -14,21 +14,18 @@ import webapi from '@/webapi'
export default {
name: 'ControlPlayerPrevious',
setup() {
return {
queueStore: useQueueStore()
}
},
computed: {
disabled() {
return this.queueStore.count <= 0
}
},
methods: {
play_previous() {
playPrevious() {
if (this.disabled) {
return
}

View File

@@ -1,5 +1,5 @@
<template>
<a :class="{ 'is-dark': is_shuffle }" @click="toggle">
<a :class="{ 'is-dark': isShuffle }" @click="toggle">
<mdicon
class="icon"
:name="icon"
@@ -22,12 +22,12 @@ export default {
},
computed: {
icon() {
if (this.is_shuffle) {
if (this.isShuffle) {
return 'shuffle'
}
return 'shuffle-disabled'
},
is_shuffle() {
isShuffle() {
return this.playerStore.shuffle
}
},

View File

@@ -32,7 +32,7 @@
/>
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -44,15 +44,15 @@
:media_kind="media_kind"
:show="show_details_modal"
@close="show_details_modal = false"
@remove-podcast="open_remove_podcast_dialog()"
@play-count-changed="play_count_changed()"
@remove-podcast="openRemovePodcastDialog()"
@play-count-changed="onPlayCountChange()"
/>
<modal-dialog
:actions="actions"
:show="show_remove_podcast_modal"
:title="$t('page.podcast.remove-podcast')"
@cancel="show_remove_podcast_modal = false"
@remove="remove_podcast"
@remove="removePodcast"
>
<template #content>
<i18n-t keypath="list.albums.info" tag="p" scope="global">
@@ -119,11 +119,11 @@ export default {
this.$router.push({ name: 'music-album', params: { id: item.id } })
}
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
},
open_remove_podcast_dialog() {
openRemovePodcastDialog() {
webapi
.library_album_tracks(this.selected_item.id, { limit: 1 })
.then(({ data: album }) => {
@@ -136,10 +136,10 @@ export default {
})
})
},
play_count_changed() {
onPlayCountChange() {
this.$emit('play-count-changed')
},
remove_podcast() {
removePodcast() {
this.show_remove_podcast_modal = false
webapi
.library_playlist_delete(this.rss_playlist_to_remove.id)

View File

@@ -23,7 +23,7 @@
/>
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item)">
<a @click.prevent.stop="openDialog(item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -60,7 +60,7 @@ export default {
params: { id: item.id }
})
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -16,7 +16,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -50,7 +50,7 @@ export default {
item.media_kind === 'audiobook' ? 'audiobooks-artist' : 'music-artist'
this.$router.push({ name: route, params: { id: item.id } })
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -5,7 +5,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item)">
<a @click.prevent.stop="openDialog(item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -38,7 +38,7 @@ export default {
params: { id: item.id }
})
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -18,7 +18,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -54,7 +54,7 @@ export default {
})
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -3,7 +3,7 @@
<mdicon
class="icon media-left is-clickable"
name="chevron-left"
@click="open_parent"
@click="openParent"
/>
<div class="media-content">
<nav class="breadcrumb">
@@ -30,7 +30,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item)">
<a @click.prevent.stop="openDialog(item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -80,11 +80,11 @@ export default {
}
this.$router.push(route)
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item.path
this.show_details_modal = true
},
open_parent() {
openParent() {
this.open(this.directories.slice(-1).pop())
}
}

View File

@@ -18,7 +18,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -55,7 +55,7 @@ export default {
query: { media_kind: this.media_kind }
})
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -1,6 +1,6 @@
<template>
<div
v-if="is_next || !show_only_next_items"
v-if="isNext || !show_only_next_items"
class="media is-align-items-center is-clickable mb-0"
@click="play"
>
@@ -15,26 +15,26 @@
<div
class="is-size-6 has-text-weight-bold"
:class="{
'has-text-primary': item.id === player.item_id,
'has-text-grey-light': !is_next
'has-text-primary': isCurrent,
'has-text-grey-light': !isNext
}"
v-text="item.title"
/>
<div
class="is-size-7 has-text-weight-bold"
:class="{
'has-text-primary': item.id === player.item_id,
'has-text-grey-light': !is_next,
'has-text-grey': is_next && item.id !== player.item_id
'has-text-primary': isCurrent,
'has-text-grey-light': !isNext,
'has-text-grey': isNext && !isCurrent
}"
v-text="item.artist"
/>
<div
class="is-size-7"
:class="{
'has-text-primary': item.id === player.item_id,
'has-text-grey-light': !is_next,
'has-text-grey': is_next && item.id !== player.item_id
'has-text-primary': isCurrent,
'has-text-grey-light': !isNext,
'has-text-grey': isNext && isCurrent
}"
v-text="item.album"
/>
@@ -58,20 +58,17 @@ export default {
position: { required: true, type: Number },
show_only_next_items: Boolean
},
setup() {
return { playerStore: usePlayerStore() }
},
computed: {
is_next() {
return this.current_position < 0 || this.position >= this.current_position
isCurrent() {
return this.item.id === this.playerStore.item_id
},
player() {
return this.playerStore
isNext() {
return this.current_position < 0 || this.position >= this.current_position
}
},
methods: {
play() {
webapi.player_play({ item_id: this.item.id })

View File

@@ -9,7 +9,7 @@
<p class="is-size-6 has-text-weight-bold" v-text="item.item.name" />
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -17,7 +17,7 @@
</template>
<teleport to="#app">
<modal-dialog-playlist
:item="selected_item"
:item="selectedItem"
:show="show_details_modal"
@close="show_details_modal = false"
/>
@@ -33,7 +33,7 @@ export default {
props: { items: { required: true, type: Object } },
data() {
return { selected_item: {}, show_details_modal: false }
return { selectedItem: {}, show_details_modal: false }
},
methods: {
@@ -52,8 +52,8 @@ export default {
this.$router.push({ name: 'playlist', params: { id: item.id } })
}
},
open_dialog(item) {
this.selected_item = item
openDialog(item) {
this.selectedItem = item
this.show_details_modal = true
}
}

View File

@@ -12,7 +12,7 @@
/>
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item)">
<a @click.prevent.stop="openDialog(item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -45,7 +45,7 @@ export default {
open(item) {
this.$router.push({ name: 'playlist-spotify', params: { id: item.id } })
},
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
}

View File

@@ -40,7 +40,7 @@
/>
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item.item)">
<a @click.prevent.stop="openDialog(item.item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -77,7 +77,7 @@ export default {
},
methods: {
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
},

View File

@@ -36,7 +36,7 @@
</div>
</div>
<div class="media-right">
<a @click.prevent.stop="open_dialog(item)">
<a @click.prevent.stop="openDialog(item)">
<mdicon class="icon has-text-grey" name="dots-vertical" size="16" />
</a>
</div>
@@ -66,7 +66,7 @@ export default {
return { selected_item: {}, show_details_modal: false }
},
methods: {
open_dialog(item) {
openDialog(item) {
this.selected_item = item
this.show_details_modal = true
},

View File

@@ -43,7 +43,7 @@ export default {
name: this.item.name,
properties: [
{
handler: this.open_artist,
handler: this.openArtist,
key: 'property.artist',
value: this.item.artist
},
@@ -95,7 +95,7 @@ export default {
})
}
},
open_artist() {
openArtist() {
this.$emit('close')
if (this.media_kind_resolved === 'audiobook') {
this.$router.push({

View File

@@ -22,7 +22,7 @@ export default {
name: this.item.name || '',
properties: [
{
handler: this.open_artist,
handler: this.openArtist,
key: 'property.artist',
value: this.item?.artists?.[0]?.name
},
@@ -44,7 +44,7 @@ export default {
params: { id: this.item.id }
})
},
open_artist() {
openArtist() {
this.$emit('close')
this.$router.push({
name: 'music-spotify-artist',

View File

@@ -18,16 +18,16 @@ export default {
playable() {
return {
expression: `composer is "${this.item.name}" and media_kind is music`,
handler: this.open_albums,
handler: this.openAlbums,
name: this.item.name,
properties: [
{
handler: this.open_albums,
handler: this.openAlbums,
key: 'property.albums',
value: this.item.album_count
},
{
handler: this.open_tracks,
handler: this.openTracks,
key: 'property.tracks',
value: this.item.track_count
},
@@ -40,14 +40,14 @@ export default {
}
},
methods: {
open_albums() {
openAlbums() {
this.$emit('close')
this.$router.push({
name: 'music-composer-albums',
params: { name: this.item.name }
})
},
open_tracks() {
openTracks() {
this.$emit('close')
this.$router.push({
name: 'music-composer-tracks',

View File

@@ -34,9 +34,9 @@ export default {
computed: {
actions() {
return [
{ handler: this.queue_add, icon: 'playlist-plus', key: 'actions.add' },
{ handler: this.addToQueue, icon: 'playlist-plus', key: 'actions.add' },
{
handler: this.queue_add_next,
handler: this.addNextToQueue,
icon: 'playlist-play',
key: 'actions.add-next'
},
@@ -53,7 +53,7 @@ export default {
webapi.player_play_uri(this.item.uris || this.item.uri, false)
}
},
queue_add() {
addToQueue() {
this.$emit('close')
if (this.item.expression) {
webapi.queue_expression_add(this.item.expression)
@@ -61,7 +61,7 @@ export default {
webapi.queue_add(this.item.uris || this.item.uri)
}
},
queue_add_next() {
addNextToQueue() {
this.$emit('close')
if (this.item.expression) {
webapi.queue_expression_add_next(this.item.expression)

View File

@@ -38,19 +38,19 @@ export default {
name: this.item.title,
properties: [
{
handler: this.open_album,
handler: this.openAlbum,
key: 'property.album',
value: this.item.album
},
{
handler: this.open_album_artist,
handler: this.openAlbumArtist,
key: 'property.album-artist',
value: this.item.album_artist
},
{ key: 'property.composer', value: this.item.composer },
{ key: 'property.year', value: this.item.year },
{
handler: this.open_genre,
handler: this.openGenre,
key: 'property.genre',
value: this.item.genre
},
@@ -97,7 +97,7 @@ export default {
}
},
methods: {
open_album() {
openAlbum() {
this.$emit('close')
if (this.item.data_kind === 'spotify') {
this.$router.push({
@@ -121,7 +121,7 @@ export default {
})
}
},
open_album_artist() {
openAlbumArtist() {
this.$emit('close')
if (this.item.data_kind === 'spotify') {
this.$router.push({
@@ -143,7 +143,7 @@ export default {
})
}
},
open_genre() {
openGenre() {
this.$emit('close')
this.$router.push({
name: 'genre-albums',

View File

@@ -22,20 +22,20 @@ export default {
return []
}
return this.item.play_count > 0
? [{ handler: this.mark_new, key: 'actions.mark-as-new' }]
: [{ handler: this.mark_played, key: 'actions.mark-as-played' }]
? [{ handler: this.markAsNew, key: 'actions.mark-as-new' }]
: [{ handler: this.markAsPlayed, key: 'actions.mark-as-played' }]
},
playable() {
return {
name: this.item.title,
properties: [
{
handler: this.open_album,
handler: this.openAlbum,
key: 'property.album',
value: this.item.album
},
{
handler: this.open_artist,
handler: this.openArtist,
key: 'property.album-artist',
value: this.item.album_artist
},
@@ -91,7 +91,7 @@ export default {
}
},
methods: {
mark_new() {
markAsNew() {
webapi
.library_track_update(this.item.id, { play_count: 'reset' })
.then(() => {
@@ -99,7 +99,7 @@ export default {
this.$emit('close')
})
},
mark_played() {
markAsPlayed() {
webapi
.library_track_update(this.item.id, { play_count: 'increment' })
.then(() => {
@@ -107,7 +107,7 @@ export default {
this.$emit('close')
})
},
open_album() {
openAlbum() {
this.$emit('close')
if (this.item.media_kind === 'podcast') {
this.$router.push({
@@ -126,7 +126,7 @@ export default {
})
}
},
open_artist() {
openArtist() {
this.$emit('close')
if (
this.item.media_kind === 'music' ||
@@ -143,7 +143,7 @@ export default {
})
}
},
open_genre() {
openGenre() {
this.$emit('close')
this.$router.push({
name: 'genre-albums',

View File

@@ -23,12 +23,12 @@ export default {
name: this.item.name,
properties: [
{
handler: this.open_album,
handler: this.openAlbum,
key: 'property.album',
value: this.item.album.name
},
{
handler: this.open_artist,
handler: this.openArtist,
key: 'property.album-artist',
value: this.item.artists[0]?.name
},
@@ -51,14 +51,14 @@ export default {
}
},
methods: {
open_album() {
openAlbum() {
this.$emit('close')
this.$router.push({
name: 'music-spotify-album',
params: { id: this.item.album.id }
})
},
open_artist() {
openArtist() {
this.$emit('close')
this.$router.push({
name: 'music-spotify-artist',

View File

@@ -143,7 +143,7 @@ export default {
{
icon: 'magnify',
key: 'navigation.search',
name: this.searchStore.search_source,
name: this.searchStore.source,
show: this.settingsStore.show_menu_item_search
},
{ separator: true, show: true },
@@ -153,7 +153,7 @@ export default {
show: true
},
{
action: this.open_update_dialog,
action: this.openUpdateDialog,
key: 'navigation.update-library',
show: true
},
@@ -168,7 +168,7 @@ export default {
}
},
methods: {
open_update_dialog() {
openUpdateDialog() {
this.uiStore.show_update_dialog = true
this.uiStore.show_burger_menu = false
}