mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
add GuestStar distinction
This commit is contained in:
@@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public virtual string Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id.
|
||||
@@ -477,7 +477,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
/// <value>The end date.</value>
|
||||
public DateTime? EndDate { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the display type of the media.
|
||||
/// </summary>
|
||||
@@ -569,7 +569,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
/// <value>The production locations.</value>
|
||||
public List<string> ProductionLocations { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the community rating.
|
||||
/// </summary>
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
protected IEnumerable<BaseItem> GetIndexByPerformer(User user)
|
||||
{
|
||||
return GetIndexByPerson(user, new List<string> { PersonType.Actor, PersonType.MusicArtist }, LocalizedStrings.Instance.GetString("PerformerDispPref"));
|
||||
return GetIndexByPerson(user, new List<string> { PersonType.Actor, PersonType.MusicArtist, PersonType.GuestStar }, LocalizedStrings.Instance.GetString("PerformerDispPref"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -242,7 +242,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
|
||||
case "Actors":
|
||||
case "GuestStars":
|
||||
{
|
||||
foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.Actor }))
|
||||
{
|
||||
@@ -255,6 +254,19 @@ namespace MediaBrowser.Controller.Providers
|
||||
break;
|
||||
}
|
||||
|
||||
case "GuestStars":
|
||||
{
|
||||
foreach (var p in SplitNames(reader.ReadElementContentAsString()).Select(v => new PersonInfo { Name = v.Trim(), Type = PersonType.GuestStar }))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(p.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item.AddPerson(p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "Trailer":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
@@ -63,7 +63,20 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
// If the IBN location exists return the last modified date of any file in it
|
||||
var location = GetLocation(item);
|
||||
return Directory.Exists(location) ? FileSystem.GetFiles(location).Select(f => f.CreationTimeUtc > f.LastWriteTimeUtc ? f.CreationTimeUtc : f.LastWriteTimeUtc).Max() : DateTime.MinValue;
|
||||
|
||||
if (!Directory.Exists(location))
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
var files = FileSystem.GetFiles(location).ToList();
|
||||
|
||||
if (files.Count == 0)
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
return files.Select(f => f.CreationTimeUtc > f.LastWriteTimeUtc ? f.CreationTimeUtc : f.LastWriteTimeUtc).Max();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -263,21 +263,21 @@ namespace MediaBrowser.Controller.Providers.TV
|
||||
var actors = doc.SafeGetString("//GuestStars");
|
||||
if (actors != null)
|
||||
{
|
||||
episode.AddPeople(actors.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = "Actor", Name = str }));
|
||||
episode.AddPeople(actors.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = PersonType.GuestStar, Name = str }));
|
||||
}
|
||||
|
||||
|
||||
var directors = doc.SafeGetString("//Director");
|
||||
if (directors != null)
|
||||
{
|
||||
episode.AddPeople(directors.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = "Director", Name = str }));
|
||||
episode.AddPeople(directors.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = PersonType.Director, Name = str }));
|
||||
}
|
||||
|
||||
|
||||
var writers = doc.SafeGetString("//Writer");
|
||||
if (writers != null)
|
||||
{
|
||||
episode.AddPeople(writers.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = "Writer", Name = str }));
|
||||
episode.AddPeople(writers.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).Select(str => new PersonInfo { Type = PersonType.Writer, Name = str }));
|
||||
}
|
||||
|
||||
if (ConfigurationManager.Configuration.SaveLocalMeta)
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
||||
personNode.AppendChild(doc.ImportNode(subNode, true));
|
||||
//need to add the type
|
||||
var typeNode = doc.CreateNode(XmlNodeType.Element, "Type", null);
|
||||
typeNode.InnerText = "Actor";
|
||||
typeNode.InnerText = PersonType.Actor;
|
||||
personNode.AppendChild(typeNode);
|
||||
actorsNode.AppendChild(personNode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user