mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
DailySeries now use the JSON API instead of the CSV file.
This commit is contained in:
parent
afb8305c00
commit
ad4afbcb6d
2 changed files with 19 additions and 29 deletions
|
@ -4,7 +4,9 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using NLog;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
using PetaPoco;
|
||||
|
||||
namespace NzbDrone.Core.Providers
|
||||
|
@ -44,24 +46,9 @@ namespace NzbDrone.Core.Providers
|
|||
{
|
||||
try
|
||||
{
|
||||
var dailySeries = _httpProvider.DownloadString("http://www.nzbdrone.com/DailySeries.csv");
|
||||
var dailySeriesIds = _httpProvider.DownloadString("http://services.nzbdrone.com/DailySeries/AllIds");
|
||||
|
||||
var seriesIds = new List<int>();
|
||||
|
||||
using (var reader = new StringReader(dailySeries))
|
||||
{
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
int seriesId;
|
||||
|
||||
//Split CSV, first item should be the seriesId
|
||||
var split = line.Split(',');
|
||||
|
||||
if (Int32.TryParse(split[0], out seriesId))
|
||||
seriesIds.Add(seriesId);
|
||||
}
|
||||
}
|
||||
var seriesIds = JsonConvert.DeserializeObject<List<int>>(dailySeriesIds);
|
||||
|
||||
return seriesIds;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue