feat: optimize CPU and memory usage

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
This commit is contained in:
Kasper Seweryn 2023-01-31 22:31:38 +01:00 committed by Marge
commit 77e920672d
15 changed files with 999 additions and 105 deletions

View file

@ -296,7 +296,6 @@ export const useQueue = createGlobalState(() => {
}
// Ends in
const now = useNow()
const endsIn = useTimeAgo(computed(() => {
const seconds = sum(
queue.value
@ -304,10 +303,12 @@ export const useQueue = createGlobalState(() => {
.map((track) => track.sources[0]?.duration ?? 0)
)
const date = new Date(now.value)
const date = new Date()
date.setSeconds(date.getSeconds() + seconds)
return date
}))
}), {
updateInterval: 0
})
// Clear
const clearRadio = ref(false)