mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Enable nullable for more files
This commit is contained in:
@@ -84,7 +84,7 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
if (paths != null && paths.Length > 0)
|
||||
{
|
||||
libraryOptions.PathInfos = paths.Select(i => new MediaPathInfo { Path = i }).ToArray();
|
||||
libraryOptions.PathInfos = paths.Select(i => new MediaPathInfo(i)).ToArray();
|
||||
}
|
||||
|
||||
await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false);
|
||||
@@ -212,7 +212,7 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
try
|
||||
{
|
||||
var mediaPath = mediaPathDto.PathInfo ?? new MediaPathInfo { Path = mediaPathDto.Path };
|
||||
var mediaPath = mediaPathDto.PathInfo ?? new MediaPathInfo(mediaPathDto.Path ?? throw new ArgumentException("PathInfo and Path can't both be null."));
|
||||
|
||||
_libraryManager.AddMediaPath(mediaPathDto.Name, mediaPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user