mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-26 03:49:56 +01:00
Give warning when playlists are not imported due to not having an admin user
This commit is contained in:
parent
41138bd665
commit
feca030c6d
5 changed files with 71 additions and 30 deletions
|
|
@ -21,3 +21,8 @@ func IsImageFile(filePath string) bool {
|
|||
extension := filepath.Ext(filePath)
|
||||
return strings.HasPrefix(mime.TypeByExtension(extension), "image/")
|
||||
}
|
||||
|
||||
func IsPlaylist(filePath string) bool {
|
||||
extension := filepath.Ext(filePath)
|
||||
return strings.ToLower(extension) == ".m3u"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,14 @@ 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 false for a non-playlist file", func() {
|
||||
Expect(IsPlaylist("testm3u")).To(BeFalse())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue