dlna: set more correct mime type

The code currently hardcodes `text/srt` for all subtitles.

`text/srt` is wrong, it seems `application/x-subrip` is the official
extension coming from the official mime database, at least (and still
works with the Samsung TV I tested with). Also add that one to `fs/
mimetype.go`.

Compared to previous iterations of this PR, I dropped tests ensuring
certain mime types are present - as detection still seems to be fairly
platform-specific.
This commit is contained in:
Florian Klink
2023-12-20 12:00:08 +02:00
committed by Nick Craig-Wood
parent 2e007f89c7
commit 00e073df1e
2 changed files with 17 additions and 2 deletions

View File

@ -30,7 +30,7 @@ func init() {
{"video/webm", ".webm"},
{"video/x-msvideo", ".avi"},
{"video/x-matroska", ".mpv,.mkv"},
{"text/srt", ".srt"},
{"application/x-subrip", ".srt"},
} {
for _, ext := range strings.Split(t.extensions, ",") {
if mime.TypeByExtension(ext) == "" {