Merge pull request #2 from spaytac/bugfix/BUG1-Client-Http-Connection-Issue

**fixed** WallabagServiceEntries.cs: http scheme was always replaced …
This commit is contained in:
Aytac Kirmizi 2023-02-07 11:36:32 +01:00 committed by GitHub
commit bfa2c37210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 3 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ obj/
riderModule.iml riderModule.iml
/_ReSharper.Caches/ /_ReSharper.Caches/
**/.env **/.env
.env .env
compose/

View File

@ -6,6 +6,14 @@ IHost host = Host.CreateDefaultBuilder(args)
services.Add_Linkding_HttpClient(ctx.Configuration); services.Add_Linkding_HttpClient(ctx.Configuration);
services.Add_Linkding_Worker(ctx.Configuration); services.Add_Linkding_Worker(ctx.Configuration);
services.AddHostedService<Worker>(); services.AddHostedService<Worker>();
}).ConfigureHostConfiguration((builder) =>
{
builder
.AddEnvironmentVariables()
.AddCommandLine(args)
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.Development.json")
.AddUserSecrets<Program>(true);
}) })
.Build(); .Build();

View File

@ -26,7 +26,11 @@ public partial class WallabagService
while (allQuery.QueryLinks.Next != null && !string.IsNullOrEmpty(allQuery.QueryLinks.Next.Href)) while (allQuery.QueryLinks.Next != null && !string.IsNullOrEmpty(allQuery.QueryLinks.Next.Href))
{ {
// url = allQuery.QueryLinks.Next.Href.Replace(_settings.Url, ""); // url = allQuery.QueryLinks.Next.Href.Replace(_settings.Url, "");
url = allQuery.QueryLinks.Next.Href.Replace("http://", "https://"); if (_client.BaseAddress.Scheme == "https")
{
url = allQuery.QueryLinks.Next.Href.Replace("http://", "https://");
}
allQuery = await GetJsonAsync<WallabagQuery>(url); allQuery = await GetJsonAsync<WallabagQuery>(url);
bookmarks.AddRange(allQuery.Embedded.Items); bookmarks.AddRange(allQuery.Embedded.Items);
} }

View File

@ -60,7 +60,7 @@ namespace Wallabag.Handler
} }
} }
if (addToWallabag && !updatedWallabags.ContainsKey(bookmark.Url)) if (addToWallabag && !updatedWallabags.ContainsKey(cleanUrl))
{ {
updatedWallabags.Add(cleanUrl, updatedWallabags.Add(cleanUrl,
bookmark.TagNames.Where(x => !x.Equals(tagName, StringComparison.OrdinalIgnoreCase))); bookmark.TagNames.Where(x => !x.Equals(tagName, StringComparison.OrdinalIgnoreCase)));

View File

@ -7,6 +7,14 @@ IHost host = Host.CreateDefaultBuilder(args)
services.Add_Linkding_HttpClient(ctx.Configuration); services.Add_Linkding_HttpClient(ctx.Configuration);
services.Add_Wallabag_Worker(ctx.Configuration); services.Add_Wallabag_Worker(ctx.Configuration);
services.AddHostedService<Worker>(); services.AddHostedService<Worker>();
}).ConfigureHostConfiguration((builder) =>
{
builder
.AddEnvironmentVariables()
.AddCommandLine(args)
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.Development.json")
.AddUserSecrets<Program>(true);
}) })
.Build(); .Build();

View File

@ -9,6 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="YamlDotNet" Version="12.3.1" /> <PackageReference Include="YamlDotNet" Version="12.3.1" />
</ItemGroup> </ItemGroup>