diff options
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 45 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/IHasImages.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Episode.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/UserRootFolder.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs | 13 |
7 files changed, 40 insertions, 69 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 38f40ea48..8dcf08642 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -157,6 +157,16 @@ namespace MediaBrowser.Controller.Entities } } + public virtual bool SupportsLocalMetadata + { + get + { + var locationType = LocationType; + + return locationType == LocationType.FileSystem || locationType == LocationType.Offline; + } + } + /// <summary> /// This is just a helper for convenience /// </summary> diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index f0b044d43..310ddf64c 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1052,50 +1052,17 @@ namespace MediaBrowser.Controller.Entities throw new ArgumentNullException(); } - try + if (string.Equals(Path, path, StringComparison.OrdinalIgnoreCase)) { - var locationType = LocationType; - - if (locationType == LocationType.Remote && string.Equals(Path, path, StringComparison.OrdinalIgnoreCase)) - { - return this; - } - - if (locationType != LocationType.Virtual && PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)) - { - return this; - } - } - catch (IOException ex) - { - Logger.ErrorException("Error getting ResolveArgs for {0}", ex, Path); + return this; } - return RecursiveChildren.Where(i => i.LocationType != LocationType.Virtual).FirstOrDefault(i => + if (PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)) { - try - { - if (string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase)) - { - return true; - } - - if (i.LocationType != LocationType.Remote) - { - if (i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)) - { - return true; - } - } + return this; + } - return false; - } - catch (IOException ex) - { - Logger.ErrorException("Error getting ResolveArgs for {0}", ex, Path); - return false; - } - }); + return RecursiveChildren.FirstOrDefault(i => string.Equals(i.Path, path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase)); } public override bool IsPlayed(User user) diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index eee169363..d53eba11a 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -136,6 +136,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <returns><c>true</c> if [is save local metadata enabled]; otherwise, <c>false</c>.</returns> bool IsSaveLocalMetadataEnabled(); + + /// <summary> + /// Gets a value indicating whether [supports local metadata]. + /// </summary> + /// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value> + bool SupportsLocalMetadata { get; } } public static class HasImagesExtensions diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 39c11569a..daff3dd6c 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 == Model.Entities.LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; + return LocationType == LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; } } @@ -198,7 +198,7 @@ namespace MediaBrowser.Controller.Entities.TV [IgnoreDataMember] public bool IsVirtualUnaired { - get { return LocationType == Model.Entities.LocationType.Virtual && IsUnaired; } + get { return LocationType == LocationType.Virtual && IsUnaired; } } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index 9afcdfe67..dc3d4c384 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; -using System.Linq; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; +using System.Collections.Generic; +using System.Linq; namespace MediaBrowser.Controller.Entities { @@ -18,5 +19,18 @@ namespace MediaBrowser.Controller.Entities { return base.GetNonCachedChildren(directoryService).Concat(LibraryManager.RootFolder.VirtualChildren); } + + public override ItemUpdateType BeforeMetadataRefresh() + { + var updateType = base.BeforeMetadataRefresh(); + + if (string.Equals("default", Name, System.StringComparison.OrdinalIgnoreCase)) + { + Name = "Default Media Library"; + updateType = updateType | ItemUpdateType.MetadataEdit; + } + + return updateType; + } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index f093ef7cb..81515a2e9 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -26,19 +26,6 @@ namespace MediaBrowser.Controller.LiveTv public string ServiceName { get; set; } /// <summary> - /// Returns the folder containing the item. - /// If the item is a folder, it returns the folder itself - /// </summary> - /// <value>The containing folder path.</value> - public override string ContainingFolderPath - { - get - { - return Path; - } - } - - /// <summary> /// Gets a value indicating whether this instance is owned item. /// </summary> /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value> diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index aad760cc9..3f8d67e3b 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -47,19 +47,6 @@ namespace MediaBrowser.Controller.LiveTv } /// <summary> - /// Returns the folder containing the item. - /// If the item is a folder, it returns the folder itself - /// </summary> - /// <value>The containing folder path.</value> - public override string ContainingFolderPath - { - get - { - return Path; - } - } - - /// <summary> /// Gets a value indicating whether this instance is owned item. /// </summary> /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value> |
