Skip to content

Commit

Permalink
[web] Reorder properties and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hacketiwack committed Dec 14, 2023
1 parent 1b666fe commit 67f716f
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 266 deletions.
6 changes: 2 additions & 4 deletions web-src/src/pages/PageAlbumSpotify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,9 @@ export default {
data() {
return {
album: { artists: [{}], tracks: {} },
show_track_details_modal: false,
selected_track: {},
show_details_modal: false
show_details_modal: false,
show_track_details_modal: false
}
},
Expand Down
107 changes: 50 additions & 57 deletions web-src/src/pages/PageSearchLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,77 +283,70 @@ export default {
data() {
return {
search_query: '',
tracks: new GroupByList(),
artists: new GroupByList(),
albums: new GroupByList(),
artists: new GroupByList(),
audiobooks: new GroupByList(),
composers: new GroupByList(),
playlists: new GroupByList(),
audiobooks: new GroupByList(),
podcasts: new GroupByList()
podcasts: new GroupByList(),
search_query: '',
tracks: new GroupByList()
}
},
computed: {
recent_searches() {
return this.$store.state.recent_searches
},
show_tracks() {
return this.$route.query.type && this.$route.query.type.includes('track')
},
show_all_tracks_button() {
return this.tracks.total > this.tracks.items.length
},
show_artists() {
return this.$route.query.type && this.$route.query.type.includes('artist')
},
show_all_artists_button() {
return this.artists.total > this.artists.items.length
},
show_albums() {
return this.$route.query.type && this.$route.query.type.includes('album')
},
show_all_albums_button() {
return this.albums.total > this.albums.items.length
},
show_composers() {
return (
this.$route.query.type && this.$route.query.type.includes('composer')
)
show_all_artists_button() {
return this.artists.total > this.artists.items.length
},
show_all_audiobooks_button() {
return this.audiobooks.total > this.audiobooks.items.length
},
show_all_composers_button() {
return this.composers.total > this.composers.items.length
},
show_playlists() {
return (
this.$route.query.type && this.$route.query.type.includes('playlist')
)
},
show_all_playlists_button() {
return this.playlists.total > this.playlists.items.length
},
show_all_podcasts_button() {
return this.podcasts.total > this.podcasts.items.length
},
show_all_tracks_button() {
return this.tracks.total > this.tracks.items.length
},
show_artists() {
return this.$route.query.type && this.$route.query.type.includes('artist')
},
show_audiobooks() {
return (
this.$route.query.type && this.$route.query.type.includes('audiobook')
)
},
show_all_audiobooks_button() {
return this.audiobooks.total > this.audiobooks.items.length
show_composers() {
return (
this.$route.query.type && this.$route.query.type.includes('composer')
)
},
show_playlists() {
return (
this.$route.query.type && this.$route.query.type.includes('playlist')
)
},
show_podcasts() {
return (
this.$route.query.type && this.$route.query.type.includes('podcast')
)
},
show_all_podcasts_button() {
return this.podcasts.total > this.podcasts.items.length
show_tracks() {
return this.$route.query.type && this.$route.query.type.includes('track')
}
},
Expand Down Expand Up @@ -398,7 +391,7 @@ export default {
}
if (query.query.startsWith('query:')) {
searchParams.expression = query.query.replace(/^query:/, '').trim()
searchParams.expression = query.query.replace(/^query:/u, '').trim()
} else {
searchParams.query = query.query
}
Expand Down Expand Up @@ -428,7 +421,7 @@ export default {
}
if (query.query.startsWith('query:')) {
searchParams.expression = query.query.replace(/^query:/, '').trim()
searchParams.expression = query.query.replace(/^query:/u, '').trim()
} else {
searchParams.expression = `((album includes "${query.query}" or artist includes "${query.query}") and media_kind is audiobook)`
}
Expand All @@ -454,7 +447,7 @@ export default {
}
if (query.query.startsWith('query:')) {
searchParams.expression = query.query.replace(/^query:/, '').trim()
searchParams.expression = query.query.replace(/^query:/u, '').trim()
} else {
searchParams.expression = `((album includes "${query.query}" or artist includes "${query.query}") and media_kind is podcast)`
}
Expand All @@ -477,10 +470,10 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'track,artist,album,playlist,audiobook,podcast,composer',
query: this.search_query,
limit: 3,
offset: 0
offset: 0,
query: this.search_query,
type: 'track,artist,album,playlist,audiobook,podcast,composer'
}
})
this.$refs.search_field.blur()
Expand All @@ -490,8 +483,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'track',
query: this.$route.query.query
query: this.$route.query.query,
type: 'track'
}
})
},
Expand All @@ -500,8 +493,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'artist',
query: this.$route.query.query
query: this.$route.query.query,
type: 'artist'
}
})
},
Expand All @@ -510,8 +503,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'album',
query: this.$route.query.query
query: this.$route.query.query,
type: 'album'
}
})
},
Expand All @@ -520,8 +513,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'tracks',
query: this.$route.query.query
query: this.$route.query.query,
type: 'tracks'
}
})
},
Expand All @@ -530,8 +523,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'playlist',
query: this.$route.query.query
query: this.$route.query.query,
type: 'playlist'
}
})
},
Expand All @@ -540,8 +533,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'audiobook',
query: this.$route.query.query
query: this.$route.query.query,
type: 'audiobook'
}
})
},
Expand All @@ -550,8 +543,8 @@ export default {
this.$router.push({
name: 'search-library',
query: {
type: 'podcast',
query: this.$route.query.query
query: this.$route.query.query,
type: 'podcast'
}
})
},
Expand Down
Loading

0 comments on commit 67f716f

Please sign in to comment.