mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
fix userdata transactions
This commit is contained in:
@@ -842,17 +842,17 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
|
||||
|
||||
if (requiresConversion && !allowConversion)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!requiresConversion)
|
||||
{
|
||||
return profile;
|
||||
}
|
||||
|
||||
if (subtitleStream.IsTextSubtitleStream && subtitleStream.SupportsExternalStream)
|
||||
if (!allowConversion)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (subtitleStream.IsTextSubtitleStream && subtitleStream.SupportsExternalStream && subtitleStream.SupportsSubtitleConversionTo(profile.Format))
|
||||
{
|
||||
return profile;
|
||||
}
|
||||
|
||||
@@ -282,6 +282,36 @@ namespace MediaBrowser.Model.Entities
|
||||
!StringHelper.EqualsIgnoreCase(codec, "sub");
|
||||
}
|
||||
|
||||
public bool SupportsSubtitleConversionTo(string codec)
|
||||
{
|
||||
if (!IsTextSubtitleStream)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can't convert from this
|
||||
if (StringHelper.EqualsIgnoreCase(Codec, "ass"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (StringHelper.EqualsIgnoreCase(Codec, "ssa"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can't convert to this
|
||||
if (StringHelper.EqualsIgnoreCase(codec, "ass"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (StringHelper.EqualsIgnoreCase(codec, "ssa"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [supports external stream].
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user