Merge remote-tracking branch 'upstream/master' into http-exception

This commit is contained in:
crobibero
2020-11-15 13:09:05 -07:00
76 changed files with 532 additions and 779 deletions

View File

@@ -391,7 +391,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
item.Genres = Array.Empty<string>();
foreach (var genre in result.Genre
.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
.Split(',', StringSplitOptions.RemoveEmptyEntries)
.Select(i => i.Trim())
.Where(i => !string.IsNullOrWhiteSpace(i)))
{

View File

@@ -170,7 +170,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
_logger.LogError(e, "Failed to retrieve series with remote id {RemoteId}", id);
}
return result?.Data.First().Id.ToString();
return result?.Data[0].Id.ToString(CultureInfo.InvariantCulture);
}
/// <summary>

View File

@@ -147,7 +147,7 @@ namespace MediaBrowser.Providers.Subtitles
string subtitleId,
CancellationToken cancellationToken)
{
var parts = subtitleId.Split(new[] { '_' }, 2);
var parts = subtitleId.Split('_', 2);
var provider = GetProvider(parts[0]);
try
@@ -329,7 +329,7 @@ namespace MediaBrowser.Providers.Subtitles
Index = index,
ItemId = item.Id,
Type = MediaStreamType.Subtitle
}).First();
})[0];
var path = stream.Path;
_monitor.ReportFileSystemChangeBeginning(path);
@@ -349,10 +349,10 @@ namespace MediaBrowser.Providers.Subtitles
/// <inheritdoc />
public Task<SubtitleResponse> GetRemoteSubtitles(string id, CancellationToken cancellationToken)
{
var parts = id.Split(new[] { '_' }, 2);
var parts = id.Split('_', 2);
var provider = GetProvider(parts[0]);
id = parts.Last();
id = parts[^1];
return provider.GetSubtitles(id, cancellationToken);
}