fix userdata transactions

This commit is contained in:
Luke Pulverenti
2016-06-25 01:16:54 -04:00
parent f8dedb3fe8
commit cf0d9883c6
7 changed files with 48 additions and 28 deletions

View File

@@ -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;
}

View File

@@ -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>