Skip to content

Commit

Permalink
properly respect the cache=none option again
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelmerro committed Feb 10, 2022
1 parent 0ada870 commit 676e0cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/renderer/songs.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ const scanner = async folder => {
const {clearPlaylist} = require("./playlist")
await clearPlaylist()
glob(joinPath(escapedFolder, "**/*.mp3"), async(_e, files) => {
songs = cachedSongs.filter(s => s.path?.startsWith(folder))
.filter(s => isFile(s.path))
const useCache = ["all", "songs"].includes(cache)
if (useCache !== "none") {
songs = cachedSongs.filter(s => s.path?.startsWith(folder))
.filter(s => isFile(s.path))
}
for (const f of files) {
const match = songs.find(s => f.endsWith(s.id) || f === s.path)
if (useCache && match) {
Expand Down

0 comments on commit 676e0cf

Please sign in to comment.