Made Manifest Size source of truth.
- Updated ModService->Resolve... to return Uri. - Removed ModrinthModInfoModel as no longer needed.
This commit is contained in:
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user