You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
997 B
32 lines
997 B
using System.Collections.Generic;
|
|
using NLog;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Common.Instrumentation;
|
|
using NzbDrone.Common.Serializer;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.ImportLists.MyAnimeList
|
|
{
|
|
public class MyAnimeListParser : IParseImportListResponse
|
|
{
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(MyAnimeListParser));
|
|
|
|
public IList<ImportListItemInfo> ParseResponse(ImportListResponse importListResponse)
|
|
{
|
|
var jsonResponse = Json.Deserialize<MyAnimeListResponse>(importListResponse.Content);
|
|
var series = new List<ImportListItemInfo>();
|
|
|
|
foreach (var show in jsonResponse.Animes)
|
|
{
|
|
series.AddIfNotNull(new ImportListItemInfo
|
|
{
|
|
Title = show.AnimeListInfo.Title,
|
|
MalId = show.AnimeListInfo.Id
|
|
});
|
|
}
|
|
|
|
return series;
|
|
}
|
|
}
|
|
}
|