mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
reduce imported people
This commit is contained in:
parent
86de351e23
commit
3952360ce8
@ -781,24 +781,24 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var conductor = FFProbeHelpers.GetDictionaryValue(tags, "conductor");
|
//var conductor = FFProbeHelpers.GetDictionaryValue(tags, "conductor");
|
||||||
if (!string.IsNullOrWhiteSpace(conductor))
|
//if (!string.IsNullOrWhiteSpace(conductor))
|
||||||
{
|
//{
|
||||||
foreach (var person in Split(conductor, false))
|
// foreach (var person in Split(conductor, false))
|
||||||
{
|
// {
|
||||||
audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Conductor });
|
// audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Conductor });
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
var lyricist = FFProbeHelpers.GetDictionaryValue(tags, "lyricist");
|
//var lyricist = FFProbeHelpers.GetDictionaryValue(tags, "lyricist");
|
||||||
|
//if (!string.IsNullOrWhiteSpace(lyricist))
|
||||||
|
//{
|
||||||
|
// foreach (var person in Split(lyricist, false))
|
||||||
|
// {
|
||||||
|
// audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Lyricist });
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(lyricist))
|
|
||||||
{
|
|
||||||
foreach (var person in Split(lyricist, false))
|
|
||||||
{
|
|
||||||
audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Lyricist });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Check for writer some music is tagged that way as alternative to composer/lyricist
|
// Check for writer some music is tagged that way as alternative to composer/lyricist
|
||||||
var writer = FFProbeHelpers.GetDictionaryValue(tags, "writer");
|
var writer = FFProbeHelpers.GetDictionaryValue(tags, "writer");
|
||||||
|
|
||||||
|
@ -26,16 +26,16 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IJsonSerializer _jsonSerializer;
|
private readonly IJsonSerializer _jsonSerializer;
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
|
|
||||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||||
|
|
||||||
public GenericMovieDbInfo(ILogger logger, IJsonSerializer jsonSerializer, ILibraryManager libraryManager, IFileSystem fileSystem)
|
public GenericMovieDbInfo(ILogger logger, IJsonSerializer jsonSerializer, ILibraryManager libraryManager, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_jsonSerializer = jsonSerializer;
|
_jsonSerializer = jsonSerializer;
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<MetadataResult<T>> GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken)
|
public async Task<MetadataResult<T>> GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken)
|
||||||
@ -271,6 +271,8 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
//and the rest from crew
|
//and the rest from crew
|
||||||
if (movieData.casts != null && movieData.casts.crew != null)
|
if (movieData.casts != null && movieData.casts.crew != null)
|
||||||
{
|
{
|
||||||
|
var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer };
|
||||||
|
|
||||||
foreach (var person in movieData.casts.crew)
|
foreach (var person in movieData.casts.crew)
|
||||||
{
|
{
|
||||||
// Normalize this
|
// Normalize this
|
||||||
@ -280,6 +282,12 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
type = PersonType.Writer;
|
type = PersonType.Writer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!keepTypes.Contains(type ?? string.Empty, StringComparer.OrdinalIgnoreCase) &&
|
||||||
|
!keepTypes.Contains(person.job ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var personInfo = new PersonInfo
|
var personInfo = new PersonInfo
|
||||||
{
|
{
|
||||||
Name = person.name.Trim(),
|
Name = person.name.Trim(),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using MediaBrowser.Model.IO;
|
using System;
|
||||||
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
@ -166,9 +167,24 @@ namespace MediaBrowser.Providers.TV
|
|||||||
//and the rest from crew
|
//and the rest from crew
|
||||||
if (credits.crew != null)
|
if (credits.crew != null)
|
||||||
{
|
{
|
||||||
|
var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer };
|
||||||
|
|
||||||
foreach (var person in credits.crew)
|
foreach (var person in credits.crew)
|
||||||
{
|
{
|
||||||
result.AddPerson(new PersonInfo { Name = person.name.Trim(), Role = person.job, Type = person.department });
|
// Normalize this
|
||||||
|
var type = person.department;
|
||||||
|
if (string.Equals(type, "writing", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
type = PersonType.Writer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!keepTypes.Contains(type ?? string.Empty, StringComparer.OrdinalIgnoreCase) &&
|
||||||
|
!keepTypes.Contains(person.job ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
result.AddPerson(new PersonInfo { Name = person.name.Trim(), Role = person.job, Type = type });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user