2013-10-13 17:52:57 +00:00
|
|
|
|
using MediaBrowser.Common.Configuration;
|
2013-10-23 01:11:56 +00:00
|
|
|
|
using MediaBrowser.Common.Extensions;
|
2013-10-13 17:52:57 +00:00
|
|
|
|
using MediaBrowser.Common.IO;
|
|
|
|
|
using MediaBrowser.Common.Net;
|
2013-03-04 05:43:06 +00:00
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
2013-02-25 00:13:45 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-06-25 01:22:21 +00:00
|
|
|
|
using MediaBrowser.Controller.Library;
|
2013-06-09 16:47:28 +00:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2013-02-21 01:33:05 +00:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2013-03-02 17:59:15 +00:00
|
|
|
|
using MediaBrowser.Model.Logging;
|
2013-02-25 00:13:45 +00:00
|
|
|
|
using MediaBrowser.Model.Serialization;
|
2013-02-21 01:33:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2013-06-09 16:47:28 +00:00
|
|
|
|
namespace MediaBrowser.Providers.Movies
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class TmdbPersonProvider
|
|
|
|
|
/// </summary>
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class MovieDbPersonProvider : BaseMetadataProvider
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-03-08 05:08:27 +00:00
|
|
|
|
protected readonly IProviderManager ProviderManager;
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
internal static MovieDbPersonProvider Current { get; private set; }
|
2013-10-23 01:11:56 +00:00
|
|
|
|
|
|
|
|
|
const string DataFileName = "info.json";
|
2013-10-31 14:03:23 +00:00
|
|
|
|
private readonly IFileSystem _fileSystem;
|
2013-10-23 01:11:56 +00:00
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public MovieDbPersonProvider(IJsonSerializer jsonSerializer, ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, IFileSystem fileSystem)
|
2013-03-04 05:43:06 +00:00
|
|
|
|
: base(logManager, configurationManager)
|
2013-02-24 21:53:54 +00:00
|
|
|
|
{
|
|
|
|
|
if (jsonSerializer == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException("jsonSerializer");
|
|
|
|
|
}
|
|
|
|
|
JsonSerializer = jsonSerializer;
|
2013-03-08 05:08:27 +00:00
|
|
|
|
ProviderManager = providerManager;
|
2013-10-31 14:03:23 +00:00
|
|
|
|
_fileSystem = fileSystem;
|
2013-10-13 17:52:57 +00:00
|
|
|
|
Current = this;
|
2013-02-24 21:53:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-04 05:43:06 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the json serializer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The json serializer.</value>
|
|
|
|
|
protected IJsonSerializer JsonSerializer { get; private set; }
|
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Supportses the specified item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
|
|
|
|
public override bool Supports(BaseItem item)
|
|
|
|
|
{
|
|
|
|
|
return item is Person;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-07 03:46:14 +00:00
|
|
|
|
protected override bool RefreshOnVersionChange
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string ProviderVersion
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2013-10-23 01:11:56 +00:00
|
|
|
|
return "3";
|
2013-05-07 03:46:14 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
2013-06-25 01:22:21 +00:00
|
|
|
|
public override ItemUpdateType ItemUpdateType
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2013-11-05 18:20:24 +00:00
|
|
|
|
return ItemUpdateType.MetadataDownload;
|
2013-06-25 01:22:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-10-14 17:34:54 +00:00
|
|
|
|
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
|
|
|
|
{
|
|
|
|
|
if (HasAltMeta(item) && !ConfigurationManager.Configuration.EnableTmdbUpdates)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return base.NeedsRefreshInternal(item, providerInfo);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-13 17:52:57 +00:00
|
|
|
|
protected override bool NeedsRefreshBasedOnCompareDate(BaseItem item, BaseProviderInfo providerInfo)
|
2013-06-23 17:56:11 +00:00
|
|
|
|
{
|
2013-10-13 17:52:57 +00:00
|
|
|
|
var provderId = item.GetProviderId(MetadataProviders.Tmdb);
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-10-13 17:52:57 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(provderId))
|
|
|
|
|
{
|
|
|
|
|
// Process images
|
|
|
|
|
var path = GetPersonDataPath(ConfigurationManager.ApplicationPaths, provderId);
|
|
|
|
|
|
2013-10-23 01:11:56 +00:00
|
|
|
|
var file = Path.Combine(path, DataFileName);
|
|
|
|
|
var fileInfo = new FileInfo(file);
|
|
|
|
|
|
|
|
|
|
if (fileInfo.Exists)
|
2013-10-13 17:52:57 +00:00
|
|
|
|
{
|
2013-10-31 14:03:23 +00:00
|
|
|
|
return _fileSystem.GetLastWriteTimeUtc(fileInfo) > providerInfo.LastRefreshed;
|
2013-10-13 17:52:57 +00:00
|
|
|
|
}
|
2013-10-23 01:11:56 +00:00
|
|
|
|
|
|
|
|
|
return true;
|
2013-10-13 17:52:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.NeedsRefreshBasedOnCompareDate(item, providerInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static string GetPersonDataPath(IApplicationPaths appPaths, string tmdbId)
|
|
|
|
|
{
|
2013-10-23 01:11:56 +00:00
|
|
|
|
var letter = tmdbId.GetMD5().ToString().Substring(0, 1);
|
|
|
|
|
|
|
|
|
|
var seriesDataPath = Path.Combine(GetPersonsDataPath(appPaths), letter, tmdbId);
|
2013-10-13 17:52:57 +00:00
|
|
|
|
|
|
|
|
|
return seriesDataPath;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
internal static string GetPersonDataFilePath(IApplicationPaths appPaths, string tmdbId)
|
|
|
|
|
{
|
|
|
|
|
var letter = tmdbId.GetMD5().ToString().Substring(0, 1);
|
|
|
|
|
|
|
|
|
|
var seriesDataPath = Path.Combine(GetPersonsDataPath(appPaths), letter, tmdbId);
|
|
|
|
|
|
|
|
|
|
return Path.Combine(seriesDataPath, DataFileName);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-13 17:52:57 +00:00
|
|
|
|
internal static string GetPersonsDataPath(IApplicationPaths appPaths)
|
|
|
|
|
{
|
|
|
|
|
var dataPath = Path.Combine(appPaths.DataPath, "tmdb-people");
|
|
|
|
|
|
|
|
|
|
return dataPath;
|
2013-06-23 17:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool HasAltMeta(BaseItem item)
|
|
|
|
|
{
|
|
|
|
|
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName("person.xml");
|
|
|
|
|
}
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fetches metadata and returns true or false indicating if any work that requires persistence was done
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="force">if set to <c>true</c> [force].</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{System.Boolean}.</returns>
|
2013-03-08 05:08:27 +00:00
|
|
|
|
public override async Task<bool> FetchAsync(BaseItem item, bool force, CancellationToken cancellationToken)
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
2013-02-24 21:53:54 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
var person = (Person)item;
|
|
|
|
|
|
|
|
|
|
var id = person.GetProviderId(MetadataProviders.Tmdb);
|
|
|
|
|
|
|
|
|
|
// We don't already have an Id, need to fetch it
|
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
|
|
{
|
|
|
|
|
id = await GetTmdbId(item, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
|
|
{
|
2013-10-13 23:56:56 +00:00
|
|
|
|
await FetchInfo(person, id, force, cancellationToken).ConfigureAwait(false);
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetLastRefreshed(item, DateTime.UtcNow);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the priority.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The priority.</value>
|
|
|
|
|
public override MetadataProviderPriority Priority
|
|
|
|
|
{
|
|
|
|
|
get { return MetadataProviderPriority.Second; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether [requires internet].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if [requires internet]; otherwise, <c>false</c>.</value>
|
|
|
|
|
public override bool RequiresInternet
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-14 17:34:54 +00:00
|
|
|
|
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the TMDB id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="person">The person.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
|
|
|
|
private async Task<string> GetTmdbId(BaseItem person, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
string url = string.Format(@"http://api.themoviedb.org/3/search/person?api_key={1}&query={0}", WebUtility.UrlEncode(person.Name), MovieDbProvider.ApiKey);
|
|
|
|
|
PersonSearchResults searchResult = null;
|
|
|
|
|
|
2013-10-23 16:51:51 +00:00
|
|
|
|
using (var json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-05-19 19:37:52 +00:00
|
|
|
|
Url = url,
|
|
|
|
|
CancellationToken = cancellationToken,
|
2013-05-21 04:04:38 +00:00
|
|
|
|
AcceptHeader = MovieDbProvider.AcceptHeader
|
2013-05-04 04:15:39 +00:00
|
|
|
|
|
2013-05-19 19:37:52 +00:00
|
|
|
|
}).ConfigureAwait(false))
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-05-19 19:37:52 +00:00
|
|
|
|
searchResult = JsonSerializer.DeserializeFromStream<PersonSearchResults>(json);
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-14 17:34:54 +00:00
|
|
|
|
return searchResult != null && searchResult.Total_Results > 0 ? searchResult.Results[0].Id.ToString(_usCulture) : null;
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Fetches the info.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="person">The person.</param>
|
|
|
|
|
/// <param name="id">The id.</param>
|
2013-10-13 23:56:56 +00:00
|
|
|
|
/// <param name="isForcedRefresh">if set to <c>true</c> [is forced refresh].</param>
|
2013-02-21 01:33:05 +00:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-10-13 23:56:56 +00:00
|
|
|
|
private async Task FetchInfo(Person person, string id, bool isForcedRefresh, CancellationToken cancellationToken)
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-11-05 16:52:43 +00:00
|
|
|
|
var dataFilePath = GetPersonDataFilePath(ConfigurationManager.ApplicationPaths, id);
|
2013-10-13 17:52:57 +00:00
|
|
|
|
|
|
|
|
|
// Only download if not already there
|
|
|
|
|
// The prescan task will take care of updates so we don't need to re-download here
|
2013-11-05 16:52:43 +00:00
|
|
|
|
if (!File.Exists(dataFilePath))
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-10-23 01:11:56 +00:00
|
|
|
|
await DownloadPersonInfo(id, cancellationToken).ConfigureAwait(false);
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-13 23:56:56 +00:00
|
|
|
|
if (isForcedRefresh || ConfigurationManager.Configuration.EnableTmdbUpdates || !HasAltMeta(person))
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-11-05 16:52:43 +00:00
|
|
|
|
var info = JsonSerializer.DeserializeFromFile<PersonResult>(dataFilePath);
|
2013-10-13 17:52:57 +00:00
|
|
|
|
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
|
|
|
|
|
ProcessInfo(person, info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-23 01:11:56 +00:00
|
|
|
|
internal async Task DownloadPersonInfo(string id, CancellationToken cancellationToken)
|
2013-10-13 17:52:57 +00:00
|
|
|
|
{
|
2013-10-23 01:11:56 +00:00
|
|
|
|
var personDataPath = GetPersonDataPath(ConfigurationManager.ApplicationPaths, id);
|
|
|
|
|
|
2013-10-13 17:52:57 +00:00
|
|
|
|
var url = string.Format(@"http://api.themoviedb.org/3/person/{1}?api_key={0}&append_to_response=credits,images", MovieDbProvider.ApiKey, id);
|
|
|
|
|
|
|
|
|
|
using (var json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
|
|
|
|
|
{
|
|
|
|
|
Url = url,
|
|
|
|
|
CancellationToken = cancellationToken,
|
|
|
|
|
AcceptHeader = MovieDbProvider.AcceptHeader
|
|
|
|
|
|
|
|
|
|
}).ConfigureAwait(false))
|
|
|
|
|
{
|
2013-10-23 01:11:56 +00:00
|
|
|
|
Directory.CreateDirectory(personDataPath);
|
|
|
|
|
|
2013-10-31 14:03:23 +00:00
|
|
|
|
using (var fs = _fileSystem.GetFileStream(Path.Combine(personDataPath, DataFileName), FileMode.Create, FileAccess.Write, FileShare.Read, true))
|
2013-10-13 17:52:57 +00:00
|
|
|
|
{
|
|
|
|
|
await json.CopyToAsync(fs).ConfigureAwait(false);
|
|
|
|
|
}
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processes the info.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="person">The person.</param>
|
|
|
|
|
/// <param name="searchResult">The search result.</param>
|
|
|
|
|
protected void ProcessInfo(Person person, PersonResult searchResult)
|
|
|
|
|
{
|
2013-08-21 20:08:26 +00:00
|
|
|
|
if (!person.LockedFields.Contains(MetadataFields.Overview))
|
|
|
|
|
{
|
|
|
|
|
person.Overview = searchResult.biography;
|
|
|
|
|
}
|
2013-02-21 01:33:05 +00:00
|
|
|
|
|
|
|
|
|
DateTime date;
|
|
|
|
|
|
2013-05-07 03:46:14 +00:00
|
|
|
|
if (DateTime.TryParseExact(searchResult.birthday, "yyyy-MM-dd", new CultureInfo("en-US"), DateTimeStyles.None, out date))
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-04-12 18:22:40 +00:00
|
|
|
|
person.PremiereDate = date.ToUniversalTime();
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-05-07 03:46:14 +00:00
|
|
|
|
if (DateTime.TryParseExact(searchResult.deathday, "yyyy-MM-dd", new CultureInfo("en-US"), DateTimeStyles.None, out date))
|
2013-04-12 14:13:47 +00:00
|
|
|
|
{
|
2013-04-12 18:22:40 +00:00
|
|
|
|
person.EndDate = date.ToUniversalTime();
|
2013-04-12 14:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-05-07 03:46:14 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(searchResult.homepage))
|
2013-04-12 14:13:47 +00:00
|
|
|
|
{
|
2013-05-07 03:46:14 +00:00
|
|
|
|
person.HomePageUrl = searchResult.homepage;
|
2013-04-12 14:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-29 18:33:48 +00:00
|
|
|
|
if (!person.LockedFields.Contains(MetadataFields.ProductionLocations))
|
2013-04-12 14:13:47 +00:00
|
|
|
|
{
|
2013-07-29 18:33:48 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(searchResult.place_of_birth))
|
|
|
|
|
{
|
2013-12-05 16:50:21 +00:00
|
|
|
|
person.PlaceOfBirth = searchResult.place_of_birth;
|
2013-07-29 18:33:48 +00:00
|
|
|
|
}
|
2013-04-12 14:13:47 +00:00
|
|
|
|
}
|
2013-07-29 18:33:48 +00:00
|
|
|
|
|
2013-10-14 17:34:54 +00:00
|
|
|
|
person.SetProviderId(MetadataProviders.Tmdb, searchResult.id.ToString(_usCulture));
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Result Objects
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class PersonSearchResult
|
|
|
|
|
/// </summary>
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class PersonSearchResult
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether this <see cref="PersonSearchResult" /> is adult.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if adult; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool Adult { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the id.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The id.</value>
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the name.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The name.</value>
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the profile_ path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The profile_ path.</value>
|
|
|
|
|
public string Profile_Path { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class PersonSearchResults
|
|
|
|
|
/// </summary>
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class PersonSearchResults
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the page.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The page.</value>
|
|
|
|
|
public int Page { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the results.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The results.</value>
|
|
|
|
|
public List<PersonSearchResult> Results { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the total_ pages.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The total_ pages.</value>
|
|
|
|
|
public int Total_Pages { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the total_ results.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The total_ results.</value>
|
|
|
|
|
public int Total_Results { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class Cast
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-05-07 03:46:14 +00:00
|
|
|
|
public int id { get; set; }
|
|
|
|
|
public string title { get; set; }
|
|
|
|
|
public string character { get; set; }
|
|
|
|
|
public string original_title { get; set; }
|
|
|
|
|
public string poster_path { get; set; }
|
|
|
|
|
public string release_date { get; set; }
|
|
|
|
|
public bool adult { get; set; }
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class Crew
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-05-07 03:46:14 +00:00
|
|
|
|
public int id { get; set; }
|
|
|
|
|
public string title { get; set; }
|
|
|
|
|
public string original_title { get; set; }
|
|
|
|
|
public string department { get; set; }
|
|
|
|
|
public string job { get; set; }
|
|
|
|
|
public string poster_path { get; set; }
|
|
|
|
|
public string release_date { get; set; }
|
|
|
|
|
public bool adult { get; set; }
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class Credits
|
2013-02-21 01:33:05 +00:00
|
|
|
|
{
|
2013-05-07 03:46:14 +00:00
|
|
|
|
public List<Cast> cast { get; set; }
|
|
|
|
|
public List<Crew> crew { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class Profile
|
2013-05-07 03:46:14 +00:00
|
|
|
|
{
|
|
|
|
|
public string file_path { get; set; }
|
|
|
|
|
public int width { get; set; }
|
|
|
|
|
public int height { get; set; }
|
|
|
|
|
public object iso_639_1 { get; set; }
|
|
|
|
|
public double aspect_ratio { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class Images
|
2013-05-07 03:46:14 +00:00
|
|
|
|
{
|
|
|
|
|
public List<Profile> profiles { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-05 16:52:43 +00:00
|
|
|
|
public class PersonResult
|
2013-05-07 03:46:14 +00:00
|
|
|
|
{
|
|
|
|
|
public bool adult { get; set; }
|
|
|
|
|
public List<object> also_known_as { get; set; }
|
|
|
|
|
public string biography { get; set; }
|
|
|
|
|
public string birthday { get; set; }
|
|
|
|
|
public string deathday { get; set; }
|
|
|
|
|
public string homepage { get; set; }
|
|
|
|
|
public int id { get; set; }
|
|
|
|
|
public string imdb_id { get; set; }
|
|
|
|
|
public string name { get; set; }
|
|
|
|
|
public string place_of_birth { get; set; }
|
|
|
|
|
public double popularity { get; set; }
|
|
|
|
|
public string profile_path { get; set; }
|
|
|
|
|
public Credits credits { get; set; }
|
|
|
|
|
public Images images { get; set; }
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|