dlna: add support for more external subtitle

This commit is contained in:
YanceyChiew 2022-10-01 14:28:50 +08:00 committed by Nick Craig-Wood
parent 4e79de106a
commit 09b6d939f5

View File

@ -158,7 +158,9 @@ func mediaWithResources(nodes vfs.Nodes) (vfs.Nodes, map[vfs.Node]vfs.Nodes) {
for _, node := range nodes {
baseName, ext := splitExt(strings.ToLower(node.Name()))
switch ext {
case ".srt":
case ".srt", ".ass", ".ssa", ".sub", ".idx", ".sup", ".jss", ".txt", ".usf", ".cue", ".vtt", ".css":
// .idx should be with .sub, .css should be with vtt otherwise they should be culled,
// and their mimeTypes are not consistent, but anyway these negatives don't throw errors.
subtitlesByName[baseName] = node
default:
mediaByName[baseName] = append(mediaByName[baseName], node)