updated nuget

This commit is contained in:
Luke Pulverenti 2013-12-02 16:46:22 -05:00
parent cd279d98e0
commit 245e92c9cc
37 changed files with 180 additions and 91 deletions

View File

@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess
{
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
public bool IsAccessedByName { get; set; }
@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.Entities.Audio
public MusicArtist()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
public MusicGenre()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities.Audio
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
}
}

View File

@ -9,7 +9,7 @@ namespace MediaBrowser.Controller.Entities
{
public GameGenre()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>
@ -22,6 +22,6 @@ namespace MediaBrowser.Controller.Entities
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
}
}

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
{
public Genre()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
}
}

View File

@ -1,6 +1,7 @@
using MediaBrowser.Model.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Controller.Entities
{
@ -9,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public interface IItemByName
{
Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
List<ItemByNameCounts> UserItemCountList { get; set; }
}
public interface IHasDualAccess : IItemByName
@ -17,23 +18,29 @@ namespace MediaBrowser.Controller.Entities
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);
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Dto;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities
{
@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities
{
public Person()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
/// <summary>
/// Gets the user data key.

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities
{
public Studio()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>
@ -25,6 +25,6 @@ namespace MediaBrowser.Controller.Entities
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
}
}

View File

@ -12,11 +12,11 @@ namespace MediaBrowser.Controller.Entities
{
public Year()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
/// <summary>
/// Gets the user data key.

View File

@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.LiveTv
{
public Channel()
{
UserItemCounts = new Dictionary<Guid, ItemByNameCounts>();
UserItemCountList = new List<ItemByNameCounts>();
}
/// <summary>
@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.LiveTv
}
[IgnoreDataMember]
public Dictionary<Guid, ItemByNameCounts> UserItemCounts { get; set; }
public List<ItemByNameCounts> UserItemCountList { get; set; }
/// <summary>
/// Gets or sets the number.

View File

@ -69,8 +69,16 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <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>
/// Gets the recordings asynchronous.
/// </summary>

View 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; }
}
}

View File

@ -77,6 +77,18 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
/// <value>The community rating.</value>
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()
{

View File

@ -1,5 +1,6 @@
using MediaBrowser.Model.LiveTv;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.LiveTv
{
@ -25,6 +26,12 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
public string Path { get; set; }
/// <summary>
/// Description of the recording.
/// </summary>
@ -51,5 +58,27 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
/// <value>The status.</value>
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>();
}
}
}

View File

@ -71,6 +71,12 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The days.</value>
public List<DayOfWeek> Days { get; set; }
/// <summary>
/// Gets or sets the priority.
/// </summary>
/// <value>The priority.</value>
public int Priority { get; set; }
public SeriesTimerInfo()
{
Days = new List<DayOfWeek>();

View File

@ -110,6 +110,7 @@
<Compile Include="LiveTv\ChannelInfo.cs" />
<Compile Include="LiveTv\ILiveTvManager.cs" />
<Compile Include="LiveTv\ILiveTvService.cs" />
<Compile Include="LiveTv\ImageResponseInfo.cs" />
<Compile Include="LiveTv\ProgramInfo.cs" />
<Compile Include="LiveTv\RecordingInfo.cs" />
<Compile Include="LiveTv\SeriesTimerInfo.cs" />

View File

@ -1,4 +1,5 @@

using System;
namespace MediaBrowser.Model.Dto
{
/// <summary>
@ -6,6 +7,8 @@ namespace MediaBrowser.Model.Dto
/// </summary>
public class ItemByNameCounts
{
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the total count.
/// </summary>

View File

@ -90,29 +90,17 @@ namespace MediaBrowser.Model.LiveTv
public DateTime? OriginalAirDate { get; set; }
/// <summary>
/// Gets or sets the recording identifier.
/// Gets or sets a value indicating whether this instance is repeat.
/// </summary>
/// <value>The recording identifier.</value>
public string RecordingId { get; set; }
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
public bool IsRepeat { get; set; }
/// <summary>
/// Gets or sets the recording status.
/// Gets or sets the episode title.
/// </summary>
/// <value>The recording status.</value>
public RecordingStatus? RecordingStatus { get; set; }
/// <value>The episode title.</value>
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()
{
Genres = new List<string>();

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.LiveTv
{
@ -14,13 +15,13 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
/// <value>The external identifier.</value>
public string ExternalId { get; set; }
/// <summary>
/// Gets or sets the program identifier.
/// </summary>
/// <value>The program identifier.</value>
public string ProgramId { get; set; }
/// <summary>
/// ChannelId of the recording.
/// </summary>
@ -36,6 +37,12 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
public string Path { get; set; }
/// <summary>
/// Description of the recording.
/// </summary>
@ -56,5 +63,27 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
/// <value>The status.</value>
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>();
}
}
}

View File

@ -129,17 +129,13 @@ namespace MediaBrowser.Server.Implementations.Dto
/// <param name="user">The user.</param>
private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
{
ItemByNameCounts counts;
if (user == null)
{
//counts = item.ItemCounts;
return;
}
if (!item.UserItemCounts.TryGetValue(user.Id, out counts))
{
counts = new ItemByNameCounts();
}
ItemByNameCounts counts = item.GetItemByNameCounts(user.Id) ?? new ItemByNameCounts();
dto.ChildCount = counts.TotalCount;

View File

@ -137,7 +137,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
if (userId.HasValue)
{
artist.UserItemCounts[userId.Value] = counts;
artist.SetItemByNameCounts(userId.Value, counts);
}
}

View File

@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
{
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
itemByName.UserItemCounts[libraryId] = itemCounts;
itemByName.SetItemByNameCounts(libraryId, itemCounts);
}
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);

View File

@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
{
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
itemByName.UserItemCounts[libraryId] = itemCounts;
itemByName.SetItemByNameCounts(libraryId, itemCounts);
}
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);

View File

@ -107,7 +107,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
{
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
itemByName.UserItemCounts[libraryId] = itemCounts;
itemByName.SetItemByNameCounts(libraryId, itemCounts);
}
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);

View File

@ -94,7 +94,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
{
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
itemByName.UserItemCounts[libraryId] = itemCounts;
itemByName.SetItemByNameCounts(libraryId, itemCounts);
}
}
catch (Exception ex)

View File

@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
{
var itemCounts = CountHelpers.GetCounts(counts[libraryId]);
itemByName.UserItemCounts[libraryId] = itemCounts;
itemByName.SetItemByNameCounts(libraryId, itemCounts);
}
await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);

View File

@ -75,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
// Dummy up the original url
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);
}
}

View File

@ -209,7 +209,9 @@ namespace MediaBrowser.Server.Implementations.LiveTv
OriginalAirDate = program.OriginalAirDate,
Audio = program.Audio,
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 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>
{
Items = returnArray,
@ -400,7 +387,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Id = id,
ExternalId = info.Id,
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))

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
if (itemByName != null)
{
var counts = itemByName.GetItemByNameCounts(User);
var counts = itemByName.GetItemByNameCounts(User.Id);
if (counts != null)
{

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.256</version>
<version>3.0.257</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<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>
<copyright>Copyright © Media Browser 2013</copyright>
<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="ServiceStack.Text" version="3.9.58" />
<dependency id="SimpleInjector" version="2.3.6" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.256</version>
<version>3.0.257</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.256</version>
<version>3.0.257</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.256" />
<dependency id="MediaBrowser.Common" version="3.0.257" />
</dependencies>
</metadata>
<files>