mirror of https://github.com/jellyfin/jellyfin.git
Add support for .sup subtitle (#8808)
Fixes https://github.com/jellyfin/jellyfin/issues/8628
This commit is contained in:
parent
c73c7b6050
commit
9a740344be
|
@ -92,6 +92,12 @@ namespace Emby.Dlna.Profiles
|
||||||
Method = SubtitleDeliveryMethod.External,
|
Method = SubtitleDeliveryMethod.External,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
new SubtitleProfile
|
||||||
|
{
|
||||||
|
Format = "sup",
|
||||||
|
Method = SubtitleDeliveryMethod.External
|
||||||
|
},
|
||||||
|
|
||||||
new SubtitleProfile
|
new SubtitleProfile
|
||||||
{
|
{
|
||||||
Format = "srt",
|
Format = "srt",
|
||||||
|
@ -140,6 +146,12 @@ namespace Emby.Dlna.Profiles
|
||||||
Method = SubtitleDeliveryMethod.Embed
|
Method = SubtitleDeliveryMethod.Embed
|
||||||
},
|
},
|
||||||
|
|
||||||
|
new SubtitleProfile
|
||||||
|
{
|
||||||
|
Format = "sup",
|
||||||
|
Method = SubtitleDeliveryMethod.Embed
|
||||||
|
},
|
||||||
|
|
||||||
new SubtitleProfile
|
new SubtitleProfile
|
||||||
{
|
{
|
||||||
Format = "subrip",
|
Format = "subrip",
|
||||||
|
|
|
@ -169,6 +169,7 @@ namespace Emby.Naming.Common
|
||||||
".srt",
|
".srt",
|
||||||
".ssa",
|
".ssa",
|
||||||
".sub",
|
".sub",
|
||||||
|
".sup",
|
||||||
".vtt",
|
".vtt",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
".srt",
|
".srt",
|
||||||
".vtt",
|
".vtt",
|
||||||
".sub",
|
".sub",
|
||||||
|
".sup",
|
||||||
".idx",
|
".idx",
|
||||||
".txt",
|
".txt",
|
||||||
".edl",
|
".edl",
|
||||||
|
|
|
@ -938,8 +938,10 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
&& state.SubtitleStream.IsExternal)
|
&& state.SubtitleStream.IsExternal)
|
||||||
{
|
{
|
||||||
var subtitlePath = state.SubtitleStream.Path;
|
var subtitlePath = state.SubtitleStream.Path;
|
||||||
|
var subtitleExtension = Path.GetExtension(subtitlePath);
|
||||||
|
|
||||||
if (string.Equals(Path.GetExtension(subtitlePath), ".sub", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(subtitleExtension, ".sub", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| string.Equals(subtitleExtension, ".sup", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
var idxFile = Path.ChangeExtension(subtitlePath, ".idx");
|
||||||
if (File.Exists(idxFile))
|
if (File.Exists(idxFile))
|
||||||
|
|
|
@ -635,11 +635,12 @@ namespace MediaBrowser.Model.Entities
|
||||||
|
|
||||||
// sub = external .sub file
|
// sub = external .sub file
|
||||||
|
|
||||||
return !codec.Contains("pgs", StringComparison.OrdinalIgnoreCase) &&
|
return !codec.Contains("pgs", StringComparison.OrdinalIgnoreCase)
|
||||||
!codec.Contains("dvd", StringComparison.OrdinalIgnoreCase) &&
|
&& !codec.Contains("dvd", StringComparison.OrdinalIgnoreCase)
|
||||||
!codec.Contains("dvbsub", StringComparison.OrdinalIgnoreCase) &&
|
&& !codec.Contains("dvbsub", StringComparison.OrdinalIgnoreCase)
|
||||||
!string.Equals(codec, "sub", StringComparison.OrdinalIgnoreCase) &&
|
&& !string.Equals(codec, "sub", StringComparison.OrdinalIgnoreCase)
|
||||||
!string.Equals(codec, "dvb_subtitle", StringComparison.OrdinalIgnoreCase);
|
&& !string.Equals(codec, "sup", StringComparison.OrdinalIgnoreCase)
|
||||||
|
&& !string.Equals(codec, "dvb_subtitle", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SupportsSubtitleConversionTo(string toCodec)
|
public bool SupportsSubtitleConversionTo(string toCodec)
|
||||||
|
|
Loading…
Reference in New Issue