1
0
Fork 0
forked from aly/qstbak

muffin v7.38

This commit is contained in:
alydev 2025-11-17 11:31:27 +10:00
parent 411c0bbe76
commit e5b98b3d57
35 changed files with 10700 additions and 7610 deletions

View file

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Questionable.Model.Changelog;
internal sealed record ChangelogEntry(string Version, DateOnly ReleaseDate, List<ChangeEntry> Changes)
{
public bool IsNewVersion(string? lastViewedVersion)
{
if (string.IsNullOrEmpty(lastViewedVersion))
{
return true;
}
return CompareVersions(Version, lastViewedVersion) > 0;
}
private static int CompareVersions(string version1, string version2)
{
int result;
int[] array = (from p in version1.Split('.')
select int.TryParse(p, out result) ? result : 0).ToArray();
int[] array2 = (from p in version2.Split('.')
select int.TryParse(p, out result) ? result : 0).ToArray();
int num = Math.Max(array.Length, array2.Length);
for (int num2 = 0; num2 < num; num2++)
{
int num3 = ((num2 < array.Length) ? array[num2] : 0);
int num4 = ((num2 < array2.Length) ? array2[num2] : 0);
if (num3 != num4)
{
return num3.CompareTo(num4);
}
}
return 0;
}
}