mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
cleanup and throttle API calls
This commit is contained in:
parent
85302bded0
commit
7a7abf577e
2 changed files with 2 additions and 8 deletions
|
@ -15,8 +15,6 @@ namespace NzbDrone.Core.ImportLists.Youtube
|
||||||
public abstract class YoutubeImportListBase<TSettings> : ImportListBase<TSettings>
|
public abstract class YoutubeImportListBase<TSettings> : ImportListBase<TSettings>
|
||||||
where TSettings : YoutubePlaylistSettings, new()
|
where TSettings : YoutubePlaylistSettings, new()
|
||||||
{
|
{
|
||||||
private IHttpClient _httpClient;
|
|
||||||
|
|
||||||
protected YoutubeImportListBase(IImportListStatusService importListStatusService,
|
protected YoutubeImportListBase(IImportListStatusService importListStatusService,
|
||||||
IConfigService configService,
|
IConfigService configService,
|
||||||
IParsingService parsingService,
|
IParsingService parsingService,
|
||||||
|
@ -24,7 +22,6 @@ namespace NzbDrone.Core.ImportLists.Youtube
|
||||||
Logger logger)
|
Logger logger)
|
||||||
: base(importListStatusService, configService, parsingService, logger)
|
: base(importListStatusService, configService, parsingService, logger)
|
||||||
{
|
{
|
||||||
_httpClient = httpClient;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ImportListType ListType => ImportListType.Youtube;
|
public override ImportListType ListType => ImportListType.Youtube;
|
||||||
|
@ -45,11 +42,6 @@ namespace NzbDrone.Core.ImportLists.Youtube
|
||||||
return CleanupListItems(releases);
|
return CleanupListItems(releases);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<YoutubeImportListItemInfo> MapYoutubeReleases(IList<YoutubeImportListItemInfo> items)
|
|
||||||
{
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract IList<YoutubeImportListItemInfo> Fetch(YouTubeService service);
|
public abstract IList<YoutubeImportListItemInfo> Fetch(YouTubeService service);
|
||||||
|
|
||||||
protected override void Test(List<ValidationFailure> failures)
|
protected override void Test(List<ValidationFailure> failures)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using DryIoc.ImTools;
|
using DryIoc.ImTools;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using Google.Apis.YouTube.v3;
|
using Google.Apis.YouTube.v3;
|
||||||
|
@ -62,6 +63,7 @@ namespace NzbDrone.Core.ImportLists.Youtube
|
||||||
results.Add(listItem);
|
results.Add(listItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||||
playlist = req.Execute();
|
playlist = req.Execute();
|
||||||
}
|
}
|
||||||
while (playlist.NextPageToken != null && page < 10);
|
while (playlist.NextPageToken != null && page < 10);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue