diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-08-28 17:32:09 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-08-28 17:32:09 +0200 |
| commit | 645825db36f2de9771aa5d0ebcdab25855d18b5d (patch) | |
| tree | 72526fa08230b26951c453638c1c2d2e4afcedca /Jellyfin.Api/Controllers/LibraryStructureController.cs | |
| parent | e88367fe70f8d5f2a0cec35792739fe23000a818 (diff) | |
Enable nullable for more files
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryStructureController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/LibraryStructureController.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs index be9127dd3..ec1170411 100644 --- a/Jellyfin.Api/Controllers/LibraryStructureController.cs +++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs @@ -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); } |
