mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 18:54:48 +03:00
Add performers to the ffprobe normalization for audio
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using Jellyfin.Extensions;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@@ -1111,6 +1112,26 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
}
|
||||
}
|
||||
|
||||
if (tags.TryGetValue("performer", out var performer) && !string.IsNullOrWhiteSpace(performer))
|
||||
{
|
||||
foreach (var person in Split(performer, false))
|
||||
{
|
||||
Regex pattern = new Regex(@"(?<name>.*) \((?<instrument>.*)\)");
|
||||
Match match = pattern.Match(person);
|
||||
|
||||
// If the performer doesn't have any instrument/role associated, it won't match. In that case, chances are it's simply a band name, so we skip it.
|
||||
if (match.Success)
|
||||
{
|
||||
people.Add(new BaseItemPerson
|
||||
{
|
||||
Name = match.Groups["name"].Value,
|
||||
Type = PersonType.Actor,
|
||||
Role = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(match.Groups["instrument"].Value)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for writer some music is tagged that way as alternative to composer/lyricist
|
||||
if (tags.TryGetValue("writer", out var writer) && !string.IsNullOrWhiteSpace(writer))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user