make sure providers are trying again when appropiate
This commit is contained in:
parent
25314e1fc9
commit
2bd2a7bc68
|
@ -62,23 +62,15 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Needses the refresh internal.
|
||||
/// Gets a value indicating whether [refresh on version change].
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="providerInfo">The provider info.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
/// <value><c>true</c> if [refresh on version change]; otherwise, <c>false</c>.</value>
|
||||
protected override bool RefreshOnVersionChange
|
||||
{
|
||||
// If the last run wasn't successful, try again when there's a new version of ffmpeg
|
||||
if (providerInfo.LastRefreshStatus != ProviderRefreshStatus.Success)
|
||||
{
|
||||
if (!string.Equals(ProviderVersion, providerInfo.ProviderVersion))
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return base.NeedsRefreshInternal(item, providerInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,18 +117,6 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
|||
return await MediaEncoder.GetMediaInfo(inputPath, type, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether [refresh on version change].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [refresh on version change]; otherwise, <c>false</c>.</value>
|
||||
protected override bool RefreshOnVersionChange
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mounts the iso if needed.
|
||||
/// </summary>
|
||||
|
|
|
@ -213,16 +213,9 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
}
|
||||
path = node != null ? node.Value : null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
movie.SetImage(ImageType.Logo, await _providerManager.DownloadAndSaveImage(movie, path, LOGO_FILE, saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
@ -239,16 +232,9 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
doc.SelectSingleNode("//fanart/movie/moviearts/movieart/@url");
|
||||
path = node != null ? node.Value : null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
movie.SetImage(ImageType.Art, await _providerManager.DownloadAndSaveImage(movie, path, ART_FILE, saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
@ -262,16 +248,9 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
doc.SelectSingleNode("//fanart/movie/moviediscs/moviedisc/@url");
|
||||
path = node != null ? node.Value : null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
movie.SetImage(ImageType.Disc, await _providerManager.DownloadAndSaveImage(movie, path, DISC_FILE, saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -286,16 +265,9 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
doc.SelectSingleNode("//fanart/movie/moviebanners/moviebanner/@url");
|
||||
path = node != null ? node.Value : null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
movie.SetImage(ImageType.Banner, await _providerManager.DownloadAndSaveImage(movie, path, BANNER_FILE, saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -310,16 +282,9 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
doc.SelectSingleNode("//fanart/movie/moviethumbs/moviethumb/@url");
|
||||
path = node != null ? node.Value : null;
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
try
|
||||
{
|
||||
movie.SetImage(ImageType.Thumb, await _providerManager.DownloadAndSaveImage(movie, path, THUMB_FILE, saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var hasBackdrop = item.LocationType == LocationType.FileSystem ?
|
||||
|
@ -339,17 +304,10 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting Backdrop for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.BackdropImagePaths.Add(await _providerManager.DownloadAndSaveImage(item, path, ("backdrop" + (numBackdrops > 0 ? numBackdrops.ToString(UsCulture) : "") + ".jpg"), saveLocal, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
numBackdrops++;
|
||||
if (numBackdrops >= ConfigurationManager.Configuration.MaxBackdrops) break;
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
// poster
|
||||
if (images.posters != null && images.posters.Count > 0 && (ConfigurationManager.Configuration.RefreshItemImages || !hasLocalPoster))
|
||||
{
|
||||
var tmdbSettings = await MovieDbProvider.Current.TmdbSettings.ConfigureAwait(false);
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedPosterSize;
|
||||
// get highest rated poster for our language
|
||||
|
@ -281,7 +281,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
item.BackdropImagePaths = new List<string>();
|
||||
|
||||
var tmdbSettings = await MovieDbProvider.Current.TmdbSettings.ConfigureAwait(false);
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var tmdbImageUrl = tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedBackdropSize;
|
||||
//backdrops should be in order of rating. get first n ones
|
||||
|
|
|
@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -20,14 +19,6 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace MediaBrowser.Controller.Providers.Movies
|
||||
{
|
||||
class MovieDbProviderException : ApplicationException
|
||||
{
|
||||
public MovieDbProviderException(string msg)
|
||||
: base(msg)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Class MovieDbProvider
|
||||
/// </summary>
|
||||
|
@ -154,85 +145,42 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
/// <summary>
|
||||
/// The _TMDB settings task
|
||||
/// </summary>
|
||||
private Task<TmdbSettingsResult> _tmdbSettingsTask;
|
||||
/// <summary>
|
||||
/// The _TMDB settings task initialized
|
||||
/// </summary>
|
||||
private bool _tmdbSettingsTaskInitialized;
|
||||
/// <summary>
|
||||
/// The _TMDB settings task sync lock
|
||||
/// </summary>
|
||||
private object _tmdbSettingsTaskSyncLock = new object();
|
||||
private TmdbSettingsResult _tmdbSettings;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the TMDB settings.
|
||||
/// </summary>
|
||||
/// <value>The TMDB settings.</value>
|
||||
public Task<TmdbSettingsResult> TmdbSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
LazyInitializer.EnsureInitialized(ref _tmdbSettingsTask, ref _tmdbSettingsTaskInitialized, ref _tmdbSettingsTaskSyncLock, () => GetTmdbSettings(JsonSerializer));
|
||||
return _tmdbSettingsTask;
|
||||
}
|
||||
}
|
||||
private readonly SemaphoreSlim _tmdbSettingsSemaphore = new SemaphoreSlim(1, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the TMDB settings.
|
||||
/// </summary>
|
||||
/// <returns>Task{TmdbSettingsResult}.</returns>
|
||||
private async Task<TmdbSettingsResult> GetTmdbSettings(IJsonSerializer jsonSerializer)
|
||||
internal async Task<TmdbSettingsResult> GetTmdbSettings(CancellationToken cancellationToken)
|
||||
{
|
||||
if (_tmdbSettings != null)
|
||||
{
|
||||
return _tmdbSettings;
|
||||
}
|
||||
|
||||
await _tmdbSettingsSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
using (var json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = string.Format(TmdbConfigUrl, ApiKey),
|
||||
CancellationToken = CancellationToken.None,
|
||||
CancellationToken = cancellationToken,
|
||||
AcceptHeader = AcceptHeader,
|
||||
EnableResponseCache = true
|
||||
|
||||
}).ConfigureAwait(false))
|
||||
{
|
||||
return jsonSerializer.DeserializeFromStream<TmdbSettingsResult>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
return new TmdbSettingsResult
|
||||
{
|
||||
images = new TmdbImageSettings
|
||||
{
|
||||
backdrop_sizes =
|
||||
new List<string>
|
||||
{
|
||||
"w380",
|
||||
"w780",
|
||||
"w1280",
|
||||
"original"
|
||||
},
|
||||
poster_sizes =
|
||||
new List<string>
|
||||
{
|
||||
"w92",
|
||||
"w154",
|
||||
"w185",
|
||||
"w342",
|
||||
"w500",
|
||||
"original"
|
||||
},
|
||||
profile_sizes =
|
||||
new List<string>
|
||||
{
|
||||
"w45",
|
||||
"w185",
|
||||
"h632",
|
||||
"original"
|
||||
},
|
||||
base_url = "http://cf2.imgobject.com/t/p/"
|
||||
_tmdbSettings = JsonSerializer.DeserializeFromStream<TmdbSettingsResult>(json);
|
||||
|
||||
return _tmdbSettings;
|
||||
}
|
||||
};
|
||||
}
|
||||
finally
|
||||
{
|
||||
_tmdbSettingsSemaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,13 +232,16 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
new Regex(@"(?<name>.*)") // last resort matches the whole string as the name
|
||||
};
|
||||
|
||||
public const string LOCAL_META_FILE_NAME = "tmdb3.json";
|
||||
public const string ALT_META_FILE_NAME = "movie.xml";
|
||||
public const string LocalMetaFileName = "tmdb3.json";
|
||||
public const string AltMetaFileName = "movie.xml";
|
||||
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
{
|
||||
if (item.DontFetchMeta) return false;
|
||||
|
||||
if (HasAltMeta(item))
|
||||
return false; //never refresh if has meta from other source
|
||||
|
||||
if (item.LocationType == LocationType.FileSystem &&
|
||||
ConfigurationManager.Configuration.SaveLocalMeta &&
|
||||
HasFileSystemStampChanged(item, providerInfo))
|
||||
|
@ -302,31 +253,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
|
||||
}
|
||||
|
||||
if (providerInfo.LastRefreshStatus != ProviderRefreshStatus.Success)
|
||||
{
|
||||
Logger.Debug("MovieProvider for {0} - last attempt had errors. Will try again.", item.Path);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (RefreshOnVersionChange && !String.Equals(ProviderVersion, providerInfo.ProviderVersion))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var downloadDate = providerInfo.LastRefreshed;
|
||||
|
||||
if (ConfigurationManager.Configuration.MetadataRefreshDays == -1 && downloadDate != DateTime.MinValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DateTime.Today.Subtract(downloadDate).TotalDays < ConfigurationManager.Configuration.MetadataRefreshDays) // only refresh every n days
|
||||
return false;
|
||||
|
||||
if (HasAltMeta(item))
|
||||
return false; //never refresh if has meta from other source
|
||||
|
||||
return true;
|
||||
return base.NeedsRefreshInternal(item, providerInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -353,20 +280,14 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
if (!ConfigurationManager.Configuration.SaveLocalMeta || !HasLocalMeta(item) || (force && !HasLocalMeta(item)))
|
||||
{
|
||||
try
|
||||
{
|
||||
await FetchMovieData(item, cancellationToken).ConfigureAwait(false);
|
||||
SetLastRefreshed(item, DateTime.UtcNow);
|
||||
}
|
||||
catch (MovieDbProviderException)
|
||||
else
|
||||
{
|
||||
SetLastRefreshed(item, DateTime.UtcNow, ProviderRefreshStatus.CompletedWithErrors);
|
||||
Logger.Debug("MovieDBProvider not fetching because local meta exists for " + item.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Logger.Debug("MovieDBProvider not fetching because local meta exists for " + item.Name);
|
||||
SetLastRefreshed(item, DateTime.UtcNow);
|
||||
return true;
|
||||
}
|
||||
|
@ -379,7 +300,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
private bool HasLocalMeta(BaseItem item)
|
||||
{
|
||||
//need at least the xml and folder.jpg/png or a movie.xml put in by someone else
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(LOCAL_META_FILE_NAME);
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(LocalMetaFileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -389,7 +310,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
/// <returns><c>true</c> if [has alt meta] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
private bool HasAltMeta(BaseItem item)
|
||||
{
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(ALT_META_FILE_NAME);
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(AltMetaFileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -557,8 +478,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
string url3 = string.Format(Search3, UrlEncode(name), ApiKey, language);
|
||||
TmdbMovieSearchResults searchResult = null;
|
||||
|
||||
try
|
||||
{
|
||||
using (Stream json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url3,
|
||||
|
@ -570,10 +489,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
|
||||
if (searchResult == null || searchResult.results.Count == 0)
|
||||
{
|
||||
//try replacing numbers
|
||||
|
@ -596,8 +512,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
Logger.Info("MovieDBProvider - No results. Trying replacement numbers: " + name);
|
||||
url3 = string.Format(Search3, UrlEncode(name), ApiKey, language);
|
||||
|
||||
try
|
||||
{
|
||||
using (var json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url3,
|
||||
|
@ -610,10 +524,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
searchResult = JsonSerializer.DeserializeFromStream<TmdbMovieSearchResults>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (searchResult != null)
|
||||
{
|
||||
string compName = GetComparableName(name, Logger);
|
||||
|
@ -642,8 +552,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
//that title didn't match - look for alternatives
|
||||
url3 = string.Format(AltTitleSearch, id, ApiKey, ConfigurationManager.Configuration.MetadataCountryCode);
|
||||
|
||||
try
|
||||
{
|
||||
using (var json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url3,
|
||||
|
@ -673,10 +581,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (matchedName != null)
|
||||
{
|
||||
|
@ -731,8 +635,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
string url = string.Format(GetMovieInfo3, childId, ApiKey, language);
|
||||
|
||||
try
|
||||
{
|
||||
using (Stream json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -754,10 +656,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -795,7 +693,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await ProviderManager.SaveToLibraryFilesystem(item, Path.Combine(item.MetaLocation, LOCAL_META_FILE_NAME), ms, cancellationToken).ConfigureAwait(false);
|
||||
await ProviderManager.SaveToLibraryFilesystem(item, Path.Combine(item.MetaLocation, LocalMetaFileName), ms, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -815,8 +713,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
try
|
||||
{
|
||||
using (var json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -828,22 +724,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException e)
|
||||
{
|
||||
if (e.IsTimedOut)
|
||||
{
|
||||
Logger.ErrorException("MovieDbProvider timed out attempting to retrieve main info for {0}", e, item.Path);
|
||||
throw new MovieDbProviderException("Timed out on main info");
|
||||
}
|
||||
if (e.StatusCode == HttpStatusCode.NotFound)
|
||||
{
|
||||
Logger.ErrorException("MovieDbProvider not found error attempting to retrieve main info for {0}", e, item.Path);
|
||||
throw new MovieDbProviderException("Not Found");
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
@ -855,8 +735,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
|
||||
url = string.Format(baseUrl, id, ApiKey, "en");
|
||||
|
||||
try
|
||||
{
|
||||
using (Stream json = await GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -868,10 +746,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
mainResult = JsonSerializer.DeserializeFromStream<CompleteMovieData>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(mainResult.overview))
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
/// <returns>DateTime.</returns>
|
||||
protected override DateTime CompareDate(BaseItem item)
|
||||
{
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, LOCAL_META_FILE_NAME));
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, LocalMetaFileName));
|
||||
return entry != null ? entry.LastWriteTimeUtc : DateTime.MinValue;
|
||||
}
|
||||
|
||||
|
@ -64,12 +64,12 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
{
|
||||
if (item.ResolveArgs.ContainsMetaFileByName(ALT_META_FILE_NAME))
|
||||
if (item.ResolveArgs.ContainsMetaFileByName(AltMetaFileName))
|
||||
{
|
||||
return false; // don't read our file if 3rd party data exists
|
||||
}
|
||||
|
||||
if (!item.ResolveArgs.ContainsMetaFileByName(LOCAL_META_FILE_NAME))
|
||||
if (!item.ResolveArgs.ContainsMetaFileByName(LocalMetaFileName))
|
||||
{
|
||||
return false; // nothing to read
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, LOCAL_META_FILE_NAME));
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, LocalMetaFileName));
|
||||
if (entry != null)
|
||||
{
|
||||
// read in our saved meta and pass to processing function
|
||||
|
|
|
@ -71,24 +71,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Needses the refresh internal.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="providerInfo">The provider info.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
{
|
||||
if (RefreshOnVersionChange && !String.Equals(ProviderVersion, providerInfo.ProviderVersion))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//we fetch if either info or image needed and haven't already tried recently
|
||||
return (string.IsNullOrEmpty(item.PrimaryImagePath) || !item.ResolveArgs.ContainsMetaFileByName(MetaFileName))
|
||||
&& DateTime.Today.Subtract(providerInfo.LastRefreshed).TotalDays > ConfigurationManager.Configuration.MetadataRefreshDays;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches metadata and returns true or false indicating if any work that requires persistence was done
|
||||
/// </summary>
|
||||
|
@ -159,8 +141,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
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;
|
||||
|
||||
try
|
||||
{
|
||||
using (Stream json = await MovieDbProvider.Current.GetMovieDbResponse(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -172,10 +152,6 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
{
|
||||
searchResult = JsonSerializer.DeserializeFromStream<PersonSearchResults>(json);
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
}
|
||||
|
||||
return searchResult != null && searchResult.Total_Results > 0 ? searchResult.Results[0].Id.ToString(UsCulture) : null;
|
||||
}
|
||||
|
@ -293,7 +269,7 @@ namespace MediaBrowser.Controller.Providers.Movies
|
|||
}
|
||||
if (profile != null)
|
||||
{
|
||||
var tmdbSettings = await MovieDbProvider.Current.TmdbSettings.ConfigureAwait(false);
|
||||
var tmdbSettings = await MovieDbProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var img = await DownloadAndSaveImage(person, tmdbSettings.images.base_url + ConfigurationManager.Configuration.TmdbFetchedProfileSize + profile.file_path,
|
||||
"folder" + Path.GetExtension(profile.file_path), cancellationToken).ConfigureAwait(false);
|
||||
|
|
|
@ -4,7 +4,6 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
@ -139,8 +138,6 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
|
||||
var doc = new XmlDocument();
|
||||
|
||||
var status = ProviderRefreshStatus.Success;
|
||||
|
||||
using (var xml = await HttpClient.Get(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -166,15 +163,8 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting Disc for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Disc, await _providerManager.DownloadAndSaveImage(item, path, DISC_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigurationManager.Configuration.DownloadMusicAlbumImages.Primary && !item.ResolveArgs.ContainsMetaFileByName(PRIMARY_FILE))
|
||||
|
@ -186,19 +176,12 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting albumcover for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Primary, await _providerManager.DownloadAndSaveImage(item, path, PRIMARY_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetLastRefreshed(item, DateTime.UtcNow, status);
|
||||
SetLastRefreshed(item, DateTime.UtcNow);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -146,15 +146,8 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting ClearLogo for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Logo, await _providerManager.DownloadAndSaveImage(item, path, LOGO_FILE, SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
@ -171,17 +164,10 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting Backdrop for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.BackdropImagePaths.Add(await _providerManager.DownloadAndSaveImage(item, path, ("Backdrop" + (numBackdrops > 0 ? numBackdrops.ToString(UsCulture) : "") + ".jpg"), SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
numBackdrops++;
|
||||
if (numBackdrops >= ConfigurationManager.Configuration.MaxBackdrops) break;
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -199,15 +185,8 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting ClearArt for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Art, await _providerManager.DownloadAndSaveImage(item, path, ART_FILE, SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
@ -219,15 +198,8 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting Banner for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Banner, await _providerManager.DownloadAndSaveImage(item, path, BANNER_FILE, SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -240,15 +212,8 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting Primary image for " + item.Name);
|
||||
try
|
||||
{
|
||||
item.SetImage(ImageType.Primary, await _providerManager.DownloadAndSaveImage(item, path, PRIMARY_FILE, SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,8 +93,6 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
//Execute the Artist search against our name and assume first one is the one we want
|
||||
var url = RootUrl + string.Format("method=artist.search&artist={0}&api_key={1}&format=json", UrlEncode(item.Name), ApiKey);
|
||||
|
||||
try
|
||||
{
|
||||
using (var json = await HttpClient.Get(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
@ -125,11 +123,6 @@ namespace MediaBrowser.Controller.Providers.Music
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -127,15 +127,8 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting ClearLogo for " + series.Name);
|
||||
try
|
||||
{
|
||||
series.SetImage(ImageType.Logo, await _providerManager.DownloadAndSaveImage(series, path, LOGO_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -151,15 +144,8 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting ClearArt for " + series.Name);
|
||||
try
|
||||
{
|
||||
series.SetImage(ImageType.Art, await _providerManager.DownloadAndSaveImage(series, path, ART_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
@ -172,15 +158,8 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting ThumbArt for " + series.Name);
|
||||
try
|
||||
{
|
||||
series.SetImage(ImageType.Thumb, await _providerManager.DownloadAndSaveImage(series, path, THUMB_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigurationManager.Configuration.DownloadSeriesImages.Banner && !series.ResolveArgs.ContainsMetaFileByName(BANNER_FILE))
|
||||
|
@ -191,15 +170,8 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Logger.Debug("FanArtProvider getting banner for " + series.Name);
|
||||
try
|
||||
{
|
||||
series.SetImage(ImageType.Banner, await _providerManager.DownloadAndSaveImage(series, path, BANNER_FILE, ConfigurationManager.Configuration.SaveLocalMeta, FanArtResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities.TV;
|
|||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -182,16 +181,9 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
{
|
||||
n = n.SelectSingleNode("./BannerPath");
|
||||
|
||||
try
|
||||
{
|
||||
if (n != null)
|
||||
season.PrimaryImagePath = await _providerManager.DownloadAndSaveImage(season, TVUtils.BannerUrl + n.InnerText, "folder" + Path.GetExtension(n.InnerText), ConfigurationManager.Configuration.SaveLocalMeta, RemoteSeriesProvider.Current.TvDbResourcePool, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConfigurationManager.Configuration.DownloadSeasonImages.Banner && (ConfigurationManager.Configuration.RefreshItemImages || !season.HasLocalImage("banner")))
|
||||
|
@ -202,8 +194,6 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
{
|
||||
n = n.SelectSingleNode("./BannerPath");
|
||||
if (n != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var bannerImagePath =
|
||||
await _providerManager.DownloadAndSaveImage(season,
|
||||
|
@ -215,11 +205,6 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
|
||||
season.SetImage(ImageType.Banner, bannerImagePath);
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,17 +215,10 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
{
|
||||
n = n.SelectSingleNode("./BannerPath");
|
||||
if (n != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (season.BackdropImagePaths == null) season.BackdropImagePaths = new List<string>();
|
||||
season.BackdropImagePaths.Add(await _providerManager.DownloadAndSaveImage(season, TVUtils.BannerUrl + n.InnerText, "backdrop" + Path.GetExtension(n.InnerText), ConfigurationManager.Configuration.SaveLocalMeta, RemoteSeriesProvider.Current.TvDbResourcePool, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!ConfigurationManager.Configuration.SaveLocalMeta) //if saving local - season will inherit from series
|
||||
{
|
||||
|
@ -256,8 +234,6 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (season.BackdropImagePaths == null)
|
||||
season.BackdropImagePaths = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
season.BackdropImagePaths.Add(
|
||||
await _providerManager.DownloadAndSaveImage(season,
|
||||
TVUtils.BannerUrl +
|
||||
|
@ -268,11 +244,6 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
ConfigurationManager.Configuration.SaveLocalMeta, RemoteSeriesProvider.Current.TvDbResourcePool, cancellationToken)
|
||||
.ConfigureAwait(false));
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,24 +75,24 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
/// <summary>
|
||||
/// The root URL
|
||||
/// </summary>
|
||||
private const string rootUrl = "http://www.thetvdb.com/api/";
|
||||
private const string RootUrl = "http://www.thetvdb.com/api/";
|
||||
/// <summary>
|
||||
/// The series query
|
||||
/// </summary>
|
||||
private const string seriesQuery = "GetSeries.php?seriesname={0}";
|
||||
private const string SeriesQuery = "GetSeries.php?seriesname={0}";
|
||||
/// <summary>
|
||||
/// The series get
|
||||
/// </summary>
|
||||
private const string seriesGet = "http://www.thetvdb.com/api/{0}/series/{1}/{2}.xml";
|
||||
private const string SeriesGet = "http://www.thetvdb.com/api/{0}/series/{1}/{2}.xml";
|
||||
/// <summary>
|
||||
/// The get actors
|
||||
/// </summary>
|
||||
private const string getActors = "http://www.thetvdb.com/api/{0}/series/{1}/actors.xml";
|
||||
private const string GetActors = "http://www.thetvdb.com/api/{0}/series/{1}/actors.xml";
|
||||
|
||||
/// <summary>
|
||||
/// The LOCA l_ MET a_ FIL e_ NAME
|
||||
/// </summary>
|
||||
protected const string LOCAL_META_FILE_NAME = "Series.xml";
|
||||
protected const string LocalMetaFileName = "Series.xml";
|
||||
|
||||
/// <summary>
|
||||
/// Supportses the specified item.
|
||||
|
@ -133,15 +133,6 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
{
|
||||
var downloadDate = providerInfo.LastRefreshed;
|
||||
|
||||
if (ConfigurationManager.Configuration.MetadataRefreshDays == -1 && downloadDate != DateTime.MinValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.DontFetchMeta) return false;
|
||||
|
||||
return !HasLocalMeta(item) && base.NeedsRefreshInternal(item, providerInfo);
|
||||
}
|
||||
|
||||
|
@ -195,7 +186,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
if (!string.IsNullOrEmpty(seriesId))
|
||||
{
|
||||
|
||||
string url = string.Format(seriesGet, TVUtils.TvdbApiKey, seriesId, ConfigurationManager.Configuration.PreferredMetadataLanguage);
|
||||
string url = string.Format(SeriesGet, TVUtils.TvdbApiKey, seriesId, ConfigurationManager.Configuration.PreferredMetadataLanguage);
|
||||
var doc = new XmlDocument();
|
||||
|
||||
using (var xml = await HttpClient.Get(new HttpRequestOptions
|
||||
|
@ -273,7 +264,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
var ms = new MemoryStream();
|
||||
doc.Save(ms);
|
||||
|
||||
await _providerManager.SaveToLibraryFilesystem(series, Path.Combine(series.MetaLocation, LOCAL_META_FILE_NAME), ms, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveToLibraryFilesystem(series, Path.Combine(series.MetaLocation, LocalMetaFileName), ms, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +282,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
/// <returns>Task.</returns>
|
||||
private async Task FetchActors(Series series, string seriesId, XmlDocument doc, CancellationToken cancellationToken)
|
||||
{
|
||||
string urlActors = string.Format(getActors, TVUtils.TvdbApiKey, seriesId);
|
||||
string urlActors = string.Format(GetActors, TVUtils.TvdbApiKey, seriesId);
|
||||
var docActors = new XmlDocument();
|
||||
|
||||
using (var actors = await HttpClient.Get(new HttpRequestOptions
|
||||
|
@ -440,7 +431,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
/// <returns><c>true</c> if [has local meta] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||
private bool HasLocalMeta(BaseItem item)
|
||||
{
|
||||
return item.ResolveArgs.ContainsMetaFileByName(LOCAL_META_FILE_NAME);
|
||||
return item.ResolveArgs.ContainsMetaFileByName(LocalMetaFileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -470,7 +461,7 @@ namespace MediaBrowser.Controller.Providers.TV
|
|||
{
|
||||
|
||||
//nope - search for it
|
||||
string url = string.Format(rootUrl + seriesQuery, WebUtility.UrlEncode(name));
|
||||
string url = string.Format(RootUrl + SeriesQuery, WebUtility.UrlEncode(name));
|
||||
var doc = new XmlDocument();
|
||||
|
||||
using (var results = await HttpClient.Get(new HttpRequestOptions
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
// If we already know it's a movie, we can stop looping
|
||||
if (!isKnownMovie.HasValue)
|
||||
{
|
||||
isKnownMovie = args.ContainsMetaFileByName("movie.xml") || args.ContainsMetaFileByName(MovieDbProvider.LOCAL_META_FILE_NAME) || args.Path.IndexOf("[tmdbid", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
isKnownMovie = args.ContainsMetaFileByName("movie.xml") || args.ContainsMetaFileByName(MovieDbProvider.LocalMetaFileName) || args.Path.IndexOf("[tmdbid", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
}
|
||||
|
||||
if (isKnownMovie.Value)
|
||||
|
|
Loading…
Reference in New Issue
Block a user