1616using Kantan . Net . Utilities ;
1717using Kantan . Net . Web ;
1818using Kantan . Text ;
19- using SmartImage . Lib . Model ;
2019using SmartImage . Lib . Results ;
20+ using SmartImage . Lib . Results . Data ;
2121using SmartImage . Lib . Utilities ;
2222
2323namespace SmartImage . Lib . Engines . Impl . Search ;
@@ -26,7 +26,7 @@ namespace SmartImage.Lib.Engines.Impl.Search;
2626/// <see cref="SearchEngineOptions.EHentai" />
2727/// </summary>
2828/// <remarks>Handles both ExHentai and E-Hentai</remarks>
29- public sealed class EHentaiEngine : WebSearchEngine , IConfig , ICookieEngine , INotifyPropertyChanged
29+ public sealed class EHentaiEngine : WebSearchEngine , IConfigurable , ICookieReceiver , INotifyPropertyChanged
3030{
3131
3232 private const string HOST_EH = ".e-hentai.org" ;
@@ -91,10 +91,10 @@ public EHentaiEngine(bool useExHentai = true) : base(EHentaiBase)
9191 * https://gitlab.com/NekoInverter/EhViewer/-/blob/master/app/src/main/java/com/hippo/ehviewer/client/EhCookieStore.java
9292 */
9393
94- public async ValueTask ApplyConfigAsync ( SearchConfig cfg )
94+ public async ValueTask ApplyAsync ( SearchConfig cfg )
9595 {
9696 /*if (this is { IsLoggedIn: true }/* && !(Username != cfg.EhUsername && Password != cfg.EhPassword)#1#) {
97- Debug.WriteLine($"{Name} is already logged in", nameof(ApplyConfigAsync ));
97+ Debug.WriteLine($"{Name} is already logged in", nameof(ApplyAsync ));
9898
9999 return;
100100 }*/
@@ -108,16 +108,18 @@ public async ValueTask ApplyConfigAsync(SearchConfig cfg)
108108 */
109109
110110
111- public async ValueTask < bool > ApplyCookiesAsync ( IEnumerable < IBrowserCookie > cookies = null )
111+ public async ValueTask < bool > ApplyCookiesAsync ( ICookieProvider provider , CancellationToken ct = default )
112112 {
113113 Trace . WriteLine ( $ "Applying cookies to { Name } ") ;
114114
115- if ( await CookiesManager . Instance . LoadCookiesAsync ( ) ) {
115+ /* if (await CookiesManager.Instance.LoadCookiesAsync()) {
116116 cookies ??= CookiesManager.Instance.Cookies;
117117 }
118118 else {
119119 return false;
120- }
120+ }*/
121+
122+ var cookies = await provider . LoadCookiesAsync ( ct ) ;
121123
122124 var fcc = cookies . OfType < FirefoxCookie > ( ) . Where ( x =>
123125 {
0 commit comments