mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
FxCop -> Net Analyzers (part 1)
This commit is contained in:
@@ -640,7 +640,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
}
|
||||
|
||||
// Filter out junk
|
||||
if (!string.IsNullOrWhiteSpace(streamInfo.CodecTagString) && streamInfo.CodecTagString.IndexOf("[0]", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
if (!string.IsNullOrWhiteSpace(streamInfo.CodecTagString) && !streamInfo.CodecTagString.Contains("[0]", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
stream.CodecTag = streamInfo.CodecTagString;
|
||||
}
|
||||
@@ -1500,11 +1500,23 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(); // Switch to default parsing
|
||||
// Switch to default parsing
|
||||
if (subtitle.Contains('.', StringComparison.Ordinal))
|
||||
{
|
||||
// skip the comment, keep the subtitle
|
||||
description = string.Join('.', subtitle.Split('.'), 1, subtitle.Split('.').Length - 1).Trim(); // skip the first
|
||||
}
|
||||
else
|
||||
{
|
||||
description = subtitle.Trim(); // Clean up whitespaces and save it
|
||||
}
|
||||
}
|
||||
}
|
||||
catch // Default parsing
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error while parsing subtitle field");
|
||||
|
||||
// Default parsing
|
||||
if (subtitle.Contains('.', StringComparison.Ordinal))
|
||||
{
|
||||
// skip the comment, keep the subtitle
|
||||
|
||||
Reference in New Issue
Block a user