add more methods to file system interface

This commit is contained in:
Luke Pulverenti
2014-01-01 13:26:31 -05:00
parent 88b638fbd6
commit b9d17c9bc7
54 changed files with 737 additions and 459 deletions

View File

@@ -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.

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

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

View File

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