GoldbergGUI/GoldbergGUI.Core/Models/SteamAppModel.cs

75 lines
1.9 KiB
C#
Raw Normal View History

2021-01-08 12:36:57 -05:00
using System.Collections.Generic;
using System.Text.Json.Serialization;
2021-03-21 10:20:46 -04:00
using SQLite;
2021-01-08 12:36:57 -05:00
// ReSharper disable UnusedMember.Global
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable StringLiteralTypo
// ReSharper disable InconsistentNaming
namespace GoldbergGUI.Core.Models
{
2021-03-21 10:20:46 -04:00
[Table("steamapp")]
2021-01-08 12:36:57 -05:00
public class SteamApp
{
2021-03-21 10:20:46 -04:00
[JsonPropertyName("appid")]
[Column("appid")]
[PrimaryKey]
public int AppId { get; set; }
2021-01-08 12:36:57 -05:00
2021-02-17 08:27:54 -05:00
/// <summary>
/// Name of Steam app
/// </summary>
2021-01-08 12:36:57 -05:00
[JsonPropertyName("name")]
2021-03-21 10:20:46 -04:00
[Column("name")]
public string Name { get; set; }
2021-03-21 10:20:46 -04:00
[Column("comparable_name")]
public string ComparableName { get; set; }
2021-02-17 08:27:54 -05:00
/// <summary>
/// App type (Game, DLC, ...)
/// </summary>
2021-03-21 10:20:46 -04:00
[Column("type")]
public string type { get; set; }
2021-01-08 12:36:57 -05:00
public override string ToString()
{
return $"{AppId}={Name}";
}
2021-03-21 10:20:46 -04:00
[JsonPropertyName("last_modified")]
[Ignore]
public long LastModified { get; set; }
[JsonPropertyName("price_change_number")]
2021-03-21 10:20:46 -04:00
[Ignore]
public long PriceChangeNumber { get; set; }
2021-01-08 12:36:57 -05:00
}
public class AppList
{
[JsonPropertyName("apps")] public List<SteamApp> Apps { get; set; }
[JsonPropertyName("have_more_results")]
public bool HaveMoreResults { get; set; }
[JsonPropertyName("last_appid")] public long LastAppid { get; set; }
2021-01-08 12:36:57 -05:00
}
public class SteamApps
{
public virtual AppList AppList { get; set; }
}
public class SteamAppsV2 : SteamApps
{
[JsonPropertyName("applist")] public override AppList AppList { get; set; }
}
public class SteamAppsV1 : SteamApps
{
[JsonPropertyName("response")] public override AppList AppList { get; set; }
2021-01-08 12:36:57 -05:00
}
}