Fix nullability errors in Jellyfin.Api (part 1)

This commit is contained in:
crobibero
2020-11-13 09:04:31 -07:00
parent e8675a6c24
commit 01355e0498
29 changed files with 155 additions and 54 deletions

View File

@@ -1347,7 +1347,13 @@ namespace Jellyfin.Api.Controllers
var mapArgs = state.IsOutputVideo ? _encodingHelper.GetMapArgs(state) : string.Empty;
var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request.SegmentContainer);
var directory = Path.GetDirectoryName(outputPath);
if (directory == null)
{
throw new NullReferenceException(nameof(directory));
}
var outputTsArg = Path.Combine(directory, Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request.SegmentContainer);
var segmentFormat = GetSegmentFileExtension(state.Request.SegmentContainer).TrimStart('.');
if (string.Equals(segmentFormat, "ts", StringComparison.OrdinalIgnoreCase))
@@ -1566,6 +1572,10 @@ namespace Jellyfin.Api.Controllers
private string GetSegmentPath(StreamState state, string playlist, int index)
{
var folder = Path.GetDirectoryName(playlist);
if (folder == null)
{
throw new NullReferenceException(nameof(folder));
}
var filename = Path.GetFileNameWithoutExtension(playlist);