Merge pull request #5085 from Ullmie02/nfo-actor-type

Process actor type in nfo files
pull/5171/head
dkanada 4 years ago committed by GitHub
commit bfbbee0bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1030,6 +1030,29 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break;
}
case "type":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
type = val switch
{
PersonType.Composer => PersonType.Composer,
PersonType.Conductor => PersonType.Conductor,
PersonType.Director => PersonType.Director,
PersonType.Lyricist => PersonType.Lyricist,
PersonType.Producer => PersonType.Producer,
PersonType.Writer => PersonType.Writer,
PersonType.GuestStar => PersonType.GuestStar,
// unknown type --> actor
_ => PersonType.Actor
};
}
break;
}
case "order":
case "sortorder":
{

@ -60,7 +60,7 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers
Assert.Equal(new TimeSpan(0, 0, 6268).Ticks, item.RunTimeTicks);
Assert.True(item.HasSubtitles);
Assert.Equal(18, result.People.Count);
Assert.Equal(19, result.People.Count);
var writers = result.People.Where(x => x.Type == PersonType.Writer).ToArray();
Assert.Equal(2, writers.Length);
@ -82,6 +82,10 @@ namespace Jellyfin.XbmcMetadata.Tests.Parsers
Assert.Equal(5, aquaman!.SortOrder);
Assert.Equal("https://m.media-amazon.com/images/M/MV5BMTI5MTU5NjM1MV5BMl5BanBnXkFtZTcwODc4MDk0Mw@@._V1_SX1024_SY1024_.jpg", aquaman!.ImageUrl);
var lyricist = result.People.FirstOrDefault(x => x.Type == PersonType.Lyricist);
Assert.NotNull(lyricist);
Assert.Equal("Test Lyricist", lyricist!.Name);
Assert.Equal(new DateTime(2019, 8, 6, 9, 1, 18), item.DateCreated);
}

@ -221,6 +221,11 @@
<order>14</order>
<thumb>https://m.media-amazon.com/images/M/MV5BOTFjOTFhNTgtZjk3Ny00MTNjLWE3MWUtMWI3ZWM5NDljZjQwXkEyXkFqcGdeQXVyMjQwMDg0Ng@@._V1_SX1024_SY1024_.jpg</thumb>
</actor>
<actor>
<name>Test Lyricist</name>
<type>Lyricist</type>
<order>15</order>
</actor>
<resume>
<position>0.000000</position>
<total>0.000000</total>

Loading…
Cancel
Save