|
@@ -1,6 +1,7 @@
|
|
|
using System.Collections.Generic;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
+using System.Text.Json.Serialization;
|
|
|
using System.Threading.Tasks;
|
|
|
using VeloeKemonoPartyApp.Services;
|
|
|
|
|
@@ -8,13 +9,20 @@ namespace VeloeAvaloniaKemonoPartyApp.Models
|
|
|
{
|
|
|
public class Creator
|
|
|
{
|
|
|
- public int favorited { get; set; }
|
|
|
- public string id { get; set; }
|
|
|
- public double indexed { get; set; }
|
|
|
- public string name { get; set; }
|
|
|
- public string service { get; set; }
|
|
|
- public double updated { get; set; }
|
|
|
- public string Icon => $"https://kemono.su/icons/{service}/{id}";
|
|
|
+ [JsonPropertyName("favorited")]
|
|
|
+ public int Favorited { get; set; }
|
|
|
+ [JsonPropertyName("id")]
|
|
|
+ public string Id { get; set; }
|
|
|
+ [JsonPropertyName("indexed")]
|
|
|
+ public double Indexed { get; set; }
|
|
|
+ [JsonPropertyName("name")]
|
|
|
+ public string Name { get; set; }
|
|
|
+ [JsonPropertyName("service")]
|
|
|
+ public string Service { get; set; }
|
|
|
+ [JsonPropertyName("updated")]
|
|
|
+ public double Updated { get; set; }
|
|
|
+
|
|
|
+ public string Icon => $"https://kemono.su/icons/{Service}/{Id}";
|
|
|
|
|
|
public static IList<Creator> Source = new List<Creator>(66000);
|
|
|
|
|
@@ -24,11 +32,11 @@ namespace VeloeAvaloniaKemonoPartyApp.Models
|
|
|
Source = await s_httpClient.GetCreatorsList(reloadSource);
|
|
|
|
|
|
|
|
|
- return Source.Where(x=>x.name.StartsWith(searchTerm,System.StringComparison.OrdinalIgnoreCase)).Take(50);
|
|
|
+ return Source.Where(x=>x.Name.StartsWith(searchTerm,System.StringComparison.OrdinalIgnoreCase)).Take(50);
|
|
|
}
|
|
|
|
|
|
private static KemonoHttpClient s_httpClient = new();
|
|
|
- private string CachePath => $"./Cache/{service} - {id}";
|
|
|
+ private string CachePath => $"./Cache/{Service} - {Id}";
|
|
|
|
|
|
public async Task<Stream> LoadCoverBitmapAsync()
|
|
|
{
|