boxset image fixes

This commit is contained in:
Luke Pulverenti
2015-10-14 01:02:30 -04:00
parent 574a796280
commit 1f7e1f5c4a
14 changed files with 97 additions and 24 deletions

View File

@@ -22,6 +22,17 @@ namespace MediaBrowser.Server.Implementations.Collections
{
}
protected override bool Supports(IHasImages item)
{
// Right now this is the only way to prevent this image from getting created ahead of internet image providers
if (!item.IsLocked)
{
return false;
}
return base.Supports(item);
}
protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item)
{
var playlist = (BoxSet)item;

View File

@@ -73,7 +73,7 @@ namespace MediaBrowser.Server.Implementations.Collections
try
{
_fileSystem.CreateDirectory(path);
_fileSystem.CreateDirectory(path);
var collection = new BoxSet
{
@@ -93,7 +93,12 @@ namespace MediaBrowser.Server.Implementations.Collections
if (options.ItemIdList.Count > 0)
{
await AddToCollection(collection.Id, options.ItemIdList, false);
await AddToCollection(collection.Id, options.ItemIdList, false, new MetadataRefreshOptions(_fileSystem)
{
// The initial adding of items is going to create a local metadata file
// This will cause internet metadata to be skipped as a result
MetadataRefreshMode = MetadataRefreshMode.FullRefresh
});
}
else
{
@@ -145,10 +150,10 @@ namespace MediaBrowser.Server.Implementations.Collections
public Task AddToCollection(Guid collectionId, IEnumerable<Guid> ids)
{
return AddToCollection(collectionId, ids, true);
return AddToCollection(collectionId, ids, true, new MetadataRefreshOptions(_fileSystem));
}
private async Task AddToCollection(Guid collectionId, IEnumerable<Guid> ids, bool fireEvent)
private async Task AddToCollection(Guid collectionId, IEnumerable<Guid> ids, bool fireEvent, MetadataRefreshOptions refreshOptions)
{
var collection = _libraryManager.GetItemById(collectionId) as BoxSet;
@@ -186,7 +191,7 @@ namespace MediaBrowser.Server.Implementations.Collections
await collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem));
_providerManager.QueueRefresh(collection.Id, refreshOptions);
if (fireEvent)
{