update recording sync fields

pull/702/head
Luke Pulverenti 9 years ago
parent 232d0eb14c
commit 9e8d35dadc

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Querying;
using System.Collections.Generic;
@ -44,10 +45,10 @@ namespace MediaBrowser.Controller.Dto
/// <summary>
/// Fills the synchronize information.
/// </summary>
/// <param name="dtos">The dtos.</param>
/// <param name="tuples">The tuples.</param>
/// <param name="options">The options.</param>
/// <param name="user">The user.</param>
void FillSyncInfo(IEnumerable<IHasSyncInfo> dtos, DtoOptions options, User user);
void FillSyncInfo(IEnumerable<Tuple<BaseItem, BaseItemDto>> tuples, DtoOptions options, User user);
/// <summary>
/// Gets the base item dto.

@ -329,7 +329,6 @@ namespace MediaBrowser.Controller.Library
/// <param name="parentId">The parent identifier.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
/// <param name="uniqueId">The unique identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;UserView&gt;.</returns>
Task<UserView> GetNamedView(User user,

@ -99,7 +99,7 @@ namespace MediaBrowser.Providers.People
var requestCount = _requestCount;
if (requestCount >= 5)
if (requestCount >= 10)
{
//_logger.Debug("Throttling Tmdb people");

@ -212,17 +212,17 @@ namespace MediaBrowser.Server.Implementations.Dto
}).Items;
}
public void FillSyncInfo(IEnumerable<IHasSyncInfo> dtos, DtoOptions options, User user)
public void FillSyncInfo(IEnumerable<Tuple<BaseItem, BaseItemDto>> tuples, DtoOptions options, User user)
{
if (options.Fields.Contains(ItemFields.SyncInfo))
{
var syncProgress = GetSyncedItemProgress(options);
foreach (var dto in dtos)
foreach (var tuple in tuples)
{
var item = _libraryManager.GetItemById(dto.Id);
var item = tuple.Item1;
FillSyncInfo(dto, item, syncProgress, options, user);
FillSyncInfo(tuple.Item2, item, syncProgress, options, user);
}
}
}

@ -1592,18 +1592,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var internalResult = await GetInternalRecordings(query, cancellationToken).ConfigureAwait(false);
var returnArray = internalResult.Items
.Select(i => _dtoService.GetBaseItemDto(i, options, user))
var tuples = internalResult.Items
.Select(i => new Tuple<BaseItem, BaseItemDto>(i, _dtoService.GetBaseItemDto(i, options, user)))
.ToArray();
if (user != null)
{
_dtoService.FillSyncInfo(returnArray, new DtoOptions(), user);
_dtoService.FillSyncInfo(tuples, new DtoOptions(), user);
}
return new QueryResult<BaseItemDto>
{
Items = returnArray,
Items = tuples.Select(i => i.Item2).ToArray(),
TotalRecordCount = internalResult.TotalRecordCount
};
}
@ -1684,6 +1684,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
_lastRecordingRefreshTime = DateTime.MinValue;
// This is the responsibility of the live tv service
await _libraryManager.DeleteItem((BaseItem)recording, new DeleteOptions
{

@ -491,6 +491,11 @@ namespace MediaBrowser.Server.Implementations.Sync
public bool SupportsSync(BaseItem item)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
if (item is Playlist)
{
return true;

Loading…
Cancel
Save