more work on channel downloading

This commit is contained in:
Luke Pulverenti
2014-06-02 22:01:30 -04:00
parent 858c37b860
commit c91ea99016
14 changed files with 385 additions and 280 deletions

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Globalization;
@@ -10,6 +11,8 @@ namespace MediaBrowser.Controller.Channels
{
public class ChannelVideoItem : Video, IChannelMediaItem
{
public static IChannelManager ChannelManager { get; set; }
public string ExternalId { get; set; }
public string ChannelId { get; set; }
@@ -77,5 +80,14 @@ namespace MediaBrowser.Controller.Channels
return base.LocationType;
}
}
public override IEnumerable<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
{
var list = base.GetMediaSources(enablePathSubstitution).ToList();
list.InsertRange(0, ChannelManager.GetCachedChannelItemMediaSources(Id.ToString("N")));
return list;
}
}
}

View File

@@ -66,12 +66,19 @@ namespace MediaBrowser.Controller.Channels
/// <returns>Task{QueryResult{BaseItemDto}}.</returns>
Task<QueryResult<BaseItemDto>> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken);
/// <summary>
/// Gets the cached channel item media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>IEnumerable{MediaSourceInfo}.</returns>
IEnumerable<MediaSourceInfo> GetCachedChannelItemMediaSources(string id);
/// <summary>
/// Gets the channel item media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{ChannelMediaInfo}}.</returns>
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken);
}
}