diff options
| author | Tim Hobbs <jesus.tesh@gmail.com> | 2014-03-05 04:27:13 -0800 |
|---|---|---|
| committer | Tim Hobbs <jesus.tesh@gmail.com> | 2014-03-05 04:27:13 -0800 |
| commit | 482fde658746750075ff8a562ca1fb88f1739ef4 (patch) | |
| tree | 7bd5084ffa6be20a4533eb37d94f852f2d888a84 /MediaBrowser.Controller/Entities | |
| parent | 604f971477da4dca5247f7d531323175ad044150 (diff) | |
| parent | 9396f16aed2f304789324afc83e0c9f385c5f00a (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Conflicts:
MediaBrowser.WebDashboard/dashboard-ui/scripts/mediaplayer.js
Diffstat (limited to 'MediaBrowser.Controller/Entities')
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/CollectionFolder.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 22 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Game.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/IHasMetadata.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/ISupportsPlaceHolders.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Episode.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Video.cs | 18 |
8 files changed, 58 insertions, 22 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 9d520cf6f..923673bd8 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -229,6 +229,8 @@ namespace MediaBrowser.Controller.Entities } } + public bool IsUnidentified { get; set; } + /// <summary> /// Gets or sets the locked fields. /// </summary> diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 2d47cf632..6628ffc23 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -149,7 +149,7 @@ namespace MediaBrowser.Controller.Entities try { - locationsDicionary = PhysicalLocations.Distinct().ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); + locationsDicionary = PhysicalLocations.Distinct(StringComparer.OrdinalIgnoreCase).ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); } catch (IOException ex) { @@ -181,7 +181,7 @@ namespace MediaBrowser.Controller.Entities try { - locationsDicionary = PhysicalLocations.Distinct().ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); + locationsDicionary = PhysicalLocations.Distinct(StringComparer.OrdinalIgnoreCase).ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); } catch (IOException ex) { 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 7182d086a..91f37135f 100644 --- a/MediaBrowser.Controller/Entities/IHasMetadata.cs +++ b/MediaBrowser.Controller/Entities/IHasMetadata.cs @@ -37,12 +37,6 @@ namespace MediaBrowser.Controller.Entities DateTime DateLastSaved { get; set; } /// <summary> - /// Gets a value indicating whether this instance is in mixed folder. - /// </summary> - /// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value> - bool IsInMixedFolder { get; } - - /// <summary> /// Updates to repository. /// </summary> /// <param name="updateReason">The update reason.</param> @@ -55,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/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 4a3c82b46..503d1513c 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -185,7 +185,7 @@ namespace MediaBrowser.Controller.Entities.TV { get { - return LocationType == LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; + return LocationType == LocationType.Virtual && !IsUnaired; } } diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index fa85f0edc..10034d7e5 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> @@ -108,10 +110,13 @@ namespace MediaBrowser.Controller.Entities return System.IO.Path.GetDirectoryName(Path); } - if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd || - VideoType == VideoType.HdDvd) + if (!IsPlaceHolder) { - return Path; + if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd || + VideoType == VideoType.HdDvd) + { + return Path; + } } return base.ContainingFolderPath; @@ -257,10 +262,7 @@ namespace MediaBrowser.Controller.Entities { if (!IsInMixedFolder) { - if (VideoType == VideoType.VideoFile || VideoType == VideoType.Iso) - { - return new[] { System.IO.Path.GetDirectoryName(Path) }; - } + return new[] { ContainingFolderPath }; } return base.GetDeletePaths(); |
