瀏覽代碼

Merge pull request #3836 from cvium/remove_tmdb_api_rate_limit

Remove rate limit from TMDb provider
Bond-009 4 年之前
父節點
當前提交
796eeb2cda
共有 1 個文件被更改,包括 0 次插入15 次删除
  1. 0 15
      MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs

+ 0 - 15
MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs

@@ -406,26 +406,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
             return mainResult;
             return mainResult;
         }
         }
 
 
-        private static long _lastRequestTicks;
-        // The limit is 40 requests per 10 seconds
-        private const int RequestIntervalMs = 300;
-
         /// <summary>
         /// <summary>
         /// Gets the movie db response.
         /// Gets the movie db response.
         /// </summary>
         /// </summary>
         internal async Task<HttpResponseInfo> GetMovieDbResponse(HttpRequestOptions options)
         internal async Task<HttpResponseInfo> GetMovieDbResponse(HttpRequestOptions options)
         {
         {
-            var delayTicks = (RequestIntervalMs * 10000) - (DateTime.UtcNow.Ticks - _lastRequestTicks);
-            var delayMs = Math.Min(delayTicks / 10000, RequestIntervalMs);
-
-            if (delayMs > 0)
-            {
-                _logger.LogDebug("Throttling Tmdb by {0} ms", delayMs);
-                await Task.Delay(Convert.ToInt32(delayMs)).ConfigureAwait(false);
-            }
-
-            _lastRequestTicks = DateTime.UtcNow.Ticks;
-
             options.BufferContent = true;
             options.BufferContent = true;
             options.UserAgent = _appHost.ApplicationUserAgent;
             options.UserAgent = _appHost.ApplicationUserAgent;