diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-18 23:47:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-03-18 23:47:21 -0400 |
| commit | c87c516ea32b8c9bdd01f76c453b65bf24f9ce86 (patch) | |
| tree | 5455f0bba7974fdc0f484d5de36a31a5b86e910c | |
| parent | aac044f18f11009fc4911b509f4d6dd4c0d56f56 (diff) | |
updated nuget
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryStructureService.cs | 150 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Sync/IServerSyncProvider.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sync/MediaSync.cs | 6 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.Internal.nuspec | 4 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Model.Signed.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Server.Core.nuspec | 4 |
8 files changed, 103 insertions, 81 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index 27944a4ea..f5fe921ce 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -212,24 +212,26 @@ namespace MediaBrowser.Api.Library File.Create(path); } - - // Need to add a delay here or directory watchers may still pick up the changes - var task = Task.Delay(1000); - // Have to block here to allow exceptions to bubble - Task.WaitAll(task); } finally { - // No need to start if scanning the library because it will handle it - if (!request.RefreshLibrary) + Task.Run(() => { - _libraryMonitor.Start(); - } - } - - if (request.RefreshLibrary) - { - _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + // No need to start if scanning the library because it will handle it + if (request.RefreshLibrary) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + else + { + // Need to add a delay here or directory watchers may still pick up the changes + var task = Task.Delay(1000); + // Have to block here to allow exceptions to bubble + Task.WaitAll(task); + + _libraryMonitor.Start(); + } + }); } } @@ -279,24 +281,26 @@ namespace MediaBrowser.Api.Library } Directory.Move(currentPath, newPath); - - // Need to add a delay here or directory watchers may still pick up the changes - var task = Task.Delay(1000); - // Have to block here to allow exceptions to bubble - Task.WaitAll(task); } finally { - // No need to start if scanning the library because it will handle it - if (!request.RefreshLibrary) + Task.Run(() => { - _libraryMonitor.Start(); - } - } - - if (request.RefreshLibrary) - { - _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + // No need to start if scanning the library because it will handle it + if (request.RefreshLibrary) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + else + { + // Need to add a delay here or directory watchers may still pick up the changes + var task = Task.Delay(1000); + // Have to block here to allow exceptions to bubble + Task.WaitAll(task); + + _libraryMonitor.Start(); + } + }); } } @@ -325,24 +329,26 @@ namespace MediaBrowser.Api.Library try { _fileSystem.DeleteDirectory(path, true); - - // Need to add a delay here or directory watchers may still pick up the changes - var delayTask = Task.Delay(1000); - // Have to block here to allow exceptions to bubble - Task.WaitAll(delayTask); } finally { - // No need to start if scanning the library because it will handle it - if (!request.RefreshLibrary) + Task.Run(() => { - _libraryMonitor.Start(); - } - } - - if (request.RefreshLibrary) - { - _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + // No need to start if scanning the library because it will handle it + if (request.RefreshLibrary) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + else + { + // Need to add a delay here or directory watchers may still pick up the changes + var task = Task.Delay(1000); + // Have to block here to allow exceptions to bubble + Task.WaitAll(task); + + _libraryMonitor.Start(); + } + }); } } @@ -362,24 +368,26 @@ namespace MediaBrowser.Api.Library try { LibraryHelpers.AddMediaPath(_fileSystem, request.Name, request.Path, _appPaths); - - // Need to add a delay here or directory watchers may still pick up the changes - var task = Task.Delay(1000); - // Have to block here to allow exceptions to bubble - Task.WaitAll(task); } finally { - // No need to start if scanning the library because it will handle it - if (!request.RefreshLibrary) + Task.Run(() => { - _libraryMonitor.Start(); - } - } - - if (request.RefreshLibrary) - { - _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + // No need to start if scanning the library because it will handle it + if (request.RefreshLibrary) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + else + { + // Need to add a delay here or directory watchers may still pick up the changes + var task = Task.Delay(1000); + // Have to block here to allow exceptions to bubble + Task.WaitAll(task); + + _libraryMonitor.Start(); + } + }); } } @@ -399,24 +407,26 @@ namespace MediaBrowser.Api.Library try { LibraryHelpers.RemoveMediaPath(_fileSystem, request.Name, request.Path, _appPaths); - - // Need to add a delay here or directory watchers may still pick up the changes - var task = Task.Delay(1000); - // Have to block here to allow exceptions to bubble - Task.WaitAll(task); } finally { - // No need to start if scanning the library because it will handle it - if (!request.RefreshLibrary) + Task.Run(() => { - _libraryMonitor.Start(); - } - } - - if (request.RefreshLibrary) - { - _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + // No need to start if scanning the library because it will handle it + if (request.RefreshLibrary) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + else + { + // Need to add a delay here or directory watchers may still pick up the changes + var task = Task.Delay(1000); + // Have to block here to allow exceptions to bubble + Task.WaitAll(task); + + _libraryMonitor.Start(); + } + }); } } } diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs index 422349b80..abf884e9d 100644 --- a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs +++ b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs @@ -60,7 +60,8 @@ namespace MediaBrowser.Controller.Sync /// </summary> /// <param name="path">The path.</param> /// <param name="target">The target.</param> + /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task<List<DeviceFileInfo>>.</returns> - Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target); + Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 95dcee98a..71daf2b0c 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -62,6 +62,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies return ResolveVideos<Video>(parent, files, directoryService, collectionType, false); } + if (string.Equals(collectionType, CollectionType.Photos, StringComparison.OrdinalIgnoreCase)) + { + return ResolveVideos<Video>(parent, files, directoryService, collectionType, false); + } + if (string.IsNullOrEmpty(collectionType)) { // Owned items should just use the plain video type @@ -225,6 +230,10 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies { item = ResolveVideo<Video>(args, false); } + else if (string.Equals(collectionType, CollectionType.Photos, StringComparison.OrdinalIgnoreCase)) + { + item = ResolveVideo<Video>(args, false); + } else if (string.IsNullOrEmpty(collectionType)) { if (args.HasParent<Series>()) @@ -358,6 +367,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies } var supportsMultiVersion = !string.Equals(collectionType, CollectionType.HomeVideos) && + !string.Equals(collectionType, CollectionType.Photos) && !string.Equals(collectionType, CollectionType.MusicVideos); var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, collectionType, supportsMultiVersion); @@ -474,7 +484,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies CollectionType.Movies, CollectionType.HomeVideos, CollectionType.MusicVideos, - CollectionType.Movies + CollectionType.Movies, + CollectionType.Photos }; return !validCollectionTypes.Contains(collectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase); diff --git a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs index 48f682f98..c9ed4637a 100644 --- a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs +++ b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs @@ -203,7 +203,7 @@ namespace MediaBrowser.Server.Implementations.Sync foreach (var localItem in localItems) { - var files = await GetFiles(provider, localItem, target); + var files = await GetFiles(provider, localItem, target, cancellationToken); foreach (var file in files) { @@ -326,12 +326,12 @@ namespace MediaBrowser.Server.Implementations.Sync return _fileSystem.GetValidFilename(filename); } - private async Task<List<ItemFileInfo>> GetFiles(IServerSyncProvider provider, LocalItem item, SyncTarget target) + private async Task<List<ItemFileInfo>> GetFiles(IServerSyncProvider provider, LocalItem item, SyncTarget target, CancellationToken cancellationToken) { var path = item.LocalPath; path = provider.GetParentDirectoryPath(path, target); - var list = await provider.GetFileSystemEntries(path, target).ConfigureAwait(false); + var list = await provider.GetFileSystemEntries(path, target, cancellationToken).ConfigureAwait(false); var itemFiles = new List<ItemFileInfo>(); diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 5941a2a15..bbdce1f11 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.591</version> + <version>3.0.593</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.591" /> + <dependency id="MediaBrowser.Common" version="3.0.593" /> <dependency id="NLog" version="3.2.0.0" /> <dependency id="SimpleInjector" version="2.7.0" /> </dependencies> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index dd0e8602d..7aa7a9f69 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.591</version> + <version>3.0.593</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index 2e09e01fd..b33205c1e 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Model.Signed</id> - <version>3.0.591</version> + <version>3.0.593</version> <title>MediaBrowser.Model - Signed Edition</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index ce2248e09..9d6ad279c 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.591</version> + <version>3.0.593</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.591" /> + <dependency id="MediaBrowser.Common" version="3.0.593" /> </dependencies> </metadata> <files> |
