mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-13 10:47:19 +03:00
Also import .m3u8
playlists
This commit is contained in:
parent
60178c264d
commit
93626129b6
@ -23,6 +23,6 @@ func IsImageFile(filePath string) bool {
|
||||
}
|
||||
|
||||
func IsPlaylist(filePath string) bool {
|
||||
extension := filepath.Ext(filePath)
|
||||
return strings.ToLower(extension) == ".m3u"
|
||||
extension := strings.ToLower(filepath.Ext(filePath))
|
||||
return extension == ".m3u" || extension == ".m3u8"
|
||||
}
|
||||
|
@ -49,6 +49,10 @@ var _ = Describe("Files", 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…
x
Reference in New Issue
Block a user