added HasDynamicCategories to user views

pull/702/head
Luke Pulverenti 10 years ago
parent 0271b6776e
commit fce2c95ac7

@ -16,6 +16,11 @@ namespace MediaBrowser.Controller.Entities
public static ITVSeriesManager TVSeriesManager;
public bool ContainsDynamicCategories(User user)
{
return true;
}
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
{
var parent = this as Folder;

@ -67,6 +67,7 @@ namespace MediaBrowser.Model.Dto
public float? Metascore { get; set; }
public bool? IsUnidentified { get; set; }
public bool? HasDynamicCategories { get; set; }
public int? AnimeSeriesIndex { get; set; }

@ -395,6 +395,18 @@ namespace MediaBrowser.Server.Implementations.Dto
}
}
}
var userView = item as UserView;
if (userView != null)
{
dto.HasDynamicCategories = userView.ContainsDynamicCategories(user);
}
var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null)
{
dto.HasDynamicCategories = false;
}
}
private int GetChildCount(Folder folder, User user)

@ -143,7 +143,7 @@ namespace MediaBrowser.Server.Implementations.Sync
var fileTransferProgress = new ActionableProgress<double>();
fileTransferProgress.RegisterAction(pct => progress.Report(pct * .92));
var localItem = CreateLocalItem(provider, target, libraryItem, serverId, jobItem.OriginalFileName);
var localItem = CreateLocalItem(provider, jobItem.SyncJobId, target, libraryItem, serverId, jobItem.OriginalFileName);
await _syncManager.ReportSyncJobItemTransferBeginning(internalSyncJobItem.Id);
@ -226,9 +226,9 @@ namespace MediaBrowser.Server.Implementations.Sync
}
}
public LocalItem CreateLocalItem(IServerSyncProvider provider, SyncTarget target, BaseItemDto libraryItem, string serverId, string originalFileName)
public LocalItem CreateLocalItem(IServerSyncProvider provider, string syncJobId, SyncTarget target, BaseItemDto libraryItem, string serverId, string originalFileName)
{
var path = GetDirectoryPath(provider, libraryItem, serverId);
var path = GetDirectoryPath(provider, syncJobId, libraryItem, serverId);
path.Add(GetLocalFileName(provider, libraryItem, originalFileName));
var localPath = provider.GetFullPath(path, target);
@ -249,21 +249,20 @@ namespace MediaBrowser.Server.Implementations.Sync
};
}
private List<string> GetDirectoryPath(IServerSyncProvider provider, BaseItemDto item, string serverId)
private List<string> GetDirectoryPath(IServerSyncProvider provider, string syncJobId, BaseItemDto item, string serverId)
{
var parts = new List<string>
{
serverId
serverId,
syncJobId
};
if (item.IsType("episode"))
{
parts.Add("TV");
parts.Add(item.SeriesName);
if (!string.IsNullOrWhiteSpace(item.SeasonName))
if (!string.IsNullOrWhiteSpace(item.SeriesName))
{
parts.Add(item.SeasonName);
parts.Add(item.SeriesName);
}
}
else if (item.IsVideo)
@ -302,7 +301,7 @@ namespace MediaBrowser.Server.Implementations.Sync
{
var filename = originalFileName;
if (string.IsNullOrEmpty(filename))
if (string.IsNullOrWhiteSpace(filename))
{
filename = item.Name;
}

Loading…
Cancel
Save