2020-09-25 02:30:20 +00:00
|
|
|
using System;
|
|
|
|
using NzbDrone.Common.Http;
|
2020-07-13 20:04:59 +00:00
|
|
|
|
2020-09-04 02:50:56 +00:00
|
|
|
namespace NzbDrone.Core.ImportLists.RadarrList2.IMDbList
|
2020-07-13 20:04:59 +00:00
|
|
|
{
|
|
|
|
public class IMDbListRequestGenerator : RadarrList2RequestGeneratorBase
|
|
|
|
{
|
|
|
|
public IMDbListSettings Settings { get; set; }
|
|
|
|
|
|
|
|
protected override HttpRequest GetHttpRequest()
|
|
|
|
{
|
2022-11-20 18:27:45 +00:00
|
|
|
// Use IMDb list Export for user lists to bypass RadarrAPI caching
|
2020-09-25 02:30:20 +00:00
|
|
|
if (Settings.ListId.StartsWith("ls", StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
return new HttpRequest($"https://www.imdb.com/list/{Settings.ListId}/export", new HttpAccept("*/*"));
|
|
|
|
}
|
|
|
|
|
2020-07-13 20:04:59 +00:00
|
|
|
return RequestBuilder.Create()
|
|
|
|
.SetSegment("route", $"list/imdb/{Settings.ListId}")
|
2020-09-25 02:30:20 +00:00
|
|
|
.Accept(HttpAccept.Json)
|
2020-07-13 20:04:59 +00:00
|
|
|
.Build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|