mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 09:59:06 -07:00
support storage of original title
This commit is contained in:
parent
1b46fb62c4
commit
7fdc6e7e91
8
MediaBrowser.Controller/Entities/IHasOriginalTitle.cs
Normal file
8
MediaBrowser.Controller/Entities/IHasOriginalTitle.cs
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public interface IHasOriginalTitle
|
||||
{
|
||||
string OriginalTitle { get; set; }
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -15,10 +14,11 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
/// <summary>
|
||||
/// Class Movie
|
||||
/// </summary>
|
||||
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasSpecialFeatures, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
|
||||
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasSpecialFeatures, IHasProductionLocations, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
|
||||
{
|
||||
public List<Guid> SpecialFeatureIds { get; set; }
|
||||
|
||||
public string OriginalTitle { get; set; }
|
||||
public List<Guid> SoundtrackIds { get; set; }
|
||||
|
||||
public List<Guid> ThemeSongIds { get; set; }
|
||||
|
@ -15,11 +15,12 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
/// <summary>
|
||||
/// Class Series
|
||||
/// </summary>
|
||||
public class Series : Folder, IHasSoundtracks, IHasTrailers, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>, IHasSpecialFeatures, IMetadataContainer
|
||||
public class Series : Folder, IHasSoundtracks, IHasTrailers, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>, IHasSpecialFeatures, IMetadataContainer, IHasOriginalTitle
|
||||
{
|
||||
public List<Guid> SpecialFeatureIds { get; set; }
|
||||
public List<Guid> SoundtrackIds { get; set; }
|
||||
|
||||
public string OriginalTitle { get; set; }
|
||||
public int SeasonCount { get; set; }
|
||||
|
||||
public int? AnimeSeriesIndex { get; set; }
|
||||
|
@ -139,6 +139,7 @@
|
||||
<Compile Include="Entities\IHasKeywords.cs" />
|
||||
<Compile Include="Entities\IHasMediaSources.cs" />
|
||||
<Compile Include="Entities\IHasMetascore.cs" />
|
||||
<Compile Include="Entities\IHasOriginalTitle.cs" />
|
||||
<Compile Include="Entities\IHasPreferredMetadataLanguage.cs" />
|
||||
<Compile Include="Entities\IHasProductionLocations.cs" />
|
||||
<Compile Include="Entities\IHasScreenshots.cs" />
|
||||
|
@ -126,6 +126,21 @@ namespace MediaBrowser.Controller.Providers
|
||||
break;
|
||||
}
|
||||
|
||||
case "OriginalTitle":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
var hasOriginalTitle = item as IHasOriginalTitle;
|
||||
if (hasOriginalTitle != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle))
|
||||
{
|
||||
hasOriginalTitle.OriginalTitle = val;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "LocalTitle":
|
||||
item.Name = reader.ReadElementContentAsString();
|
||||
break;
|
||||
|
@ -57,6 +57,7 @@ namespace MediaBrowser.LocalMetadata.Savers
|
||||
|
||||
"Language",
|
||||
"LocalTitle",
|
||||
"OriginalTitle",
|
||||
"LockData",
|
||||
"LockedFields",
|
||||
"Format3D",
|
||||
@ -273,6 +274,15 @@ namespace MediaBrowser.LocalMetadata.Savers
|
||||
{
|
||||
builder.Append("<Overview><![CDATA[" + item.Overview + "]]></Overview>");
|
||||
}
|
||||
|
||||
var hasOriginalTitle = item as IHasOriginalTitle;
|
||||
if (hasOriginalTitle != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle))
|
||||
{
|
||||
builder.Append("<OriginalTitle>" + SecurityElement.Escape(hasOriginalTitle.OriginalTitle) + "</OriginalTitle>");
|
||||
}
|
||||
}
|
||||
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
if (hasShortOverview != null)
|
||||
|
@ -111,7 +111,13 @@ namespace MediaBrowser.Providers.Movies
|
||||
/// <param name="movieData">The movie data.</param>
|
||||
private void ProcessMainInfo(T movie, string preferredCountryCode, MovieDbProvider.CompleteMovieData movieData)
|
||||
{
|
||||
movie.Name = movieData.title ?? movieData.original_title ?? movieData.name ?? movie.Name;
|
||||
movie.Name = movieData.GetTitle() ?? movie.Name;
|
||||
|
||||
var hasOriginalTitle = movie as IHasOriginalTitle;
|
||||
if (hasOriginalTitle != null)
|
||||
{
|
||||
hasOriginalTitle.OriginalTitle = movieData.GetOriginalTitle();
|
||||
}
|
||||
|
||||
// Bug in Mono: WebUtility.HtmlDecode should return null if the string is null but in Mono it generate an System.ArgumentNullException.
|
||||
movie.Overview = movieData.overview != null ? WebUtility.HtmlDecode(movieData.overview) : null;
|
||||
|
@ -77,7 +77,7 @@ namespace MediaBrowser.Providers.Movies
|
||||
|
||||
var remoteResult = new RemoteSearchResult
|
||||
{
|
||||
Name = obj.title ?? obj.original_title ?? obj.name,
|
||||
Name = obj.GetTitle(),
|
||||
SearchProviderName = Name,
|
||||
ImageUrl = string.IsNullOrWhiteSpace(obj.poster_path) ? null : tmdbImageUrl + obj.poster_path
|
||||
};
|
||||
@ -560,6 +560,7 @@ namespace MediaBrowser.Providers.Movies
|
||||
public int id { get; set; }
|
||||
public string imdb_id { get; set; }
|
||||
public string original_title { get; set; }
|
||||
public string original_name { get; set; }
|
||||
public string overview { get; set; }
|
||||
public double popularity { get; set; }
|
||||
public string poster_path { get; set; }
|
||||
@ -580,6 +581,16 @@ namespace MediaBrowser.Providers.Movies
|
||||
public Images images { get; set; }
|
||||
public Keywords keywords { get; set; }
|
||||
public Trailers trailers { get; set; }
|
||||
|
||||
public string GetOriginalTitle()
|
||||
{
|
||||
return original_name ?? original_title;
|
||||
}
|
||||
|
||||
public string GetTitle()
|
||||
{
|
||||
return name ?? title ?? GetOriginalTitle();
|
||||
}
|
||||
}
|
||||
|
||||
public int Order
|
||||
|
@ -147,7 +147,7 @@ namespace MediaBrowser.Providers.Movies
|
||||
var remoteResult = new RemoteSearchResult
|
||||
{
|
||||
SearchProviderName = MovieDbProvider.Current.Name,
|
||||
Name = i.title ?? i.original_title ?? i.name,
|
||||
Name = i.title ?? i.name ?? i.original_title,
|
||||
ImageUrl = string.IsNullOrWhiteSpace(i.poster_path) ? null : baseImageUrl + i.poster_path
|
||||
};
|
||||
|
||||
@ -215,6 +215,11 @@ namespace MediaBrowser.Providers.Movies
|
||||
/// <value>The original_title.</value>
|
||||
public string original_title { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the original_name.
|
||||
/// </summary>
|
||||
/// <value>The original_name.</value>
|
||||
public string original_name { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the release_date.
|
||||
/// </summary>
|
||||
/// <value>The release_date.</value>
|
||||
|
@ -193,6 +193,21 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||
break;
|
||||
}
|
||||
|
||||
case "originaltitle":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
var hasOriginalTitle = item as IHasOriginalTitle;
|
||||
if (hasOriginalTitle != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle))
|
||||
{
|
||||
hasOriginalTitle.OriginalTitle = val;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "title":
|
||||
case "localtitle":
|
||||
item.Name = reader.ReadElementContentAsString();
|
||||
|
@ -459,6 +459,15 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
||||
writer.WriteElementString("title", item.Name ?? string.Empty);
|
||||
writer.WriteElementString("originaltitle", item.Name ?? string.Empty);
|
||||
|
||||
var hasOriginalTitle = item as IHasOriginalTitle;
|
||||
if (hasOriginalTitle != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle))
|
||||
{
|
||||
writer.WriteElementString("originaltitle", hasOriginalTitle.OriginalTitle ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
var directors = item.People
|
||||
.Where(i => IsPersonType(i, PersonType.Director))
|
||||
.Select(i => i.Name)
|
||||
|
Loading…
Reference in New Issue
Block a user