mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 03:57:12 +00:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Conflicts: SharedVersion.cs
This commit is contained in:
@@ -18,7 +18,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
{
|
||||
public class RemoteNotifications : IServerEntryPoint
|
||||
{
|
||||
private const string Url = "http://www.mb3admin.com/admin/service/MB3ServerNotifications.json";
|
||||
private const string Url = "https://www.mb3admin.com/admin/service/MB3ServerNotifications.json";
|
||||
|
||||
private Timer _timer;
|
||||
private readonly IHttpClient _httpClient;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
|
||||
private readonly IApplicationHost _applicationHost;
|
||||
private readonly INetworkManager _networkManager;
|
||||
private readonly IHttpClient _httpClient;
|
||||
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
|
||||
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
|
||||
|
||||
public UsageReporter(IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient)
|
||||
{
|
||||
|
||||
@@ -1736,5 +1736,113 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
return new List<FileSystemInfo>();
|
||||
}
|
||||
|
||||
public IEnumerable<Trailer> FindTrailers(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
|
||||
{
|
||||
var files = fileSystemChildren.OfType<DirectoryInfo>()
|
||||
.Where(i => string.Equals(i.Name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase))
|
||||
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
|
||||
.ToList();
|
||||
|
||||
var extraTypes = new List<ExtraType> { ExtraType.Trailer };
|
||||
var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
|
||||
.Select(i => i.Key)
|
||||
.ToList();
|
||||
|
||||
files.AddRange(fileSystemChildren.OfType<FileInfo>()
|
||||
.Where(i =>
|
||||
{
|
||||
var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
|
||||
|
||||
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
|
||||
}));
|
||||
|
||||
return ResolvePaths<Trailer>(files, directoryService, null).Select(video =>
|
||||
{
|
||||
// Try to retrieve it from the db. If we don't find it, use the resolved version
|
||||
var dbItem = GetItemById(video.Id) as Trailer;
|
||||
|
||||
if (dbItem != null)
|
||||
{
|
||||
video = dbItem;
|
||||
}
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
video.ExtraType = ExtraType.Trailer;
|
||||
}
|
||||
|
||||
return video;
|
||||
|
||||
// Sort them so that the list can be easily compared for changes
|
||||
}).OrderBy(i => i.Path).ToList();
|
||||
}
|
||||
|
||||
public IEnumerable<Video> FindExtras(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
|
||||
{
|
||||
var files = fileSystemChildren.OfType<DirectoryInfo>()
|
||||
.Where(i => string.Equals(i.Name, "extras", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "specials", StringComparison.OrdinalIgnoreCase))
|
||||
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
|
||||
.ToList();
|
||||
|
||||
var extraTypes = new List<ExtraType> { ExtraType.BehindTheScenes, ExtraType.DeletedScene, ExtraType.Interview, ExtraType.Sample, ExtraType.Scene, ExtraType.Clip };
|
||||
var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
|
||||
.Select(i => i.Key)
|
||||
.ToList();
|
||||
|
||||
files.AddRange(fileSystemChildren.OfType<FileInfo>()
|
||||
.Where(i =>
|
||||
{
|
||||
var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
|
||||
|
||||
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
|
||||
}));
|
||||
|
||||
return ResolvePaths<Video>(files, directoryService, null).Select(video =>
|
||||
{
|
||||
// Try to retrieve it from the db. If we don't find it, use the resolved version
|
||||
var dbItem = GetItemById(video.Id) as Video;
|
||||
|
||||
if (dbItem != null)
|
||||
{
|
||||
video = dbItem;
|
||||
}
|
||||
|
||||
if (video != null)
|
||||
{
|
||||
SetExtraTypeFromFilename(video);
|
||||
}
|
||||
|
||||
return video;
|
||||
|
||||
// Sort them so that the list can be easily compared for changes
|
||||
}).OrderBy(i => i.Path).ToList();
|
||||
}
|
||||
|
||||
private void SetExtraTypeFromFilename(Video item)
|
||||
{
|
||||
var name = System.IO.Path.GetFileNameWithoutExtension(item.Path) ?? string.Empty;
|
||||
|
||||
foreach (var suffix in BaseItem.ExtraSuffixes)
|
||||
{
|
||||
if (name.EndsWith(suffix.Key, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
item.ExtraType = suffix.Value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
item.ExtraType = ExtraType.Clip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// <returns>Task.</returns>
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.ValidateArtists(cancellationToken, progress);
|
||||
return ((LibraryManager)_libraryManager).ValidateArtists(cancellationToken, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// <returns>Task.</returns>
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.ValidateGameGenres(cancellationToken, progress);
|
||||
return ((LibraryManager)_libraryManager).ValidateGameGenres(cancellationToken, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// <returns>Task.</returns>
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.ValidateGenres(cancellationToken, progress);
|
||||
return ((LibraryManager)_libraryManager).ValidateGenres(cancellationToken, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// <returns>Task.</returns>
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.ValidateMusicGenres(cancellationToken, progress);
|
||||
return ((LibraryManager)_libraryManager).ValidateMusicGenres(cancellationToken, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
||||
/// <returns>Task.</returns>
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
return _libraryManager.ValidateStudios(cancellationToken, progress);
|
||||
return ((LibraryManager)_libraryManager).ValidateStudios(cancellationToken, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user