mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-14 03:30:25 +01:00
add more methods to file system interface
This commit is contained in:
@@ -153,7 +153,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>LiveTvRecording.</returns>
|
||||
Task<LiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken);
|
||||
Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the recording stream.
|
||||
|
||||
26
MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs
Normal file
26
MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public interface ILiveTvRecording : IHasImages, IHasMediaStreams
|
||||
{
|
||||
string ServiceName { get; set; }
|
||||
|
||||
string MediaType { get; }
|
||||
|
||||
LocationType LocationType { get; }
|
||||
|
||||
RecordingInfo RecordingInfo { get; set; }
|
||||
|
||||
string GetClientTypeName();
|
||||
|
||||
string GetUserDataKey();
|
||||
|
||||
bool IsParentalAllowed(User user);
|
||||
|
||||
Task<bool> RefreshMetadata(CancellationToken cancellationToken, bool forceSave = false, bool forceRefresh = false, bool allowSlowProviders = true, bool resetResolveArgs = true);
|
||||
}
|
||||
}
|
||||
52
MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
Normal file
52
MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public class LiveTvAudioRecording : Audio, ILiveTvRecording
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return GetClientTypeName() + "-" + Name;
|
||||
}
|
||||
|
||||
public RecordingInfo RecordingInfo { get; set; }
|
||||
|
||||
public string ServiceName { get; set; }
|
||||
|
||||
public override string MediaType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Model.Entities.MediaType.Audio;
|
||||
}
|
||||
}
|
||||
|
||||
public override LocationType LocationType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Path))
|
||||
{
|
||||
return base.LocationType;
|
||||
}
|
||||
|
||||
return LocationType.Remote;
|
||||
}
|
||||
}
|
||||
|
||||
public override string GetClientTypeName()
|
||||
{
|
||||
return "Recording";
|
||||
}
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
public class LiveTvRecording : BaseItem
|
||||
public class LiveTvVideoRecording : Video, ILiveTvRecording
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
@@ -23,7 +22,7 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
get
|
||||
{
|
||||
return RecordingInfo.ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video;
|
||||
return Model.Entities.MediaType.Video;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +30,11 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Path))
|
||||
{
|
||||
return base.LocationType;
|
||||
}
|
||||
|
||||
return LocationType.Remote;
|
||||
}
|
||||
}
|
||||
@@ -39,5 +43,10 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
return "Recording";
|
||||
}
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user