mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
added sync job database
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.LocalMetadata.Images
|
||||
{
|
||||
public class CollectionFolderLocalImageProvider : ILocalImageFileProvider, IHasOrder
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public CollectionFolderLocalImageProvider(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Collection Folder Images"; }
|
||||
@@ -29,7 +37,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
{
|
||||
var collectionFolder = (CollectionFolder)item;
|
||||
|
||||
return new LocalImageProvider().GetImages(item, collectionFolder.PhysicalLocations, directoryService);
|
||||
return new LocalImageProvider(_fileSystem).GetImages(item, collectionFolder.PhysicalLocations, directoryService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -11,6 +12,13 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
{
|
||||
public class EpisodeLocalLocalImageProvider : ILocalImageFileProvider
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public EpisodeLocalLocalImageProvider(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Local Images"; }
|
||||
@@ -27,7 +35,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
var parentPathFiles = directoryService.GetFileSystemEntries(parentPath);
|
||||
|
||||
var nameWithoutExtension = Path.GetFileNameWithoutExtension(item.Path);
|
||||
var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
||||
|
||||
var files = GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);
|
||||
|
||||
@@ -60,7 +68,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
if (BaseItem.SupportedImageExtensions.Contains(i.Extension, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var currentNameWithoutExtension = Path.GetFileNameWithoutExtension(i.Name);
|
||||
var currentNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
|
||||
|
||||
if (string.Equals(filenameWithoutExtension, currentNameWithoutExtension, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
try
|
||||
{
|
||||
return new LocalImageProvider().GetImages(item, path, directoryService);
|
||||
return new LocalImageProvider(_fileSystem).GetImages(item, path, directoryService);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.LocalMetadata.Images
|
||||
{
|
||||
public class InternalMetadataFolderImageProvider : ILocalImageFileProvider, IHasOrder
|
||||
{
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public InternalMetadataFolderImageProvider(IServerConfigurationManager config)
|
||||
public InternalMetadataFolderImageProvider(IServerConfigurationManager config, IFileSystem fileSystem)
|
||||
{
|
||||
_config = config;
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Name
|
||||
@@ -57,7 +60,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
try
|
||||
{
|
||||
return new LocalImageProvider().GetImages(item, path, directoryService);
|
||||
return new LocalImageProvider(_fileSystem).GetImages(item, path, directoryService);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.LocalMetadata.Images
|
||||
{
|
||||
public class LocalImageProvider : ILocalImageFileProvider
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public LocalImageProvider(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Local Images"; }
|
||||
@@ -117,7 +125,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
var baseItem = item as BaseItem;
|
||||
if (baseItem != null && baseItem.IsInMixedFolder)
|
||||
{
|
||||
imagePrefix = Path.GetFileNameWithoutExtension(item.Path) + "-";
|
||||
imagePrefix = _fileSystem.GetFileNameWithoutExtension(item.Path) + "-";
|
||||
}
|
||||
|
||||
PopulatePrimaryImages(item, images, files, imagePrefix);
|
||||
@@ -172,7 +180,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
if (!string.IsNullOrEmpty(item.Path))
|
||||
{
|
||||
var name = Path.GetFileNameWithoutExtension(item.Path);
|
||||
var name = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
@@ -188,7 +196,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
|
||||
if (!string.IsNullOrEmpty(item.Path))
|
||||
{
|
||||
var name = Path.GetFileNameWithoutExtension(item.Path);
|
||||
var name = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
@@ -259,6 +267,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
}
|
||||
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
|
||||
private void PopulateSeasonImagesFromSeriesFolder(Season season, List<LocalImageInfo> images, IDirectoryService directoryService)
|
||||
{
|
||||
var seasonNumber = season.IndexNumber;
|
||||
@@ -316,7 +325,7 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||
private FileSystemInfo GetImage(IEnumerable<FileSystemInfo> files, string name)
|
||||
{
|
||||
var candidates = files
|
||||
.Where(i => string.Equals(name, Path.GetFileNameWithoutExtension(i.Name), StringComparison.OrdinalIgnoreCase))
|
||||
.Where(i => string.Equals(name, _fileSystem.GetFileNameWithoutExtension(i), StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
|
||||
return BaseItem.SupportedImageExtensions
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace MediaBrowser.LocalMetadata.Providers
|
||||
|
||||
var directoryPath = directoryInfo.FullName;
|
||||
|
||||
var specificFile = Path.Combine(directoryPath, Path.GetFileNameWithoutExtension(info.Path) + ".xml");
|
||||
var specificFile = Path.Combine(directoryPath, FileSystem.GetFileNameWithoutExtension(info.Path) + ".xml");
|
||||
|
||||
var file = new FileInfo(specificFile);
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.LocalMetadata.Parsers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace MediaBrowser.LocalMetadata.Providers
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace MediaBrowser.LocalMetadata.Providers
|
||||
|
||||
var directoryPath = directoryInfo.FullName;
|
||||
|
||||
var specificFile = Path.Combine(directoryPath, Path.GetFileNameWithoutExtension(info.Path) + ".xml");
|
||||
var specificFile = Path.Combine(directoryPath, fileSystem.GetFileNameWithoutExtension(info.Path) + ".xml");
|
||||
|
||||
var file = new FileInfo(specificFile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user