|
|
@ -8,15 +8,13 @@ using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities.Movies
|
|
|
|
namespace MediaBrowser.Controller.Entities.Movies
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Class BoxSet
|
|
|
|
/// Class BoxSet
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public class BoxSet : Folder, IHasTrailers, IHasKeywords, IHasDisplayOrder, IHasLookupInfo<BoxSetInfo>, IMetadataContainer, IHasShares
|
|
|
|
public class BoxSet : Folder, IHasTrailers, IHasKeywords, IHasDisplayOrder, IHasLookupInfo<BoxSetInfo>, IHasShares
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public List<Share> Shares { get; set; }
|
|
|
|
public List<Share> Shares { get; set; }
|
|
|
|
|
|
|
|
|
|
|
@ -159,34 +157,6 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|
|
|
return GetItemLookupInfo<BoxSetInfo>();
|
|
|
|
return GetItemLookupInfo<BoxSetInfo>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Refresh bottom up, children first, then the boxset
|
|
|
|
|
|
|
|
// By then hopefully the movies within will have Tmdb collection values
|
|
|
|
|
|
|
|
var items = GetRecursiveChildren().ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var totalItems = items.Count;
|
|
|
|
|
|
|
|
var numComplete = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Refresh songs
|
|
|
|
|
|
|
|
foreach (var item in items)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await item.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
numComplete++;
|
|
|
|
|
|
|
|
double percent = numComplete;
|
|
|
|
|
|
|
|
percent /= totalItems;
|
|
|
|
|
|
|
|
progress.Report(percent * 100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Refresh current item
|
|
|
|
|
|
|
|
await RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress.Report(100);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override bool IsVisible(User user)
|
|
|
|
public override bool IsVisible(User user)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var userId = user.Id.ToString("N");
|
|
|
|
var userId = user.Id.ToString("N");
|
|
|
|