mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-24 10:17:14 +02:00
Import smart playlists (extension .nsp)
This commit is contained in:
parent
21da1df4ea
commit
1a96e9fe65
12 changed files with 242 additions and 110 deletions
|
|
@ -21,8 +21,3 @@ func IsImageFile(filePath string) bool {
|
|||
extension := filepath.Ext(filePath)
|
||||
return strings.HasPrefix(mime.TypeByExtension(extension), "image/")
|
||||
}
|
||||
|
||||
func IsPlaylist(filePath string) bool {
|
||||
extension := strings.ToLower(filepath.Ext(filePath))
|
||||
return extension == ".m3u" || extension == ".m3u8"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,18 +43,4 @@ var _ = Describe("Files", func() {
|
|||
Expect(IsImageFile("test.mp3")).To(BeFalse())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("IsPlaylist", func() {
|
||||
It("returns true for a M3U file", func() {
|
||||
Expect(IsPlaylist(filepath.Join("path", "to", "test.m3u"))).To(BeTrue())
|
||||
})
|
||||
|
||||
It("returns true for a M3U8 file", func() {
|
||||
Expect(IsPlaylist(filepath.Join("path", "to", "test.m3u8"))).To(BeTrue())
|
||||
})
|
||||
|
||||
It("returns false for a non-playlist file", func() {
|
||||
Expect(IsPlaylist("testm3u")).To(BeFalse())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue