mirror of
https://github.com/jellyfin/jellyfin
synced 2024-09-05 23:53:44 +00:00
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,
|
||||
},
|
||||
|
||||
new SubtitleProfile
|
||||
{
|
||||
Format = "sup",
|
||||
Method = SubtitleDeliveryMethod.External
|
||||
},
|
||||
|
||||
new SubtitleProfile
|
||||
{
|
||||
Format = "srt",
|
||||
|
@ -140,6 +146,12 @@ namespace Emby.Dlna.Profiles
|
|||
Method = SubtitleDeliveryMethod.Embed
|
||||
},
|
||||
|
||||
new SubtitleProfile
|
||||
{
|
||||
Format = "sup",
|
||||
Method = SubtitleDeliveryMethod.Embed
|
||||
},
|
||||
|
||||
new SubtitleProfile
|
||||
{
|
||||
Format = "subrip",
|
||||
|
|
|
@ -169,6 +169,7 @@ namespace Emby.Naming.Common
|
|||
".srt",
|
||||
".ssa",
|
||||
".sub",
|
||||
".sup",
|
||||
".vtt",
|
||||
};
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
".srt",
|
||||
".vtt",
|
||||
".sub",
|
||||
".sup",
|
||||
".idx",
|
||||
".txt",
|
||||
".edl",
|
||||
|
|
|
@ -938,8 +938,10 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
&& state.SubtitleStream.IsExternal)
|
||||
{
|
||||
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");
|
||||
if (File.Exists(idxFile))
|
||||
|
|
|
@ -635,11 +635,12 @@ namespace MediaBrowser.Model.Entities
|
|||
|
||||
// sub = external .sub file
|
||||
|
||||
return !codec.Contains("pgs", StringComparison.OrdinalIgnoreCase) &&
|
||||
!codec.Contains("dvd", StringComparison.OrdinalIgnoreCase) &&
|
||||
!codec.Contains("dvbsub", StringComparison.OrdinalIgnoreCase) &&
|
||||
!string.Equals(codec, "sub", StringComparison.OrdinalIgnoreCase) &&
|
||||
!string.Equals(codec, "dvb_subtitle", StringComparison.OrdinalIgnoreCase);
|
||||
return !codec.Contains("pgs", StringComparison.OrdinalIgnoreCase)
|
||||
&& !codec.Contains("dvd", StringComparison.OrdinalIgnoreCase)
|
||||
&& !codec.Contains("dvbsub", StringComparison.OrdinalIgnoreCase)
|
||||
&& !string.Equals(codec, "sub", StringComparison.OrdinalIgnoreCase)
|
||||
&& !string.Equals(codec, "sup", StringComparison.OrdinalIgnoreCase)
|
||||
&& !string.Equals(codec, "dvb_subtitle", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public bool SupportsSubtitleConversionTo(string toCodec)
|
||||
|
|
Loading…
Reference in a new issue