aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryStructureController.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-09-03 11:01:55 -0600
committerCody Robibero <cody@robibe.ro>2021-09-03 11:01:55 -0600
commitff9d14c8119f6cf77f21e4ebcc97c5580725b882 (patch)
tree8ca7b09583a1195e507d347bcbddbabb039f47fc /Jellyfin.Api/Controllers/LibraryStructureController.cs
parent88157fcc77dc6cd47b4defda95089677403241ba (diff)
parent95ca1d54876e928dc654736ff5a279728c0f9ed0 (diff)
Merge remote-tracking branch 'upstream/master' into authenticationdb-efcore
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryStructureController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryStructureController.cs4
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);
}