updated nuget
This commit is contained in:
parent
cd279d98e0
commit
245e92c9cc
|
@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess
|
public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess
|
||||||
{
|
{
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
|
|
||||||
public bool IsAccessedByName { get; set; }
|
public bool IsAccessedByName { get; set; }
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
|
|
||||||
public MusicArtist()
|
public MusicArtist()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
{
|
{
|
||||||
public MusicGenre()
|
public MusicGenre()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public GameGenre()
|
public GameGenre()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -22,6 +22,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public Genre()
|
public Genre()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
|
@ -9,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IItemByName
|
public interface IItemByName
|
||||||
{
|
{
|
||||||
Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IHasDualAccess : IItemByName
|
public interface IHasDualAccess : IItemByName
|
||||||
|
@ -17,23 +18,29 @@ namespace MediaBrowser.Controller.Entities
|
||||||
bool IsAccessedByName { get; }
|
bool IsAccessedByName { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class IItemByNameExtensions
|
public static class ItemByNameExtensions
|
||||||
{
|
{
|
||||||
public static ItemByNameCounts GetItemByNameCounts(this IItemByName item, User user)
|
public static ItemByNameCounts GetItemByNameCounts(this IItemByName item, Guid userId)
|
||||||
{
|
{
|
||||||
if (user == null)
|
if (userId == Guid.Empty)
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("user");
|
throw new ArgumentNullException("userId");
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemByNameCounts counts;
|
return item.UserItemCountList.FirstOrDefault(i => i.UserId == userId);
|
||||||
|
}
|
||||||
|
|
||||||
if (item.UserItemCounts.TryGetValue(user.Id, out counts))
|
public static void SetItemByNameCounts(this IItemByName item, Guid userId, ItemByNameCounts counts)
|
||||||
|
{
|
||||||
|
var current = item.UserItemCountList.FirstOrDefault(i => i.UserId == userId);
|
||||||
|
|
||||||
|
if (current != null)
|
||||||
{
|
{
|
||||||
return counts;
|
item.UserItemCountList.Remove(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
counts.UserId = userId;
|
||||||
|
item.UserItemCountList.Add(counts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System.Runtime.Serialization;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Dto;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
|
@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public Person()
|
public Person()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the user data key.
|
/// Gets the user data key.
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public Studio()
|
public Studio()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
public Year()
|
public Year()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the user data key.
|
/// Gets the user data key.
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
public Channel()
|
public Channel()
|
||||||
{
|
{
|
||||||
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
|
UserItemCountList = new List<ItemByNameCounts>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
|
public List<ItemByNameCounts> UserItemCountList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the number.
|
/// Gets or sets the number.
|
||||||
|
|
|
@ -69,8 +69,16 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// <param name="channelId">The channel identifier.</param>
|
/// <param name="channelId">The channel identifier.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task{Stream}.</returns>
|
/// <returns>Task{Stream}.</returns>
|
||||||
Task<HttpResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
|
Task<ImageResponseInfo> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the program image asynchronous.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="programId">The program identifier.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>Task{ImageResponseInfo}.</returns>
|
||||||
|
Task<ImageResponseInfo> GetProgramImageAsync(string programId, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the recordings asynchronous.
|
/// Gets the recordings asynchronous.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
19
MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs
Normal file
19
MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
|
{
|
||||||
|
public class ImageResponseInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the stream.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The stream.</value>
|
||||||
|
public Stream Stream { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of the MIME.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The type of the MIME.</value>
|
||||||
|
public string MimeType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -77,6 +77,18 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The community rating.</value>
|
/// <value>The community rating.</value>
|
||||||
public float? CommunityRating { get; set; }
|
public float? CommunityRating { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance is repeat.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||||
|
public bool IsRepeat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the episode title.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The episode title.</value>
|
||||||
|
public string EpisodeTitle { get; set; }
|
||||||
|
|
||||||
public ProgramInfo()
|
public ProgramInfo()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
|
@ -25,6 +26,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the path.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The path.</value>
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of the recording.
|
/// Description of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -51,5 +58,27 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The status.</value>
|
/// <value>The status.</value>
|
||||||
public RecordingStatus Status { get; set; }
|
public RecordingStatus Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Genre of the program.
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Genres { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance is repeat.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||||
|
public bool IsRepeat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the episode title.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The episode title.</value>
|
||||||
|
public string EpisodeTitle { get; set; }
|
||||||
|
|
||||||
|
public RecordingInfo()
|
||||||
|
{
|
||||||
|
Genres = new List<string>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// <value>The days.</value>
|
/// <value>The days.</value>
|
||||||
public List<DayOfWeek> Days { get; set; }
|
public List<DayOfWeek> Days { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the priority.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The priority.</value>
|
||||||
|
public int Priority { get; set; }
|
||||||
|
|
||||||
public SeriesTimerInfo()
|
public SeriesTimerInfo()
|
||||||
{
|
{
|
||||||
Days = new List<DayOfWeek>();
|
Days = new List<DayOfWeek>();
|
||||||
|
|
|
@ -110,6 +110,7 @@
|
||||||
<Compile Include="LiveTv\ChannelInfo.cs" />
|
<Compile Include="LiveTv\ChannelInfo.cs" />
|
||||||
<Compile Include="LiveTv\ILiveTvManager.cs" />
|
<Compile Include="LiveTv\ILiveTvManager.cs" />
|
||||||
<Compile Include="LiveTv\ILiveTvService.cs" />
|
<Compile Include="LiveTv\ILiveTvService.cs" />
|
||||||
|
<Compile Include="LiveTv\ImageResponseInfo.cs" />
|
||||||
<Compile Include="LiveTv\ProgramInfo.cs" />
|
<Compile Include="LiveTv\ProgramInfo.cs" />
|
||||||
<Compile Include="LiveTv\RecordingInfo.cs" />
|
<Compile Include="LiveTv\RecordingInfo.cs" />
|
||||||
<Compile Include="LiveTv\SeriesTimerInfo.cs" />
|
<Compile Include="LiveTv\SeriesTimerInfo.cs" />
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Dto
|
namespace MediaBrowser.Model.Dto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -6,6 +7,8 @@ namespace MediaBrowser.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ItemByNameCounts
|
public class ItemByNameCounts
|
||||||
{
|
{
|
||||||
|
public Guid UserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the total count.
|
/// Gets or sets the total count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -90,29 +90,17 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
public DateTime? OriginalAirDate { get; set; }
|
public DateTime? OriginalAirDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the recording identifier.
|
/// Gets or sets a value indicating whether this instance is repeat.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The recording identifier.</value>
|
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||||
public string RecordingId { get; set; }
|
public bool IsRepeat { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the recording status.
|
/// Gets or sets the episode title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The recording status.</value>
|
/// <value>The episode title.</value>
|
||||||
public RecordingStatus? RecordingStatus { get; set; }
|
public string EpisodeTitle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the timer identifier.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The timer identifier.</value>
|
|
||||||
public string TimerId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the timer status.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The timer status.</value>
|
|
||||||
public RecordingStatus? TimerStatus { get; set; }
|
|
||||||
|
|
||||||
public ProgramInfoDto()
|
public ProgramInfoDto()
|
||||||
{
|
{
|
||||||
Genres = new List<string>();
|
Genres = new List<string>();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.LiveTv
|
namespace MediaBrowser.Model.LiveTv
|
||||||
{
|
{
|
||||||
|
@ -14,13 +15,13 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The external identifier.</value>
|
/// <value>The external identifier.</value>
|
||||||
public string ExternalId { get; set; }
|
public string ExternalId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the program identifier.
|
/// Gets or sets the program identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The program identifier.</value>
|
/// <value>The program identifier.</value>
|
||||||
public string ProgramId { get; set; }
|
public string ProgramId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ChannelId of the recording.
|
/// ChannelId of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -36,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the path.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The path.</value>
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of the recording.
|
/// Description of the recording.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -56,5 +63,27 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The status.</value>
|
/// <value>The status.</value>
|
||||||
public RecordingStatus Status { get; set; }
|
public RecordingStatus Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Genre of the program.
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Genres { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance is repeat.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
|
||||||
|
public bool IsRepeat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the episode title.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The episode title.</value>
|
||||||
|
public string EpisodeTitle { get; set; }
|
||||||
|
|
||||||
|
public RecordingInfoDto()
|
||||||
|
{
|
||||||
|
Genres = new List<string>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -129,17 +129,13 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||||
/// <param name="user">The user.</param>
|
/// <param name="user">The user.</param>
|
||||||
private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
|
private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
|
||||||
{
|
{
|
||||||
ItemByNameCounts counts;
|
|
||||||
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
//counts = item.ItemCounts;
|
//counts = item.ItemCounts;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!item.UserItemCounts.TryGetValue(user.Id, out counts))
|
|
||||||
{
|
ItemByNameCounts counts = item.GetItemByNameCounts(user.Id) ?? new ItemByNameCounts();
|
||||||
counts = new ItemByNameCounts();
|
|
||||||
}
|
|
||||||
|
|
||||||
dto.ChildCount = counts.TotalCount;
|
dto.ChildCount = counts.TotalCount;
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
|
|
||||||
if (userId.HasValue)
|
if (userId.HasValue)
|
||||||
{
|
{
|
||||||
artist.UserItemCounts[userId.Value] = counts;
|
artist.SetItemByNameCounts(userId.Value, counts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
{
|
{
|
||||||
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
||||||
|
|
||||||
itemByName.UserItemCounts[libraryId] = itemCounts;
|
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
{
|
{
|
||||||
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
||||||
|
|
||||||
itemByName.UserItemCounts[libraryId] = itemCounts;
|
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
{
|
{
|
||||||
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
||||||
|
|
||||||
itemByName.UserItemCounts[libraryId] = itemCounts;
|
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
{
|
{
|
||||||
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
||||||
|
|
||||||
itemByName.UserItemCounts[libraryId] = itemCounts;
|
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||||
{
|
{
|
||||||
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
|
||||||
|
|
||||||
itemByName.UserItemCounts[libraryId] = itemCounts;
|
itemByName.SetItemByNameCounts(libraryId, itemCounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
// Dummy up the original url
|
// Dummy up the original url
|
||||||
var url = channel.ServiceName + channel.ChannelId;
|
var url = channel.ServiceName + channel.ChannelId;
|
||||||
|
|
||||||
await _providerManager.SaveImage(channel, response.Content, response.ContentType, ImageType.Primary, null, url, cancellationToken).ConfigureAwait(false);
|
await _providerManager.SaveImage(channel, response.Stream, response.MimeType, ImageType.Primary, null, url, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
OriginalAirDate = program.OriginalAirDate,
|
OriginalAirDate = program.OriginalAirDate,
|
||||||
Audio = program.Audio,
|
Audio = program.Audio,
|
||||||
CommunityRating = program.CommunityRating,
|
CommunityRating = program.CommunityRating,
|
||||||
AspectRatio = program.AspectRatio
|
AspectRatio = program.AspectRatio,
|
||||||
|
IsRepeat = program.IsRepeat,
|
||||||
|
EpisodeTitle = program.EpisodeTitle
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,21 +299,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
|
|
||||||
var returnArray = programs.ToArray();
|
var returnArray = programs.ToArray();
|
||||||
|
|
||||||
var recordings = await GetRecordings(new RecordingQuery
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}, cancellationToken).ConfigureAwait(false);
|
|
||||||
|
|
||||||
foreach (var program in returnArray)
|
|
||||||
{
|
|
||||||
var recording = recordings.Items
|
|
||||||
.FirstOrDefault(i => string.Equals(i.ProgramId, program.Id));
|
|
||||||
|
|
||||||
program.RecordingId = recording == null ? null : recording.Id;
|
|
||||||
program.RecordingStatus = recording == null ? (RecordingStatus?)null : recording.Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new QueryResult<ProgramInfoDto>
|
return new QueryResult<ProgramInfoDto>
|
||||||
{
|
{
|
||||||
Items = returnArray,
|
Items = returnArray,
|
||||||
|
@ -400,7 +387,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
Id = id,
|
Id = id,
|
||||||
ExternalId = info.Id,
|
ExternalId = info.Id,
|
||||||
ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"),
|
ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"),
|
||||||
Status = info.Status
|
Status = info.Status,
|
||||||
|
Path = info.Path,
|
||||||
|
Genres = info.Genres,
|
||||||
|
IsRepeat = info.IsRepeat,
|
||||||
|
EpisodeTitle = info.EpisodeTitle
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.ProgramId))
|
if (!string.IsNullOrEmpty(info.ProgramId))
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
|
||||||
if (itemByName != null)
|
if (itemByName != null)
|
||||||
{
|
{
|
||||||
var counts = itemByName.GetItemByNameCounts(User);
|
var counts = itemByName.GetItemByNameCounts(User.Id);
|
||||||
|
|
||||||
if (counts != null)
|
if (counts != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.256</version>
|
<version>3.0.257</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.256" />
|
<dependency id="MediaBrowser.Common" version="3.0.257" />
|
||||||
<dependency id="NLog" version="2.1.0" />
|
<dependency id="NLog" version="2.1.0" />
|
||||||
<dependency id="ServiceStack.Text" version="3.9.58" />
|
<dependency id="ServiceStack.Text" version="3.9.58" />
|
||||||
<dependency id="SimpleInjector" version="2.3.6" />
|
<dependency id="SimpleInjector" version="2.3.6" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.256</version>
|
<version>3.0.257</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.256</version>
|
<version>3.0.257</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.256" />
|
<dependency id="MediaBrowser.Common" version="3.0.257" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user