update client sync

This commit is contained in:
Luke Pulverenti
2015-09-15 14:09:44 -04:00
parent 6d3fda8693
commit a0fa1b5f8f
9 changed files with 182 additions and 60 deletions

View File

@@ -1637,7 +1637,8 @@ namespace MediaBrowser.Server.Implementations.Library
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
}
private readonly TimeSpan _viewRefreshInterval = TimeSpan.FromHours(24);
//private readonly TimeSpan _viewRefreshInterval = TimeSpan.FromHours(24);
private readonly TimeSpan _viewRefreshInterval = TimeSpan.FromMinutes(1);
public Task<UserView> GetNamedView(User user,
string name,
@@ -1645,12 +1646,7 @@ namespace MediaBrowser.Server.Implementations.Library
string sortName,
CancellationToken cancellationToken)
{
if (ConfigurationManager.Configuration.EnableUserSpecificUserViews)
{
return GetNamedViewInternal(user, name, null, viewType, sortName, null, cancellationToken);
}
return GetNamedView(name, viewType, sortName, cancellationToken);
return GetNamedViewInternal(user, name, null, viewType, sortName, null, cancellationToken);
}
public async Task<UserView> GetNamedView(string name,
@@ -1767,7 +1763,8 @@ namespace MediaBrowser.Server.Implementations.Library
DateCreated = DateTime.UtcNow,
Name = name,
ViewType = viewType,
ForcedSortName = sortName
ForcedSortName = sortName,
UserId = user.Id
};
if (!string.IsNullOrWhiteSpace(parentId))
@@ -1780,6 +1777,12 @@ namespace MediaBrowser.Server.Implementations.Library
isNew = true;
}
if (!item.UserId.HasValue)
{
item.UserId = user.Id;
await item.UpdateToRepository(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
}
if (!string.Equals(viewType, item.ViewType, StringComparison.OrdinalIgnoreCase))
{
item.ViewType = viewType;