aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/MediaInfo
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/MediaInfo')
-rw-r--r--MediaBrowser.Providers/MediaInfo/AudioFileProber.cs27
-rw-r--r--MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs19
-rw-r--r--MediaBrowser.Providers/MediaInfo/ProbeProvider.cs2
3 files changed, 33 insertions, 15 deletions
diff --git a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
index 45e8553ea..c0680b901 100644
--- a/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
+++ b/MediaBrowser.Providers/MediaInfo/AudioFileProber.cs
@@ -192,7 +192,20 @@ namespace MediaBrowser.Providers.MediaInfo
if (audio.SupportsPeople && !audio.LockedFields.Contains(MetadataField.Cast))
{
var people = new List<PersonInfo>();
- var albumArtists = string.IsNullOrEmpty(trackAlbumArtist) ? [] : trackAlbumArtist.Split(InternalValueSeparator);
+ string[]? albumArtists = null;
+ if (libraryOptions.PreferNonstandardArtistsTag)
+ {
+ TryGetSanitizedAdditionalFields(track, "ALBUMARTISTS", out var albumArtistsTagString);
+ if (albumArtistsTagString is not null)
+ {
+ albumArtists = albumArtistsTagString.Split(InternalValueSeparator);
+ }
+ }
+
+ if (albumArtists is null || albumArtists.Length == 0)
+ {
+ albumArtists = string.IsNullOrEmpty(trackAlbumArtist) ? [] : trackAlbumArtist.Split(InternalValueSeparator);
+ }
if (libraryOptions.UseCustomTagDelimiters)
{
@@ -205,7 +218,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
PeopleHelper.AddPerson(people, new PersonInfo
{
- Name = albumArtist.Trim(),
+ Name = albumArtist,
Type = PersonKind.AlbumArtist
});
}
@@ -237,7 +250,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
PeopleHelper.AddPerson(people, new PersonInfo
{
- Name = performer.Trim(),
+ Name = performer,
Type = PersonKind.Artist
});
}
@@ -251,7 +264,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
PeopleHelper.AddPerson(people, new PersonInfo
{
- Name = composer.Trim(),
+ Name = composer,
Type = PersonKind.Composer
});
}
@@ -436,7 +449,11 @@ namespace MediaBrowser.Providers.MediaInfo
// Save extracted lyrics if they exist,
// and if the audio doesn't yet have lyrics.
- var lyrics = track.Lyrics.SynchronizedLyrics.Count > 0 ? track.Lyrics.FormatSynchToLRC() : track.Lyrics.UnsynchronizedLyrics;
+ // ATL supports both SRT and LRC formats as synchronized lyrics, but we only want to save LRC format.
+ var supportedLyrics = track.Lyrics.Where(l => l.Format != LyricsInfo.LyricsFormat.SRT).ToList();
+ var candidateSynchronizedLyric = supportedLyrics.FirstOrDefault(l => l.Format is not LyricsInfo.LyricsFormat.UNSYNCHRONIZED and not LyricsInfo.LyricsFormat.OTHER && l.SynchronizedLyrics is not null);
+ var candidateUnsynchronizedLyric = supportedLyrics.FirstOrDefault(l => l.Format is LyricsInfo.LyricsFormat.UNSYNCHRONIZED or LyricsInfo.LyricsFormat.OTHER && l.UnsynchronizedLyrics is not null);
+ var lyrics = candidateSynchronizedLyric is not null ? candidateSynchronizedLyric.FormatSynch() : candidateUnsynchronizedLyric?.UnsynchronizedLyrics;
if (!string.IsNullOrWhiteSpace(lyrics)
&& tryExtractEmbeddedLyrics)
{
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
index d85f49b1d..bdb6b93be 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
@@ -6,6 +6,7 @@ using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Chapters;
@@ -275,10 +276,7 @@ namespace MediaBrowser.Providers.MediaInfo
_mediaStreamRepository.SaveMediaStreams(video.Id, mediaStreams, cancellationToken);
- if (mediaAttachments.Any())
- {
- _mediaAttachmentRepository.SaveMediaAttachments(video.Id, mediaAttachments, cancellationToken);
- }
+ _mediaAttachmentRepository.SaveMediaAttachments(video.Id, mediaAttachments, cancellationToken);
if (options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh
|| options.MetadataRefreshMode == MetadataRefreshMode.Default)
@@ -516,12 +514,15 @@ namespace MediaBrowser.Providers.MediaInfo
foreach (var person in data.People)
{
- PeopleHelper.AddPerson(people, new PersonInfo
+ if (!string.IsNullOrWhiteSpace(person.Name))
{
- Name = person.Name.Trim(),
- Type = person.Type,
- Role = person.Role.Trim()
- });
+ PeopleHelper.AddPerson(people, new PersonInfo
+ {
+ Name = person.Name,
+ Type = person.Type,
+ Role = person.Role.Trim()
+ });
+ }
}
_libraryManager.UpdatePeople(video, people);
diff --git a/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
index 8c673350d..bd6b36458 100644
--- a/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/ProbeProvider.cs
@@ -130,7 +130,7 @@ namespace MediaBrowser.Providers.MediaInfo
if (!string.IsNullOrWhiteSpace(path) && item.IsFileProtocol)
{
var file = directoryService.GetFile(path);
- if (file is not null && file.LastWriteTimeUtc != item.DateModified && file.Length != item.Size)
+ if (file is not null && item.HasChanged(file.LastWriteTimeUtc) && file.Length != item.Size)
{
_logger.LogDebug("Refreshing {ItemPath} due to file system modification.", path);
return true;