feat(admin): support application/x-mpegurl playlist uploads
closes #282
This commit is contained in:
@@ -41,14 +41,15 @@ func playlistParseLine(c *Controller, absPath string) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func playlistCheckContentType(contentType string) bool {
|
func playlistCheckContentType(contentType string) bool {
|
||||||
contentType = strings.ToLower(contentType)
|
switch ct := strings.ToLower(contentType); ct {
|
||||||
known := map[string]struct{}{
|
case
|
||||||
"audio/x-mpegurl": {},
|
"audio/x-mpegurl",
|
||||||
"audio/mpegurl": {},
|
"audio/mpegurl",
|
||||||
"application/octet-stream": {},
|
"application/x-mpegurl",
|
||||||
|
"application/octet-stream":
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
_, ok := known[contentType]
|
return false
|
||||||
return ok
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func playlistParseUpload(c *Controller, userID int, header *multipart.FileHeader) ([]string, bool) {
|
func playlistParseUpload(c *Controller, userID int, header *multipart.FileHeader) ([]string, bool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user