mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
restored external subtitle support
This commit is contained in:
@@ -57,7 +57,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public List<string> PhysicalLocationsList { get; set; }
|
||||
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(DirectoryService directoryService)
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return CreateResolveArgs().FileSystemChildren;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Get the children of this folder from the actual file system
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
protected override IEnumerable<BaseItem> GetNonCachedChildren(DirectoryService directoryService)
|
||||
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return base.GetNonCachedChildren(directoryService).Concat(_virtualChildren);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, DirectoryService directoryService)
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||
{
|
||||
if (IsAccessedByName)
|
||||
{
|
||||
|
||||
@@ -563,6 +563,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var locationType = LocationType;
|
||||
|
||||
var requiresSave = false;
|
||||
|
||||
if (IsFolder || Parent != null)
|
||||
{
|
||||
options.DirectoryService = options.DirectoryService ?? new DirectoryService(Logger);
|
||||
@@ -571,13 +573,34 @@ namespace MediaBrowser.Controller.Entities
|
||||
GetFileSystemChildren(options.DirectoryService).ToList() :
|
||||
new List<FileSystemInfo>();
|
||||
|
||||
await BeforeRefreshMetadata(options, files, cancellationToken).ConfigureAwait(false);
|
||||
var ownedItemsChanged = await RefreshedOwnedItems(options, files, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (ownedItemsChanged)
|
||||
{
|
||||
requiresSave = true;
|
||||
}
|
||||
}
|
||||
|
||||
var dateLastSaved = DateLastSaved;
|
||||
|
||||
await ProviderManager.RefreshMetadata(this, options, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// If it wasn't saved by the provider process, save now
|
||||
if (requiresSave && dateLastSaved == DateLastSaved)
|
||||
{
|
||||
await UpdateToRepository(ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual async Task BeforeRefreshMetadata(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
/// <summary>
|
||||
/// Refreshes owned items such as trailers, theme videos, special features, etc.
|
||||
/// Returns true or false indicating if changes were found.
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="fileSystemChildren"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
var themeSongsChanged = false;
|
||||
|
||||
@@ -605,13 +628,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (themeSongsChanged || themeVideosChanged || localTrailersChanged)
|
||||
{
|
||||
options.ForceSave = true;
|
||||
}
|
||||
return themeSongsChanged || themeVideosChanged || localTrailersChanged;
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<FileSystemInfo> GetFileSystemChildren(DirectoryService directoryService)
|
||||
protected virtual IEnumerable<FileSystemInfo> GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
var path = ContainingFolderPath;
|
||||
|
||||
@@ -1205,7 +1225,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Validates that images within the item are still on the file system
|
||||
/// </summary>
|
||||
public bool ValidateImages(DirectoryService directoryService)
|
||||
public bool ValidateImages(IDirectoryService directoryService)
|
||||
{
|
||||
var allDirectories = ImageInfos.Select(i => System.IO.Path.GetDirectoryName(i.Path)).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
|
||||
var allFiles = allDirectories.SelectMany(directoryService.GetFiles).Select(i => i.FullName).ToList();
|
||||
@@ -1390,5 +1410,22 @@ namespace MediaBrowser.Controller.Entities
|
||||
ParentIndexNumber = ParentIndexNumber
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns ItemUpdateType indictating if changes were made, and what.
|
||||
/// </summary>
|
||||
/// <returns>ItemUpdateType.</returns>
|
||||
public virtual ItemUpdateType BeforeMetadataRefresh()
|
||||
{
|
||||
var updateType = ItemUpdateType.None;
|
||||
|
||||
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))
|
||||
{
|
||||
Name = System.IO.Path.GetFileNameWithoutExtension(Path);
|
||||
updateType = updateType | ItemUpdateType.MetadataEdit;
|
||||
}
|
||||
|
||||
return updateType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public List<string> PhysicalLocationsList { get; set; }
|
||||
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(DirectoryService directoryService)
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return CreateResolveArgs().FileSystemChildren;
|
||||
}
|
||||
@@ -119,8 +119,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <param name="recursive">if set to <c>true</c> [recursive].</param>
|
||||
/// <param name="refreshChildMetadata">if set to <c>true</c> [refresh child metadata].</param>
|
||||
/// <param name="refreshOptions">The refresh options.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <returns>Task.</returns>
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, DirectoryService directoryService)
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||
{
|
||||
CreateResolveArgs();
|
||||
ResetDynamicChildren();
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return ValidateChildrenWithCancellationSupport(progress, cancellationToken, recursive, true, metadataRefreshOptions, metadataRefreshOptions.DirectoryService);
|
||||
}
|
||||
|
||||
private async Task ValidateChildrenWithCancellationSupport(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, DirectoryService directoryService)
|
||||
private async Task ValidateChildrenWithCancellationSupport(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <param name="refreshOptions">The refresh options.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <returns>Task.</returns>
|
||||
protected async virtual Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, DirectoryService directoryService)
|
||||
protected async virtual Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||
{
|
||||
var locationType = LocationType;
|
||||
|
||||
@@ -593,7 +593,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <param name="progress">The progress.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private async Task ValidateSubFolders(IList<Folder> children, DirectoryService directoryService, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
private async Task ValidateSubFolders(IList<Folder> children, IDirectoryService directoryService, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var list = children;
|
||||
var childCount = list.Count;
|
||||
@@ -679,7 +679,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Get the children of this folder from the actual file system
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
protected virtual IEnumerable<BaseItem> GetNonCachedChildren(DirectoryService directoryService)
|
||||
protected virtual IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return LibraryManager.ResolvePaths<BaseItem>(GetFileSystemChildren(directoryService), this);
|
||||
}
|
||||
@@ -927,17 +927,21 @@ namespace MediaBrowser.Controller.Entities
|
||||
return item;
|
||||
}
|
||||
|
||||
protected override Task BeforeRefreshMetadata(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
var changesFound = false;
|
||||
|
||||
if (SupportsShortcutChildren && LocationType == LocationType.FileSystem)
|
||||
{
|
||||
if (RefreshLinkedChildren(fileSystemChildren))
|
||||
{
|
||||
options.ForceSave = true;
|
||||
changesFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
return base.BeforeRefreshMetadata(options, fileSystemChildren, cancellationToken);
|
||||
var baseHasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return baseHasChanges || changesFound;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.IO;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
@@ -109,7 +109,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <summary>
|
||||
/// Validates the images and returns true or false indicating if any were removed.
|
||||
/// </summary>
|
||||
bool ValidateImages(DirectoryService directoryService);
|
||||
bool ValidateImages(IDirectoryService directoryService);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is owned item.
|
||||
@@ -166,5 +166,16 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
item.SetImagePath(imageType, 0, file);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the image path.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="imageType">Type of the image.</param>
|
||||
/// <param name="file">The file.</param>
|
||||
public static void SetImagePath(this IHasImages item, ImageType imageType, string file)
|
||||
{
|
||||
item.SetImagePath(imageType, new FileInfo(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
@@ -49,5 +49,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns ItemUpdateType indictating if changes were made, and what.
|
||||
/// </summary>
|
||||
/// <returns>ItemUpdateType.</returns>
|
||||
ItemUpdateType BeforeMetadataRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,9 +96,9 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
return this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? base.GetUserDataKey();
|
||||
}
|
||||
|
||||
protected override async Task BeforeRefreshMetadata(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
await base.BeforeRefreshMetadata(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Must have a parent to have special features
|
||||
// In other words, it must be part of the Parent/Child tree
|
||||
@@ -108,9 +108,11 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
|
||||
if (specialFeaturesChanged)
|
||||
{
|
||||
options.ForceSave = true;
|
||||
hasChanges = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasChanges;
|
||||
}
|
||||
|
||||
private async Task<bool> RefreshSpecialFeatures(MetadataRefreshOptions options, IEnumerable<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -260,5 +262,54 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public override ItemUpdateType BeforeMetadataRefresh()
|
||||
{
|
||||
var updateType = base.BeforeMetadataRefresh();
|
||||
|
||||
var locationType = LocationType;
|
||||
if (locationType == LocationType.FileSystem || locationType == LocationType.Offline)
|
||||
{
|
||||
if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path))
|
||||
{
|
||||
IndexNumber = IndexNumber ?? TVUtils.GetEpisodeNumberFromFile(Path, Parent is Season);
|
||||
|
||||
// If a change was made record it
|
||||
if (IndexNumber.HasValue)
|
||||
{
|
||||
updateType = updateType | ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
|
||||
if (!IndexNumberEnd.HasValue && !string.IsNullOrEmpty(Path))
|
||||
{
|
||||
IndexNumberEnd = IndexNumberEnd ?? TVUtils.GetEndingEpisodeNumberFromFile(Path);
|
||||
|
||||
// If a change was made record it
|
||||
if (IndexNumberEnd.HasValue)
|
||||
{
|
||||
updateType = updateType | ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ParentIndexNumber.HasValue)
|
||||
{
|
||||
var season = Season;
|
||||
|
||||
if (season != null)
|
||||
{
|
||||
ParentIndexNumber = season.IndexNumber;
|
||||
}
|
||||
|
||||
// If a change was made record it
|
||||
if (ParentIndexNumber.HasValue)
|
||||
{
|
||||
updateType = updateType | ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
|
||||
return updateType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -243,9 +244,40 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the lookup information.
|
||||
/// </summary>
|
||||
/// <returns>SeasonInfo.</returns>
|
||||
public SeasonInfo GetLookupInfo()
|
||||
{
|
||||
return GetItemLookupInfo<SeasonInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called before any metadata refresh and returns ItemUpdateType indictating if changes were made, and what.
|
||||
/// </summary>
|
||||
/// <returns>ItemUpdateType.</returns>
|
||||
public override ItemUpdateType BeforeMetadataRefresh()
|
||||
{
|
||||
var updateType = base.BeforeMetadataRefresh();
|
||||
|
||||
var locationType = LocationType;
|
||||
|
||||
if (locationType == LocationType.FileSystem || locationType == LocationType.Offline)
|
||||
{
|
||||
if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path))
|
||||
{
|
||||
IndexNumber = IndexNumber ?? TVUtils.GetSeasonNumberFromPath(Path);
|
||||
|
||||
// If a change was made record it
|
||||
if (IndexNumber.HasValue)
|
||||
{
|
||||
updateType = updateType | ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return updateType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Get the children of this folder from the actual file system
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
protected override IEnumerable<BaseItem> GetNonCachedChildren(DirectoryService directoryService)
|
||||
protected override IEnumerable<BaseItem> GetNonCachedChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return base.GetNonCachedChildren(directoryService).Concat(LibraryManager.RootFolder.VirtualChildren);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
PlayableStreamFileNames = new List<string>();
|
||||
AdditionalPartIds = new List<Guid>();
|
||||
Tags = new List<string>();
|
||||
SubtitleFiles = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the subtitle paths.
|
||||
/// </summary>
|
||||
/// <value>The subtitle paths.</value>
|
||||
public List<string> SubtitleFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has subtitles.
|
||||
/// </summary>
|
||||
@@ -156,9 +163,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task BeforeRefreshMetadata(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
|
||||
{
|
||||
await base.BeforeRefreshMetadata(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Must have a parent to have additional parts
|
||||
// In other words, it must be part of the Parent/Child tree
|
||||
@@ -169,9 +176,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (additionalPartsChanged)
|
||||
{
|
||||
options.ForceSave = true;
|
||||
hasChanges = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasChanges;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace MediaBrowser.Controller.Library
|
||||
[Flags]
|
||||
public enum ItemUpdateType
|
||||
{
|
||||
Unspecified = 1,
|
||||
None = 1,
|
||||
MetadataImport = 2,
|
||||
ImageUpdate = 4,
|
||||
MetadataDownload = 8,
|
||||
|
||||
@@ -6,7 +6,16 @@ using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public class DirectoryService
|
||||
public interface IDirectoryService
|
||||
{
|
||||
List<FileSystemInfo> GetFileSystemEntries(string path);
|
||||
IEnumerable<FileInfo> GetFiles(string path);
|
||||
IEnumerable<DirectoryInfo> GetDirectories(string path);
|
||||
FileInfo GetFile(string path);
|
||||
DirectoryInfo GetDirectory(string path);
|
||||
}
|
||||
|
||||
public class DirectoryService : IDirectoryService
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
public interface ICustomMetadataProvider<TItemType> : IMetadataProvider<TItemType>, ICustomMetadataProvider
|
||||
where TItemType : IHasMetadata
|
||||
{
|
||||
Task<ItemUpdateType> FetchAsync(TItemType item, CancellationToken cancellationToken);
|
||||
Task<ItemUpdateType> FetchAsync(TItemType item, IDirectoryService directoryService, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// Determines whether the specified item has changed.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="date">The date.</param>
|
||||
/// <returns><c>true</c> if the specified item has changed; otherwise, <c>false</c>.</returns>
|
||||
bool HasChanged(IHasMetadata item, DateTime date);
|
||||
bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public interface ILocalImageFileProvider : ILocalImageProvider
|
||||
{
|
||||
List<LocalImageInfo> GetImages(IHasImages item, DirectoryService directoryService);
|
||||
List<LocalImageInfo> GetImages(IHasImages item, IDirectoryService directoryService);
|
||||
}
|
||||
|
||||
public class LocalImageInfo
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
@@ -17,13 +16,12 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
public bool ForceSave { get; set; }
|
||||
|
||||
public DirectoryService DirectoryService { get; set; }
|
||||
}
|
||||
|
||||
public class ImageRefreshOptions
|
||||
{
|
||||
public ImageRefreshMode ImageRefreshMode { get; set; }
|
||||
public IDirectoryService DirectoryService { get; set; }
|
||||
|
||||
public ImageRefreshOptions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user