mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-05 22:02:53 +01:00
Merge remote-tracking branch 'upstream/master' into perf-rebased
This commit is contained in:
@@ -577,6 +577,13 @@ namespace MediaBrowser.Providers.Manager
|
||||
return true;
|
||||
}
|
||||
|
||||
// Artists without a folder structure that are derived from metadata have no real path in the library,
|
||||
// so GetLibraryOptions returns null. Allow all providers through rather than blocking them.
|
||||
if (item is MusicArtist && libraryTypeOptions is null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return _baseItemManager.IsMetadataFetcherEnabled(item, libraryTypeOptions, provider.Name);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Extensions;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Controller.Chapters;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
@@ -25,7 +24,6 @@ using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Providers.MediaInfo
|
||||
@@ -74,7 +72,6 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
_subtitleResolver = subtitleResolver;
|
||||
_mediaAttachmentRepository = mediaAttachmentRepository;
|
||||
_mediaStreamRepository = mediaStreamRepository;
|
||||
_mediaStreamRepository = mediaStreamRepository;
|
||||
}
|
||||
|
||||
public async Task<ItemUpdateType> ProbeVideo<T>(
|
||||
@@ -366,6 +363,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
blurayVideoStream.ColorSpace = ffmpegVideoStream.ColorSpace;
|
||||
blurayVideoStream.ColorTransfer = ffmpegVideoStream.ColorTransfer;
|
||||
blurayVideoStream.ColorPrimaries = ffmpegVideoStream.ColorPrimaries;
|
||||
blurayVideoStream.BitDepth = ffmpegVideoStream.BitDepth;
|
||||
blurayVideoStream.PixelFormat = ffmpegVideoStream.PixelFormat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,47 +548,19 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
var enableSubtitleDownloading = options.MetadataRefreshMode == MetadataRefreshMode.Default ||
|
||||
options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh;
|
||||
|
||||
var subtitleOptions = _config.GetConfiguration<SubtitleOptions>("subtitles");
|
||||
|
||||
var libraryOptions = _libraryManager.GetLibraryOptions(video);
|
||||
|
||||
string[] subtitleDownloadLanguages;
|
||||
bool skipIfEmbeddedSubtitlesPresent;
|
||||
bool skipIfAudioTrackMatches;
|
||||
bool requirePerfectMatch;
|
||||
bool enabled;
|
||||
|
||||
if (libraryOptions.SubtitleDownloadLanguages is null)
|
||||
{
|
||||
subtitleDownloadLanguages = subtitleOptions.DownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = subtitleOptions.SkipIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = subtitleOptions.SkipIfAudioTrackMatches;
|
||||
requirePerfectMatch = subtitleOptions.RequirePerfectMatch;
|
||||
enabled = (subtitleOptions.DownloadEpisodeSubtitles &&
|
||||
video is Episode) ||
|
||||
(subtitleOptions.DownloadMovieSubtitles &&
|
||||
video is Movie);
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
|
||||
requirePerfectMatch = libraryOptions.RequirePerfectSubtitleMatch;
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (enableSubtitleDownloading && enabled)
|
||||
if (enableSubtitleDownloading && libraryOptions.SubtitleDownloadLanguages is not null)
|
||||
{
|
||||
var downloadedLanguages = await new SubtitleDownloader(
|
||||
_logger,
|
||||
_subtitleManager).DownloadSubtitles(
|
||||
video,
|
||||
currentStreams.Concat(externalSubtitleStreams).ToList(),
|
||||
skipIfEmbeddedSubtitlesPresent,
|
||||
skipIfAudioTrackMatches,
|
||||
requirePerfectMatch,
|
||||
subtitleDownloadLanguages,
|
||||
libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent,
|
||||
libraryOptions.SkipSubtitlesIfAudioTrackMatches,
|
||||
libraryOptions.RequirePerfectSubtitleMatch,
|
||||
libraryOptions.SubtitleDownloadLanguages,
|
||||
libraryOptions.DisabledSubtitleFetchers,
|
||||
libraryOptions.SubtitleFetcherOrder,
|
||||
true,
|
||||
|
||||
@@ -8,14 +8,12 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Subtitles;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -57,16 +55,9 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
|
||||
public bool IsLogged => true;
|
||||
|
||||
private SubtitleOptions GetOptions()
|
||||
{
|
||||
return _config.GetConfiguration<SubtitleOptions>("subtitles");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var options = GetOptions();
|
||||
|
||||
var types = new[] { BaseItemKind.Episode, BaseItemKind.Movie };
|
||||
|
||||
var dict = new Dictionary<Guid, BaseItem>();
|
||||
@@ -81,17 +72,14 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
|
||||
if (libraryOptions.SubtitleDownloadLanguages is null)
|
||||
{
|
||||
subtitleDownloadLanguages = options.DownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = options.SkipIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = options.SkipIfAudioTrackMatches;
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
|
||||
// Skip this library if subtitle download languages are not configured
|
||||
continue;
|
||||
}
|
||||
|
||||
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
|
||||
|
||||
foreach (var lang in subtitleDownloadLanguages)
|
||||
{
|
||||
var query = new InternalItemsQuery
|
||||
@@ -144,7 +132,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
|
||||
try
|
||||
{
|
||||
await DownloadSubtitles(video as Video, options, cancellationToken).ConfigureAwait(false);
|
||||
await DownloadSubtitles(video as Video, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -160,7 +148,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> DownloadSubtitles(Video video, SubtitleOptions options, CancellationToken cancellationToken)
|
||||
private async Task<bool> DownloadSubtitles(Video video, CancellationToken cancellationToken)
|
||||
{
|
||||
var mediaStreams = video.GetMediaStreams();
|
||||
|
||||
@@ -173,19 +161,15 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
|
||||
if (libraryOptions.SubtitleDownloadLanguages is null)
|
||||
{
|
||||
subtitleDownloadLanguages = options.DownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = options.SkipIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = options.SkipIfAudioTrackMatches;
|
||||
requirePerfectMatch = options.RequirePerfectMatch;
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
|
||||
requirePerfectMatch = libraryOptions.RequirePerfectSubtitleMatch;
|
||||
// Subtitle downloading is not configured for this library
|
||||
return true;
|
||||
}
|
||||
|
||||
subtitleDownloadLanguages = libraryOptions.SubtitleDownloadLanguages;
|
||||
skipIfEmbeddedSubtitlesPresent = libraryOptions.SkipSubtitlesIfEmbeddedSubtitlesPresent;
|
||||
skipIfAudioTrackMatches = libraryOptions.SkipSubtitlesIfAudioTrackMatches;
|
||||
requirePerfectMatch = libraryOptions.RequirePerfectSubtitleMatch;
|
||||
|
||||
var downloadedLanguages = await new SubtitleDownloader(
|
||||
_logger,
|
||||
_subtitleManager).DownloadSubtitles(
|
||||
|
||||
@@ -125,7 +125,9 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
|
||||
|
||||
if (string.IsNullOrWhiteSpace(overview))
|
||||
{
|
||||
overview = result.strBiographyEN;
|
||||
overview = string.IsNullOrWhiteSpace(result.strBiographyEN)
|
||||
? result.strBiography
|
||||
: result.strBiographyEN;
|
||||
}
|
||||
|
||||
item.Overview = (overview ?? string.Empty).StripHtml();
|
||||
@@ -224,6 +226,8 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
|
||||
|
||||
public string strTwitter { get; set; }
|
||||
|
||||
public string strBiography { get; set; }
|
||||
|
||||
public string strBiographyEN { get; set; }
|
||||
|
||||
public string strBiographyDE { get; set; }
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace MediaBrowser.Providers.Plugins.MusicBrainz;
|
||||
/// <summary>
|
||||
/// MusicBrainz artist provider.
|
||||
/// </summary>
|
||||
public class MusicBrainzArtistProvider : IRemoteMetadataProvider<MusicArtist, ArtistInfo>, IDisposable
|
||||
public class MusicBrainzArtistProvider : IRemoteMetadataProvider<MusicArtist, ArtistInfo>, IDisposable, IHasOrder
|
||||
{
|
||||
private readonly ILogger<MusicBrainzArtistProvider> _logger;
|
||||
private Query _musicBrainzQuery;
|
||||
@@ -42,6 +42,10 @@ public class MusicBrainzArtistProvider : IRemoteMetadataProvider<MusicArtist, Ar
|
||||
/// <inheritdoc />
|
||||
public string Name => "MusicBrainz";
|
||||
|
||||
/// <inheritdoc />
|
||||
/// Runs first to populate the MusicBrainz artist ID used by downstream providers.
|
||||
public int Order => 0;
|
||||
|
||||
private void ReloadConfig(object? sender, BasePluginConfiguration e)
|
||||
{
|
||||
var configuration = (PluginConfiguration)e;
|
||||
|
||||
Reference in New Issue
Block a user