[web] Lint source code

This commit is contained in:
Alain Nussbaumer 2024-03-26 01:17:07 +01:00
parent ed5f2028a1
commit 3ceb76b016
6 changed files with 70 additions and 98 deletions

View File

@ -138,21 +138,14 @@ export default {
}, },
methods: { methods: {
play() { mark_played() {
this.$emit('close') webapi
webapi.player_play_uri(this.album.uri, false) .library_album_track_update(this.album.id, { play_count: 'played' })
.then(({ data }) => {
this.$emit('play-count-changed')
this.$emit('close')
})
}, },
queue_add() {
this.$emit('close')
webapi.queue_add(this.album.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.album.uri)
},
open_album() { open_album() {
this.$emit('close') this.$emit('close')
if (this.media_kind_resolved === 'podcast') { if (this.media_kind_resolved === 'podcast') {
@ -169,7 +162,6 @@ export default {
}) })
} }
}, },
open_artist() { open_artist() {
this.$emit('close') this.$emit('close')
if (this.media_kind_resolved === 'audiobook') { if (this.media_kind_resolved === 'audiobook') {
@ -184,14 +176,17 @@ export default {
}) })
} }
}, },
play() {
mark_played() { this.$emit('close')
webapi webapi.player_play_uri(this.album.uri, false)
.library_album_track_update(this.album.id, { play_count: 'played' }) },
.then(({ data }) => { queue_add() {
this.$emit('play-count-changed') this.$emit('close')
this.$emit('close') webapi.queue_add(this.album.uri)
}) },
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.album.uri)
} }
} }
} }

View File

@ -99,25 +99,15 @@ export default {
}, },
methods: { methods: {
artwork_error() {
this.artwork_visible = false
},
artwork_loaded() {
this.artwork_visible = true
},
artwork_url(album) { artwork_url(album) {
return album.images?.[0]?.url || '' return album.images?.[0]?.url || ''
}, },
play() {
this.$emit('close')
webapi.player_play_uri(this.album.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.album.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.album.uri)
},
open_album() { open_album() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
@ -125,7 +115,6 @@ export default {
params: { id: this.album.id } params: { id: this.album.id }
}) })
}, },
open_artist() { open_artist() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
@ -133,13 +122,17 @@ export default {
params: { id: this.album.artists[0].id } params: { id: this.album.artists[0].id }
}) })
}, },
play() {
artwork_loaded() { this.$emit('close')
this.artwork_visible = true webapi.player_play_uri(this.album.uri, false)
}, },
queue_add() {
artwork_error() { this.$emit('close')
this.artwork_visible = false webapi.queue_add(this.album.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.album.uri)
} }
} }
} }

View File

@ -71,27 +71,24 @@ export default {
emits: ['close'], emits: ['close'],
methods: { methods: {
play() {
this.$emit('close')
webapi.player_play_uri(this.artist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.artist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.artist.uri)
},
open_artist() { open_artist() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
name: 'music-artist', name: 'music-artist',
params: { id: this.artist.id } params: { id: this.artist.id }
}) })
},
play() {
this.$emit('close')
webapi.player_play_uri(this.artist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.artist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.artist.uri)
} }
} }
} }

View File

@ -77,27 +77,24 @@ export default {
emits: ['close'], emits: ['close'],
methods: { methods: {
play() {
this.$emit('close')
webapi.player_play_uri(this.artist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.artist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.artist.uri)
},
open_artist() { open_artist() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
name: 'music-spotify-artist', name: 'music-spotify-artist',
params: { id: this.artist.id } params: { id: this.artist.id }
}) })
},
play() {
this.$emit('close')
webapi.player_play_uri(this.artist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.artist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.artist.uri)
} }
} }
} }

View File

@ -71,27 +71,24 @@ export default {
emits: ['close'], emits: ['close'],
methods: { methods: {
play() {
this.$emit('close')
webapi.player_play_uri(this.uris ? this.uris : this.playlist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.uris ? this.uris : this.playlist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.uris ? this.uris : this.playlist.uri)
},
open_playlist() { open_playlist() {
this.$emit('close') this.$emit('close')
this.$router.push({ this.$router.push({
name: 'playlist', name: 'playlist',
params: { id: this.playlist.id } params: { id: this.playlist.id }
}) })
},
play() {
this.$emit('close')
webapi.player_play_uri(this.uris || this.playlist.uri, false)
},
queue_add() {
this.$emit('close')
webapi.queue_add(this.uris || this.playlist.uri)
},
queue_add_next() {
this.$emit('close')
webapi.queue_add_next(this.uris || this.playlist.uri)
} }
} }
} }

View File

@ -217,7 +217,6 @@ export default {
this.$emit('close') this.$emit('close')
}) })
}, },
mark_played() { mark_played() {
webapi webapi
.library_track_update(this.track.id, { play_count: 'increment' }) .library_track_update(this.track.id, { play_count: 'increment' })
@ -226,7 +225,6 @@ export default {
this.$emit('close') this.$emit('close')
}) })
}, },
open_album() { open_album() {
if ( if (
this.track.data_kind === 'spotify' && this.track.data_kind === 'spotify' &&
@ -253,7 +251,6 @@ export default {
}) })
} }
}, },
open_album_artist() { open_album_artist() {
if (this.track.data_kind === 'spotify') { if (this.track.data_kind === 'spotify') {
this.$router.push({ this.$router.push({
@ -275,7 +272,6 @@ export default {
}) })
} }
}, },
open_genre() { open_genre() {
this.$router.push({ this.$router.push({
name: 'genre-albums', name: 'genre-albums',
@ -283,17 +279,14 @@ export default {
query: { media_kind: this.track.media_kind } query: { media_kind: this.track.media_kind }
}) })
}, },
play() { play() {
this.$emit('close') this.$emit('close')
webapi.player_play_uri(this.track.uri, false) webapi.player_play_uri(this.track.uri, false)
}, },
queue_add() { queue_add() {
this.$emit('close') this.$emit('close')
webapi.queue_add(this.track.uri) webapi.queue_add(this.track.uri)
}, },
queue_add_next() { queue_add_next() {
this.$emit('close') this.$emit('close')
webapi.queue_add_next(this.track.uri) webapi.queue_add_next(this.track.uri)