Added files for anime importing
This commit is contained in:
parent
5184d995ca
commit
7fd74f59ad
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NLog;
|
||||||
|
using NzbDrone.Common.Http;
|
||||||
|
using NzbDrone.Core.Configuration;
|
||||||
|
using NzbDrone.Core.Parser;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.ImportLists.MyAnimeList
|
||||||
|
{
|
||||||
|
internal class MalImport : HttpImportListBase<MalListSettings>
|
||||||
|
{
|
||||||
|
public override string Name => "MyAnimeList";
|
||||||
|
public override ImportListType ListType => ImportListType.Other;
|
||||||
|
public override TimeSpan MinRefreshInterval => throw new NotImplementedException();
|
||||||
|
|
||||||
|
// This constructor the first thing that is called when sonarr creates a button
|
||||||
|
public MalImport(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||||
|
: base(httpClient, importListStatusService, configService, parsingService, logger)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IList<ImportListItemInfo> Fetch()
|
||||||
|
{
|
||||||
|
return FetchItems(g => g.GetListItems());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IParseImportListResponse GetParser()
|
||||||
|
{
|
||||||
|
return new MalParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IImportListRequestGenerator GetRequestGenerator()
|
||||||
|
{
|
||||||
|
return new MalRequestGenerator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
using FluentValidation;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.ImportLists.MyAnimeList
|
||||||
|
{
|
||||||
|
internal class MalSettingsValidator : AbstractValidator<MalListSettings>
|
||||||
|
{
|
||||||
|
public MalSettingsValidator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class MalListSettings : IImportListSettings
|
||||||
|
{
|
||||||
|
public string BaseUrl { get; set; }
|
||||||
|
|
||||||
|
protected AbstractValidator<MalListSettings> Validator => new MalSettingsValidator();
|
||||||
|
|
||||||
|
// This constructor is called when we try to add a new list
|
||||||
|
public MalListSettings()
|
||||||
|
{
|
||||||
|
BaseUrl = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public NzbDroneValidationResult Validate()
|
||||||
|
{
|
||||||
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.ImportLists.MyAnimeList
|
||||||
|
{
|
||||||
|
internal class MalParser : IParseImportListResponse
|
||||||
|
{
|
||||||
|
public IList<ImportListItemInfo> ParseResponse(ImportListResponse importListResponse)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace NzbDrone.Core.ImportLists.MyAnimeList
|
||||||
|
{
|
||||||
|
internal class MalRequestGenerator : IImportListRequestGenerator
|
||||||
|
{
|
||||||
|
public ImportListPageableRequestChain GetListItems()
|
||||||
|
{
|
||||||
|
var pageableReq = new ImportListPageableRequestChain();
|
||||||
|
/*
|
||||||
|
* create
|
||||||
|
*/
|
||||||
|
return pageableReq;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue