fix refresh of tv recordings

This commit is contained in:
Luke Pulverenti
2014-02-10 15:11:46 -05:00
parent 326fa5a670
commit cf9ef0e43d
34 changed files with 88 additions and 187 deletions

View File

@@ -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>

View File

@@ -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;
}
return this;
}
if (i.LocationType != LocationType.Remote)
{
if (i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase))
{
return true;
}
}
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)

View File

@@ -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

View File

@@ -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]

View File

@@ -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;
}
}
}

View File

@@ -25,19 +25,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>

View File

@@ -46,19 +46,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>