From ef135b1164b2d3816382bf89e9c65c75c636291c Mon Sep 17 00:00:00 2001 From: Ryan Macham Date: Sat, 4 Apr 2026 21:20:56 +0100 Subject: [PATCH] Made Manifest Size source of truth. - Updated ModService->Resolve... to return Uri. - Removed ModrinthModInfoModel as no longer needed. --- .../Manifests/DTO/InstalledModEntryDto.cs | 22 ------------ .../Models/Manifests/InstalledModEntry.cs | 34 ------------------- AlayaCore/Models/ModrinthModInfoModel.cs | 19 ----------- 3 files changed, 75 deletions(-) delete mode 100644 AlayaCore/Models/Manifests/DTO/InstalledModEntryDto.cs delete mode 100644 AlayaCore/Models/Manifests/InstalledModEntry.cs delete mode 100644 AlayaCore/Models/ModrinthModInfoModel.cs diff --git a/AlayaCore/Models/Manifests/DTO/InstalledModEntryDto.cs b/AlayaCore/Models/Manifests/DTO/InstalledModEntryDto.cs deleted file mode 100644 index c475c81..0000000 --- a/AlayaCore/Models/Manifests/DTO/InstalledModEntryDto.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace AlayaCore.Models.Manifests.DTO -{ - [Serializable] - public class InstalledModEntryDto - { - [JsonProperty("name", Required = Required.Always)] - public string FileName { get; set; } = string.Empty; - - [JsonProperty("version", Required = Required.Always)] - public string Version { get; set; } = string.Empty; - - [JsonProperty("sha512Hash", Required = Required.Always)] - public string Sha512Hash { get; set; } = string.Empty; - - [JsonProperty("size", Required = Required.Always)] - public long Size { get; set; } - - } -} \ No newline at end of file diff --git a/AlayaCore/Models/Manifests/InstalledModEntry.cs b/AlayaCore/Models/Manifests/InstalledModEntry.cs deleted file mode 100644 index f38097c..0000000 --- a/AlayaCore/Models/Manifests/InstalledModEntry.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -namespace AlayaCore.Models.Manifests -{ - [Serializable] - public sealed class InstalledModEntry - { - public string FileName { get; } - public string Sha512Hash { get; } - public long Size { get; } - - public InstalledModEntry(string fileName, string sha512Hash, long size) - { - if (string.IsNullOrWhiteSpace(fileName)) - { - throw new ArgumentException("File name cannot be null, empty, or whitespace.", nameof(fileName)); - } - - if (string.IsNullOrWhiteSpace(sha512Hash)) - { - throw new ArgumentException("SHA-512 hash cannot be null, empty, or whitespace.", nameof(sha512Hash)); - } - - if (size <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), "Size must be greater than zero."); - } - - FileName = fileName; - Sha512Hash = sha512Hash; - Size = size; - } - } -} \ No newline at end of file diff --git a/AlayaCore/Models/ModrinthModInfoModel.cs b/AlayaCore/Models/ModrinthModInfoModel.cs deleted file mode 100644 index fe40462..0000000 --- a/AlayaCore/Models/ModrinthModInfoModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using AlayaCore.Models.Manifests; - -namespace AlayaCore.Models -{ - public class ModrinthModInfoModel - { - public ModrinthModInfoModel(Uri modUrl, long size) - { - ModUrl = modUrl; - Size = size; - } - - public Uri ModUrl { get; set; } - public long Size { get; set; } - - - } -} \ No newline at end of file