Skip to content

Commit

Permalink
fix(playlist): fail early if playlist path is a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiamoe committed Jul 3, 2024
1 parent 0e45f5e commit 0e2aae7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions playlist/playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 0e2aae7

Please sign in to comment.