aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs10
-rw-r--r--MediaBrowser.Controller/Entities/IHasMediaSources.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Video.cs39
3 files changed, 44 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index b08834784..11c0a5747 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -648,15 +648,15 @@ namespace MediaBrowser.Controller.Entities
public static bool IsPathOffline(string path, List<string> allLibraryPaths)
{
- if (FileSystem.FileExists(path))
- {
- return false;
- }
+ //if (FileSystem.FileExists(path))
+ //{
+ // return false;
+ //}
var originalPath = path;
// Depending on whether the path is local or unc, it may return either null or '\' at the top
- while (!string.IsNullOrEmpty(path) && path.Length > 1)
+ while (!string.IsNullOrWhiteSpace(path) && path.Length > 1)
{
if (FileSystem.DirectoryExists(path))
{
diff --git a/MediaBrowser.Controller/Entities/IHasMediaSources.cs b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
index bf4acdfbd..54786134f 100644
--- a/MediaBrowser.Controller/Entities/IHasMediaSources.cs
+++ b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
@@ -4,7 +4,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Entities
{
- public interface IHasMediaSources : IHasUserData
+ public interface IHasMediaSources : IHasMetadata
{
/// <summary>
/// Gets the media sources.
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)