mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
fix refresh of tv recordings
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user