fix(playlist): fix non-admin users not being able to create playlists (#524)

* fix(playlist): fail early if playlist path is a directory

* fix(playlist): check error before assuming playlist loaded
This commit is contained in:
Nadia Santalla
2024-09-15 16:57:23 +02:00
committed by GitHub
parent bcb613c79c
commit ac798ac2d2
2 changed files with 8 additions and 2 deletions

View File

@@ -94,6 +94,10 @@ func (s *Store) Read(relPath string) (*Playlist, error) {
return nil, fmt.Errorf("stat m3u: %w", err)
}
if stat.IsDir() {
return nil, errors.New("path is a directory")
}
var playlist Playlist
playlist.UpdatedAt = stat.ModTime()