mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
fix: exclude non-played songs from recently/most played list
This commit is contained in:
parent
9b4f3fb9d2
commit
7f929f5ad6
2 changed files with 11 additions and 2 deletions
|
@ -44,6 +44,8 @@ export const overviewStore = {
|
|||
// To keep things simple, we only refresh the song stats.
|
||||
// All album/artist stats are simply ignored.
|
||||
this.state.mostPlayedSongs = songStore.getMostPlayed(7)
|
||||
this.state.recentlyPlayed = recentlyPlayedStore.excerptState.songs.filter(song => !song.deleted)
|
||||
this.state.recentlyPlayed = recentlyPlayedStore.excerptState.songs.filter(
|
||||
song => !song.deleted && song.play_count > 0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,7 +214,14 @@ export const songStore = {
|
|||
},
|
||||
|
||||
getMostPlayed (count: number) {
|
||||
return take(orderBy(Array.from(this.vault.values()).filter(song => !song.deleted), 'play_count', 'desc'), count)
|
||||
return take(
|
||||
orderBy(
|
||||
Array.from(this.vault.values()).filter(song => !song.deleted && song.play_count > 0),
|
||||
'play_count',
|
||||
'desc'
|
||||
),
|
||||
count
|
||||
)
|
||||
},
|
||||
|
||||
async deleteFromFilesystem (songs: Song[]) {
|
||||
|
|
Loading…
Reference in a new issue