updated nuget

pull/702/head
Luke Pulverenti 10 years ago
parent aac044f18f
commit c87c516ea3

@ -212,24 +212,26 @@ namespace MediaBrowser.Api.Library
File.Create(path); 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 finally
{ {
// No need to start if scanning the library because it will handle it Task.Run(() =>
if (!request.RefreshLibrary)
{ {
_libraryMonitor.Start(); // No need to start if scanning the library because it will handle it
} if (request.RefreshLibrary)
} {
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
if (request.RefreshLibrary) }
{ else
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); {
// 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); 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 finally
{ {
// No need to start if scanning the library because it will handle it Task.Run(() =>
if (!request.RefreshLibrary)
{ {
_libraryMonitor.Start(); // No need to start if scanning the library because it will handle it
} if (request.RefreshLibrary)
} {
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
if (request.RefreshLibrary) }
{ else
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); {
// 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 try
{ {
_fileSystem.DeleteDirectory(path, true); _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 finally
{ {
// No need to start if scanning the library because it will handle it Task.Run(() =>
if (!request.RefreshLibrary)
{ {
_libraryMonitor.Start(); // No need to start if scanning the library because it will handle it
} if (request.RefreshLibrary)
} {
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
if (request.RefreshLibrary) }
{ else
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); {
// 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 try
{ {
LibraryHelpers.AddMediaPath(_fileSystem, request.Name, request.Path, _appPaths); 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 finally
{ {
// No need to start if scanning the library because it will handle it Task.Run(() =>
if (!request.RefreshLibrary)
{ {
_libraryMonitor.Start(); // No need to start if scanning the library because it will handle it
} if (request.RefreshLibrary)
} {
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
if (request.RefreshLibrary) }
{ else
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); {
// 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 try
{ {
LibraryHelpers.RemoveMediaPath(_fileSystem, request.Name, request.Path, _appPaths); 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 finally
{ {
// No need to start if scanning the library because it will handle it Task.Run(() =>
if (!request.RefreshLibrary)
{ {
_libraryMonitor.Start(); // No need to start if scanning the library because it will handle it
} if (request.RefreshLibrary)
} {
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None);
if (request.RefreshLibrary) }
{ else
_libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); {
// 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();
}
});
} }
} }
} }

@ -60,7 +60,8 @@ namespace MediaBrowser.Controller.Sync
/// </summary> /// </summary>
/// <param name="path">The path.</param> /// <param name="path">The path.</param>
/// <param name="target">The target.</param> /// <param name="target">The target.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;List&lt;DeviceFileInfo&gt;&gt;.</returns> /// <returns>Task&lt;List&lt;DeviceFileInfo&gt;&gt;.</returns>
Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target); Task<List<DeviceFileInfo>> GetFileSystemEntries(string path, SyncTarget target, CancellationToken cancellationToken);
} }
} }

@ -62,6 +62,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
return ResolveVideos<Video>(parent, files, directoryService, collectionType, false); 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)) if (string.IsNullOrEmpty(collectionType))
{ {
// Owned items should just use the plain video type // 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); item = ResolveVideo<Video>(args, false);
} }
else if (string.Equals(collectionType, CollectionType.Photos, StringComparison.OrdinalIgnoreCase))
{
item = ResolveVideo<Video>(args, false);
}
else if (string.IsNullOrEmpty(collectionType)) else if (string.IsNullOrEmpty(collectionType))
{ {
if (args.HasParent<Series>()) if (args.HasParent<Series>())
@ -358,6 +367,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
} }
var supportsMultiVersion = !string.Equals(collectionType, CollectionType.HomeVideos) && var supportsMultiVersion = !string.Equals(collectionType, CollectionType.HomeVideos) &&
!string.Equals(collectionType, CollectionType.Photos) &&
!string.Equals(collectionType, CollectionType.MusicVideos); !string.Equals(collectionType, CollectionType.MusicVideos);
var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, collectionType, supportsMultiVersion); var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, collectionType, supportsMultiVersion);
@ -474,7 +484,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
CollectionType.Movies, CollectionType.Movies,
CollectionType.HomeVideos, CollectionType.HomeVideos,
CollectionType.MusicVideos, CollectionType.MusicVideos,
CollectionType.Movies CollectionType.Movies,
CollectionType.Photos
}; };
return !validCollectionTypes.Contains(collectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase); return !validCollectionTypes.Contains(collectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase);

@ -203,7 +203,7 @@ namespace MediaBrowser.Server.Implementations.Sync
foreach (var localItem in localItems) 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) foreach (var file in files)
{ {
@ -326,12 +326,12 @@ namespace MediaBrowser.Server.Implementations.Sync
return _fileSystem.GetValidFilename(filename); 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; var path = item.LocalPath;
path = provider.GetParentDirectoryPath(path, target); 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>(); var itemFiles = new List<ItemFileInfo>();

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.591</version> <version>3.0.593</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <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> <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> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <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="NLog" version="3.2.0.0" />
<dependency id="SimpleInjector" version="2.7.0" /> <dependency id="SimpleInjector" version="2.7.0" />
</dependencies> </dependencies>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.591</version> <version>3.0.593</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.591</version> <version>3.0.593</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.591</version> <version>3.0.593</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.591" /> <dependency id="MediaBrowser.Common" version="3.0.593" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

Loading…
Cancel
Save