New UI (not wired up)
This commit is contained in:
@@ -14,7 +14,7 @@ namespace WinWARP.Core.Services.Implementations;
|
||||
|
||||
public partial class SubscriptionFetcher(IDialogService dialogService) : ISubscriptionFetcher
|
||||
{
|
||||
private static readonly HttpClient _httpClient = new HttpClient();
|
||||
private readonly HttpClient _httpClient = new() { Timeout = TimeSpan.FromSeconds(10) };
|
||||
private readonly IDialogService _dialogService = dialogService;
|
||||
|
||||
public bool IsUrlValid(string subscriptionUrl)
|
||||
@@ -31,7 +31,6 @@ public partial class SubscriptionFetcher(IDialogService dialogService) : ISubscr
|
||||
|
||||
public async Task<Subscription> FetchAsync(string subscriptionUrl)
|
||||
{
|
||||
_httpClient.Timeout = TimeSpan.FromSeconds(10);
|
||||
var subscription = new Subscription
|
||||
{
|
||||
Link = subscriptionUrl
|
||||
@@ -239,7 +238,8 @@ public partial class SubscriptionFetcher(IDialogService dialogService) : ISubscr
|
||||
{
|
||||
DefaultTitle = GetServerTitle(title, out var region),
|
||||
Region = FlagEmojiParser.ExtractCountryCodes(title).FirstOrDefault() ?? string.Empty,
|
||||
ConnectionString = serverData
|
||||
ConnectionString = serverData,
|
||||
Tags = GetTags(serverData)
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -250,7 +250,7 @@ public partial class SubscriptionFetcher(IDialogService dialogService) : ISubscr
|
||||
#endregion
|
||||
|
||||
#region Tags
|
||||
public List<string> GetTags(string connection)
|
||||
private static List<string> GetTags(string connection)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(connection)) return null;
|
||||
|
||||
@@ -351,7 +351,7 @@ public partial class SubscriptionFetcher(IDialogService dialogService) : ISubscr
|
||||
yield return transport.ToUpperInvariant();
|
||||
}
|
||||
|
||||
private IEnumerable<string> GetJsonTags(string json)
|
||||
private static IEnumerable<string> GetJsonTags(string json)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -9,5 +9,4 @@ public interface ISubscriptionFetcher
|
||||
{
|
||||
public bool IsUrlValid(string url);
|
||||
public Task<Subscription> FetchAsync(string url);
|
||||
public List<string> GetTags(string connectionString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user