aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-06-23 12:04:45 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-06-23 12:04:45 -0400
commit1e5c3db9eba730fe8b52995e5c699c22983fa62a (patch)
treedd3aed9fe657cc48366b336591838cda756b119f /MediaBrowser.Api/Library
parent6ff89eab78a9d25fc8a8d195af558bf1c7ab4d8f (diff)
support individual library refreshing
Diffstat (limited to 'MediaBrowser.Api/Library')
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs7
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs10
2 files changed, 9 insertions, 8 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index d9fc7143f9..80d8c072ee 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -28,6 +28,7 @@ using MediaBrowser.Controller.IO;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Services;
using MediaBrowser.Common.Extensions;
+using MediaBrowser.Common.Progress;
namespace MediaBrowser.Api.Library
{
@@ -445,7 +446,7 @@ namespace MediaBrowser.Api.Library
}
else
{
- Task.Run(() => _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None));
+ Task.Run(() => _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None));
}
}
@@ -483,7 +484,7 @@ namespace MediaBrowser.Api.Library
}
else
{
- Task.Run(() => _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None));
+ Task.Run(() => _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None));
}
}
@@ -696,7 +697,7 @@ namespace MediaBrowser.Api.Library
{
try
{
- _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
+ _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
}
catch (Exception ex)
{
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index 8e396ff57a..ae488f066c 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -8,7 +8,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-
+using MediaBrowser.Common.Progress;
using MediaBrowser.Model.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
@@ -208,7 +208,7 @@ namespace MediaBrowser.Api.Library
/// <returns>System.Object.</returns>
public object Get(GetVirtualFolders request)
{
- var result = _libraryManager.GetVirtualFolders().OrderBy(i => i.Name).ToList();
+ var result = _libraryManager.GetVirtualFolders(true);
return ToOptimizedSerializedResultUsingCache(result);
}
@@ -290,7 +290,7 @@ namespace MediaBrowser.Api.Library
// No need to start if scanning the library because it will handle it
if (request.RefreshLibrary)
{
- _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
+ _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
}
else
{
@@ -347,7 +347,7 @@ namespace MediaBrowser.Api.Library
// No need to start if scanning the library because it will handle it
if (request.RefreshLibrary)
{
- _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
+ _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
}
else
{
@@ -400,7 +400,7 @@ namespace MediaBrowser.Api.Library
// No need to start if scanning the library because it will handle it
if (request.RefreshLibrary)
{
- _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
+ _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None);
}
else
{