Fix mutexes in the cacher

This commit is contained in:
2026-02-12 02:28:23 +03:00
parent 2fbc12d770
commit f22111aa43
5 changed files with 36 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ package filesystem
import (
"context"
"log"
"os"
"path/filepath"
"syscall"
@@ -123,11 +122,14 @@ func (f *MusicFile) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, f
entry, err := f.f.cacher.GetFileDTO(f.sourcePath)
if err != nil {
log.Printf("Failed to convert %s to ALAC: %v", filepath.Base(f.sourcePath), err)
f.f.app.Logger().WithError(err).WithField("source file", f.sourcePath).
WithError(err).Error("Failed to convert file to cache")
return nil, 0, syscall.EIO
}
f.f.app.Logger().WithField("path", entry.Path).Debug("Opening cached file")
file, err := os.Open(entry.Path)
if err != nil {
return nil, 0, syscall.EIO