|
|
@ -273,11 +273,6 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id = await FindId(item, cancellationToken).ConfigureAwait(false);
|
|
|
|
id = await FindId(item, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.SetProviderId(MetadataProviders.Tmdb, id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
|
if (!string.IsNullOrEmpty(id))
|
|
|
@ -506,6 +501,8 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
|
|
|
|
|
|
|
|
var dataFilePath = GetDataFilePath(item);
|
|
|
|
var dataFilePath = GetDataFilePath(item);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tmdbId = item.GetProviderId(MetadataProviders.Tmdb);
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(dataFilePath) || !File.Exists(dataFilePath) || !File.Exists(GetImagesDataFilePath(item)))
|
|
|
|
if (string.IsNullOrEmpty(dataFilePath) || !File.Exists(dataFilePath) || !File.Exists(GetImagesDataFilePath(item)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var isBoxSet = item is BoxSet;
|
|
|
|
var isBoxSet = item is BoxSet;
|
|
|
@ -514,7 +511,9 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
|
|
|
|
|
|
|
|
if (mainResult == null) return;
|
|
|
|
if (mainResult == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
var movieDataPath = GetMovieDataPath(ConfigurationManager.ApplicationPaths, isBoxSet, mainResult.id.ToString(_usCulture));
|
|
|
|
tmdbId = mainResult.id.ToString(_usCulture);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var movieDataPath = GetMovieDataPath(ConfigurationManager.ApplicationPaths, isBoxSet, tmdbId);
|
|
|
|
|
|
|
|
|
|
|
|
dataFilePath = Path.Combine(movieDataPath, language + ".json");
|
|
|
|
dataFilePath = Path.Combine(movieDataPath, language + ".json");
|
|
|
|
|
|
|
|
|
|
|
@ -534,7 +533,7 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
|
|
|
|
|
|
|
|
if (isForcedRefresh || ConfigurationManager.Configuration.EnableTmdbUpdates || !HasAltMeta(item))
|
|
|
|
if (isForcedRefresh || ConfigurationManager.Configuration.EnableTmdbUpdates || !HasAltMeta(item))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dataFilePath = GetDataFilePath(item);
|
|
|
|
dataFilePath = GetDataFilePath(item, tmdbId);
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(dataFilePath))
|
|
|
|
if (!string.IsNullOrEmpty(dataFilePath))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -582,8 +581,6 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
/// <returns>System.String.</returns>
|
|
|
|
internal string GetDataFilePath(BaseItem item)
|
|
|
|
internal string GetDataFilePath(BaseItem item)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var language = ConfigurationManager.Configuration.PreferredMetadataLanguage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id = item.GetProviderId(MetadataProviders.Tmdb);
|
|
|
|
var id = item.GetProviderId(MetadataProviders.Tmdb);
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
|
if (string.IsNullOrEmpty(id))
|
|
|
@ -591,7 +588,14 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var path = GetMovieDataPath(ConfigurationManager.ApplicationPaths, item is BoxSet, id);
|
|
|
|
return GetDataFilePath(item, id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal string GetDataFilePath(BaseItem item, string tmdbId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var language = ConfigurationManager.Configuration.PreferredMetadataLanguage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var path = GetMovieDataPath(ConfigurationManager.ApplicationPaths, item is BoxSet, tmdbId);
|
|
|
|
|
|
|
|
|
|
|
|
path = Path.Combine(path, language + ".json");
|
|
|
|
path = Path.Combine(path, language + ".json");
|
|
|
|
|
|
|
|
|
|
|
@ -681,8 +685,6 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
/// <param name="movie">The movie.</param>
|
|
|
|
/// <param name="movie">The movie.</param>
|
|
|
|
/// <param name="movieData">The movie data.</param>
|
|
|
|
/// <param name="movieData">The movie data.</param>
|
|
|
|
private void ProcessMainInfo(BaseItem movie, CompleteMovieData movieData)
|
|
|
|
private void ProcessMainInfo(BaseItem movie, CompleteMovieData movieData)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (movie != null && movieData != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!movie.LockedFields.Contains(MetadataFields.Name))
|
|
|
|
if (!movie.LockedFields.Contains(MetadataFields.Name))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -704,6 +706,7 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
movie.AddTagline(movieData.tagline);
|
|
|
|
movie.AddTagline(movieData.tagline);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
movie.SetProviderId(MetadataProviders.Tmdb, movieData.id.ToString(_usCulture));
|
|
|
|
movie.SetProviderId(MetadataProviders.Imdb, movieData.imdb_id);
|
|
|
|
movie.SetProviderId(MetadataProviders.Imdb, movieData.imdb_id);
|
|
|
|
|
|
|
|
|
|
|
|
if (movieData.belongs_to_collection != null)
|
|
|
|
if (movieData.belongs_to_collection != null)
|
|
|
@ -874,8 +877,6 @@ namespace MediaBrowser.Providers.Movies
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private DateTime _lastRequestDate = DateTime.MinValue;
|
|
|
|
private DateTime _lastRequestDate = DateTime.MinValue;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|