Files
silo-server/internal/scanner/audio_extensions.go
T
RXWatcherandClaude Opus 4.7 5f1ca3f825 feat(audiobooks): add audio-extension recognizer for scanner
Mirrors the existing videoExtensions/SupportsVideoFile pair. Used by
upcoming audiobook and podcast scanner branches to filter directory
walks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 13:28:40 +02:00

27 lines
594 B
Go

package scanner
import (
"path/filepath"
"strings"
)
// audioExtensions is the set of file extensions the audiobook and podcast
// scanner branches recognize. Mirrors videoExtensions for video libraries.
var audioExtensions = map[string]bool{
".m4b": true,
".m4a": true,
".mp3": true,
".flac": true,
".opus": true,
".ogg": true,
}
// SupportsAudioFile reports whether the given path uses a recognized audio
// file extension.
func SupportsAudioFile(filePath string) bool {
if filePath == "" {
return false
}
return audioExtensions[strings.ToLower(filepath.Ext(filePath))]
}