[web] Fix shadowed variables

This commit is contained in:
Alain Nussbaumer 2024-04-26 21:48:07 +02:00
parent 8a303f340b
commit 7826b36634
4 changed files with 9 additions and 15 deletions

View File

@ -28,7 +28,6 @@ export default [
'no-negated-condition': 'off',
'no-nested-ternary': 'off',
'no-plusplus': 'off',
'no-shadow': 'off',
'no-ternary': 'off',
'no-undef': 'off',
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],

View File

@ -122,10 +122,10 @@ export default {
open_remove_podcast_dialog() {
webapi
.library_album_tracks(this.selected_item.id, { limit: 1 })
.then(({ data }) => {
webapi.library_track_playlists(data.items[0].id).then(({ data }) => {
.then(({ data: album }) => {
webapi.library_track_playlists(album.items[0].id).then(({ data }) => {
;[this.rss_playlist_to_remove] = data.items.filter(
(pl) => pl.type === 'rss'
(playlist) => playlist.type === 'rss'
)
this.show_remove_podcast_modal = true
this.show_details_modal = false

View File

@ -68,18 +68,13 @@ export default {
})
// Split the verses into words
parsed.forEach((verse, index, lyrics) => {
const duration =
index < lyrics.length - 1 ? lyrics[index + 1].time - verse.time : 3
const unitDuration = duration / verse.text.length
const unitDuration =
(lyrics[index + 1].time - verse.time || 3) / verse.text.length
let delay = 0
verse.words = verse.text.match(/\S+\s*/gu).map((text) => {
const duration = text.length * unitDuration
delay += duration
return {
duration,
delay,
text
}
return { duration, delay, text }
})
})
}

View File

@ -80,7 +80,6 @@ export class GroupedList {
}
group({ criteria = [], filters = [], index } = {}) {
const indexer = createIndexer(index)
const itemsFiltered = this.items.filter((item) =>
filters.every((filter) => filter(item))
)
@ -94,9 +93,10 @@ export class GroupedList {
)
)
// Group item list
const indexer = createIndexer(index)
this.itemsGrouped = itemsSorted.reduce((map, item) => {
const index = indexer(item)
map.set(index, [...(map.get(index) || []), item])
const key = indexer(item)
map.set(key, [...(map.get(key) || []), item])
return map
}, new Map())
// Create index list