mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 02:37:18 +03:00
18 lines
362 B
Go
18 lines
362 B
Go
package utils
|
|
|
|
import (
|
|
"mime"
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
func IsAudioFile(filePath string) bool {
|
|
extension := filepath.Ext(filePath)
|
|
return strings.HasPrefix(mime.TypeByExtension(extension), "audio/")
|
|
}
|
|
|
|
func IsImageFile(filePath string) bool {
|
|
extension := filepath.Ext(filePath)
|
|
return strings.HasPrefix(mime.TypeByExtension(extension), "image/")
|
|
}
|