fix channel query by category

This commit is contained in:
Luke Pulverenti 2014-05-17 17:23:48 -04:00
parent 715119b525
commit ca5989cb17
4 changed files with 28 additions and 1 deletions

View File

@ -133,6 +133,12 @@ namespace MediaBrowser.Model.Dto
/// <value>The custom rating.</value> /// <value>The custom rating.</value>
public string CustomRating { get; set; } public string CustomRating { get; set; }
/// <summary>
/// Gets or sets the channel identifier.
/// </summary>
/// <value>The channel identifier.</value>
public string ChannelId { get; set; }
/// <summary> /// <summary>
/// Gets or sets the overview. /// Gets or sets the overview.
/// </summary> /// </summary>

View File

@ -385,6 +385,11 @@ namespace MediaBrowser.Server.Implementations.Channels
private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, string internalChannnelId, CancellationToken cancellationToken) private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, string internalChannnelId, CancellationToken cancellationToken)
{ {
if (string.IsNullOrEmpty(internalChannnelId))
{
throw new ArgumentNullException("internalChannnelId");
}
BaseItem item; BaseItem item;
Guid id; Guid id;
var isNew = false; var isNew = false;

View File

@ -1,5 +1,6 @@
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Dto;
@ -1140,6 +1141,13 @@ namespace MediaBrowser.Server.Implementations.Dto
{ {
dto.MediaSources = GetMediaSources(tvChannel); dto.MediaSources = GetMediaSources(tvChannel);
} }
var channelItem = item as IChannelItem;
if (channelItem != null)
{
dto.ChannelId = channelItem.ChannelId;
}
} }
public List<MediaSourceInfo> GetMediaSources(BaseItem item) public List<MediaSourceInfo> GetMediaSources(BaseItem item)

View File

@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.Session namespace MediaBrowser.Server.Implementations.Session
{ {
public class WebSocketController : ISessionController public class WebSocketController : ISessionController, IDisposable
{ {
public SessionInfo Session { get; private set; } public SessionInfo Session { get; private set; }
public IReadOnlyList<IWebSocketConnection> Sockets { get; private set; } public IReadOnlyList<IWebSocketConnection> Sockets { get; private set; }
@ -244,5 +244,13 @@ namespace MediaBrowser.Server.Implementations.Session
return Task.WhenAll(tasks); return Task.WhenAll(tasks);
} }
public void Dispose()
{
foreach (var socket in Sockets.ToList())
{
socket.Closed -= connection_Closed;
}
}
} }
} }