fix: initialize mimetypes for tests

This commit is contained in:
Deluan
2020-02-04 20:44:54 -05:00
parent 28bad95e66
commit e5e35516d7
2 changed files with 2 additions and 3 deletions
-44
View File
@@ -1,44 +0,0 @@
package server
import "mime"
func initMimeTypes() {
mt := map[string]string{
".mp3": "audio/mpeg",
".ogg": "audio/ogg",
".oga": "audio/ogg",
".opus": "audio/ogg",
".ogx": "application/ogg",
".aac": "audio/mp4",
".m4a": "audio/mp4",
".flac": "audio/flac",
".wav": "audio/x-wav",
".wma": "audio/x-ms-wma",
".ape": "audio/x-monkeys-audio",
".mpc": "audio/x-musepack",
".shn": "audio/x-shn",
".flv": "video/x-flv",
".avi": "video/avi",
".mpg": "video/mpeg",
".mpeg": "video/mpeg",
".mp4": "video/mp4",
".m4v": "video/x-m4v",
".mkv": "video/x-matroska",
".mov": "video/quicktime",
".wmv": "video/x-ms-wmv",
".ogv": "video/ogg",
".divx": "video/divx",
".m2ts": "video/MP2T",
".ts": "video/MP2T",
".webm": "video/webm",
".gif": "image/gif",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".png": "image/png",
".bmp": "image/bmp",
}
for ext, typ := range mt {
_ = mime.AddExtensionType(ext, typ)
}
}
-1
View File
@@ -23,7 +23,6 @@ type Server struct {
func New(scanner *scanner.Scanner, ds model.DataStore) *Server {
a := &Server{Scanner: scanner, ds: ds}
initMimeTypes()
initialSetup(ds)
a.initRoutes()
a.initScanner()