aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-03 00:11:03 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-03-03 00:11:03 -0500
commit6efb78b8b2c023369d18097ba8d17c396faabce1 (patch)
tree487a5caef53728e40f8046bfdca9503cd32b4152 /MediaBrowser.Controller/Entities
parent2db452f68f64fe4182e8ef3e83cc236c61fa8d82 (diff)
fixes #697 - Support xbmc offline discs
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs14
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs22
-rw-r--r--MediaBrowser.Controller/Entities/Game.cs8
-rw-r--r--MediaBrowser.Controller/Entities/IHasMetadata.cs6
-rw-r--r--MediaBrowser.Controller/Entities/ISupportsPlaceHolders.cs12
-rw-r--r--MediaBrowser.Controller/Entities/Video.cs4
6 files changed, 47 insertions, 19 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index f7f2346a8..923673bd8 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -229,19 +229,7 @@ namespace MediaBrowser.Controller.Entities
}
}
- [IgnoreDataMember]
- public bool IsUnidentified
- {
- get
- {
- if (ProviderIds.Any())
- {
- return false;
- }
-
- return false;
- }
- }
+ public bool IsUnidentified { get; set; }
/// <summary>
/// Gets or sets the locked fields.
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 522bc3a2d..627f657ab 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -352,6 +352,26 @@ namespace MediaBrowser.Controller.Entities
return dictionary;
}
+ private bool IsValidFromResolver(BaseItem current, BaseItem newItem)
+ {
+ var currentAsPlaceHolder = current as ISupportsPlaceHolders;
+
+ if (currentAsPlaceHolder != null)
+ {
+ var newHasPlaceHolder = newItem as ISupportsPlaceHolders;
+
+ if (newHasPlaceHolder != null)
+ {
+ if (currentAsPlaceHolder.IsPlaceHolder != newHasPlaceHolder.IsPlaceHolder)
+ {
+ return false;
+ }
+ }
+ }
+
+ return current.IsInMixedFolder == newItem.IsInMixedFolder;
+ }
+
/// <summary>
/// Validates the children internal.
/// </summary>
@@ -401,7 +421,7 @@ namespace MediaBrowser.Controller.Entities
{
BaseItem currentChild;
- if (currentChildren.TryGetValue(child.Id, out currentChild) && child.IsInMixedFolder == currentChild.IsInMixedFolder)
+ if (currentChildren.TryGetValue(child.Id, out currentChild) && IsValidFromResolver(currentChild, child))
{
var currentChildLocationType = currentChild.LocationType;
if (currentChildLocationType != LocationType.Remote &&
diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.cs
index e490a59cd..062bdfa88 100644
--- a/MediaBrowser.Controller/Entities/Game.cs
+++ b/MediaBrowser.Controller/Entities/Game.cs
@@ -7,7 +7,7 @@ using System.Linq;
namespace MediaBrowser.Controller.Entities
{
- public class Game : BaseItem, IHasSoundtracks, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, IHasPreferredMetadataLanguage, IHasLookupInfo<GameInfo>
+ public class Game : BaseItem, IHasSoundtracks, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, ISupportsPlaceHolders, IHasPreferredMetadataLanguage, IHasLookupInfo<GameInfo>
{
public List<Guid> SoundtrackIds { get; set; }
@@ -63,10 +63,10 @@ namespace MediaBrowser.Controller.Entities
public int? PlayersSupported { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether this instance is installed on client.
+ /// Gets a value indicating whether this instance is place holder.
/// </summary>
- /// <value><c>true</c> if this instance is installed on client; otherwise, <c>false</c>.</value>
- public bool IsInstalledOnClient { get; set; }
+ /// <value><c>true</c> if this instance is place holder; otherwise, <c>false</c>.</value>
+ public bool IsPlaceHolder { get; set; }
/// <summary>
/// Gets or sets the game system.
diff --git a/MediaBrowser.Controller/Entities/IHasMetadata.cs b/MediaBrowser.Controller/Entities/IHasMetadata.cs
index 095db0815..91f37135f 100644
--- a/MediaBrowser.Controller/Entities/IHasMetadata.cs
+++ b/MediaBrowser.Controller/Entities/IHasMetadata.cs
@@ -49,5 +49,11 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool BeforeMetadataRefresh();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is unidentified.
+ /// </summary>
+ /// <value><c>true</c> if this instance is unidentified; otherwise, <c>false</c>.</value>
+ bool IsUnidentified { get; set; }
}
}
diff --git a/MediaBrowser.Controller/Entities/ISupportsPlaceHolders.cs b/MediaBrowser.Controller/Entities/ISupportsPlaceHolders.cs
new file mode 100644
index 000000000..2507c8ee6
--- /dev/null
+++ b/MediaBrowser.Controller/Entities/ISupportsPlaceHolders.cs
@@ -0,0 +1,12 @@
+
+namespace MediaBrowser.Controller.Entities
+{
+ public interface ISupportsPlaceHolders
+ {
+ /// <summary>
+ /// Gets a value indicating whether this instance is place holder.
+ /// </summary>
+ /// <value><c>true</c> if this instance is place holder; otherwise, <c>false</c>.</value>
+ bool IsPlaceHolder { get; }
+ }
+}
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs
index fa85f0edc..e61e958f5 100644
--- a/MediaBrowser.Controller/Entities/Video.cs
+++ b/MediaBrowser.Controller/Entities/Video.cs
@@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Video
/// </summary>
- public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio, IHasTags
+ public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio, IHasTags, ISupportsPlaceHolders
{
public bool IsMultiPart { get; set; }
@@ -42,6 +42,8 @@ namespace MediaBrowser.Controller.Entities
/// <value><c>true</c> if this instance has subtitles; otherwise, <c>false</c>.</value>
public bool HasSubtitles { get; set; }
+ public bool IsPlaceHolder { get; set; }
+
/// <summary>
/// Gets or sets the tags.
/// </summary>