mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
more work on channel downloading
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user