diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-23 15:45:52 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-08-23 15:45:52 -0400 |
| commit | afd94407f9bad2030344e93c1ce04008209a65af (patch) | |
| tree | 9886877a462cfd3ee76aae1fcaa6e71b3c1b5b7c /MediaBrowser.Controller/Entities/Video.cs | |
| parent | 82ab91f20971f46b8da97c0557fb0db38fe856bb (diff) | |
rework active recordings
Diffstat (limited to 'MediaBrowser.Controller/Entities/Video.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Video.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index fa11787f5..3918ac8fc 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -160,7 +160,7 @@ namespace MediaBrowser.Controller.Entities public string[] GetPlayableStreamFileNames() { - return GetPlayableStreamFiles().Select(System.IO.Path.GetFileName).ToArray(); + return GetPlayableStreamFiles().Select(System.IO.Path.GetFileName).ToArray(); } /// <summary> @@ -235,6 +235,35 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] + public override SourceType SourceType + { + get + { + if (IsActiveRecording()) + { + return SourceType.LiveTV; + } + + return base.SourceType; + } + } + + protected bool IsActiveRecording() + { + return LiveTvManager.GetActiveRecordingInfo(Path) != null; + } + + public override bool CanDelete() + { + if (IsActiveRecording()) + { + return false; + } + + return base.CanDelete(); + } + + [IgnoreDataMember] protected virtual bool EnableDefaultVideoUserDataKeys { get @@ -616,6 +645,14 @@ namespace MediaBrowser.Controller.Entities var list = GetAllVideosForMediaSources(); var result = list.Select(i => GetVersionInfo(enablePathSubstitution, i.Item1, i.Item2)).ToList(); + if (IsActiveRecording()) + { + foreach (var mediaSource in result) + { + mediaSource.Type = MediaSourceType.Placeholder; + } + } + return result.OrderBy(i => { if (i.VideoType == VideoType.VideoFile) |
