mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 00:05:03 -05:00
[web] Lint source code
This commit is contained in:
parent
5640c33a67
commit
be931f4173
@ -97,9 +97,8 @@ export default {
|
||||
// Hook the progress bar to start before we move router-view
|
||||
this.$router.beforeEach((to, from, next) => {
|
||||
if (to.meta.show_progress && !(to.path === from.path && to.hash)) {
|
||||
if (to.meta.progress !== undefined) {
|
||||
const meta = to.meta.progress
|
||||
this.$Progress.parseMeta(meta)
|
||||
if (to.meta.progress) {
|
||||
this.$Progress.parseMeta(to.meta.progress)
|
||||
}
|
||||
this.$Progress.start()
|
||||
}
|
||||
@ -171,7 +170,7 @@ export default {
|
||||
maxReconnectInterval: 2000
|
||||
})
|
||||
|
||||
socket.onopen = function () {
|
||||
socket.onopen = () => {
|
||||
vm.reconnect_attempts = 0
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
@ -239,7 +238,7 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
socket.onmessage = function (response) {
|
||||
socket.onmessage = (response) => {
|
||||
const data = JSON.parse(response.data)
|
||||
if (
|
||||
data.notify.includes('update') ||
|
||||
|
@ -146,7 +146,7 @@ export default {
|
||||
methods: {
|
||||
reset_scrolling() {
|
||||
// Scroll to the start of the lyrics in all cases
|
||||
if (this.player.item_id != this.lastItemId && this.$refs.lyrics) {
|
||||
if (this.player.item_id !== this.lastItemId && this.$refs.lyrics) {
|
||||
this.$refs.lyrics.scrollTo(0, 0)
|
||||
}
|
||||
this.lastItemId = this.player.item_id
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
},
|
||||
start_scrolling(e) {
|
||||
// Consider only user events
|
||||
if (e.screenX || e.screenX != 0 || e.screenY || e.screenY != 0) {
|
||||
if (e.screenX || e.screenX !== 0 || e.screenY || e.screenY !== 0) {
|
||||
this.autoScrolling = false
|
||||
if (this.scrollingTimer) {
|
||||
clearTimeout(this.scrollingTimer)
|
||||
|
@ -1,15 +1,15 @@
|
||||
const toColor = (string) => {
|
||||
let hash = 0
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
hash = string.charCodeAt(i) + ((hash << 5) - hash)
|
||||
for (const char of string) {
|
||||
hash = char.charCodeAt(0) + ((hash << 5) - hash)
|
||||
}
|
||||
return (hash & 0x00ffffff).toString(16)
|
||||
}
|
||||
|
||||
const luminance = (color) =>
|
||||
[0.2126, 0.7152, 0.0722].reduce(
|
||||
(luminance, factor, index) =>
|
||||
luminance + Number(`0x${color.slice(index * 2, index * 2 + 2)}`) * factor,
|
||||
(value, factor, index) =>
|
||||
value + Number(`0x${color.slice(index * 2, index * 2 + 2)}`) * factor,
|
||||
0
|
||||
) / 255
|
||||
|
||||
|
@ -135,10 +135,7 @@ export default {
|
||||
|
||||
computed: {
|
||||
current_position() {
|
||||
const nowPlaying = this.$store.getters.now_playing
|
||||
return nowPlaying === undefined || nowPlaying.position === undefined
|
||||
? -1
|
||||
: this.$store.getters.now_playing.position
|
||||
return this.$store.getters.now_playing?.position ?? -1
|
||||
},
|
||||
is_queue_save_allowed() {
|
||||
return (
|
||||
@ -189,7 +186,7 @@ export default {
|
||||
remove(item) {
|
||||
webapi.queue_remove(item.id)
|
||||
},
|
||||
update_show_next_items(e) {
|
||||
update_show_next_items() {
|
||||
this.$store.commit(types.SHOW_ONLY_NEXT_ITEMS, !this.show_only_next_items)
|
||||
},
|
||||
save_dialog() {
|
||||
|
Loading…
Reference in New Issue
Block a user