mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-01-31 01:25:22 +01:00
prefer update pkg links with drm_type="mbind"
these are supposedly drm-free (well, "PS3 disc bind content" or "Magic Gate Memory Stick bind content" for PSP)
This commit is contained in:
@@ -36,10 +36,14 @@ public class TitlePatchPackage
|
||||
public string Sha1Sum { get; set; }
|
||||
[XmlAttribute("url")]
|
||||
public string Url { get; set; }
|
||||
[XmlAttribute("drm_type")]
|
||||
public string DrmType { get; set; }
|
||||
[XmlAttribute("ps3_system_ver")]
|
||||
public string Ps3SystemVer { get; set; }
|
||||
[XmlElement("paramsfo")]
|
||||
public TitlePatchParamSfo ParamSfo { get; set; }
|
||||
[XmlElement("url")]
|
||||
public UrlInfo AltUrl { get; set; }
|
||||
}
|
||||
|
||||
public class TitlePatchParamSfo
|
||||
@@ -47,5 +51,17 @@ public class TitlePatchParamSfo
|
||||
[XmlElement("TITLE")]
|
||||
public string Title { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class UrlInfo
|
||||
{
|
||||
[XmlAttribute("url")]
|
||||
public string Url { get; set; }
|
||||
[XmlAttribute("size")]
|
||||
public long Size { get; set; }
|
||||
[XmlAttribute("sha1sum")]
|
||||
public string Sha1Sum { get; set; }
|
||||
[XmlAttribute("drm_type")]
|
||||
public string DrmType { get; set; }
|
||||
}
|
||||
|
||||
#nullable restore
|
||||
@@ -24,21 +24,30 @@ internal static class TitlePatchFormatter
|
||||
if (pkgs.Length > 1)
|
||||
content.AppendLine(
|
||||
$"""
|
||||
ℹ️ Total download size of all {pkgs.Length} packages is {pkgs.Sum(p => p.Size).AsStorageUnit()}.
|
||||
ℹ️ Total download size of all {pkgs.Length} packages is {pkgs.Sum(p => p.AltUrl?.Size ?? p.Size).AsStorageUnit()}.
|
||||
⏩ You can use tools such as [rusty-psn](https://github.com/RainbowCookie32/rusty-psn/releases/latest) or [PySN](https://github.com/AphelionWasTaken/PySN/releases/latest) for mass download of all updates.
|
||||
|
||||
⚠️ You **must** install listed updates in order, starting with the first one. You **can not** skip intermediate versions.
|
||||
"""
|
||||
).AppendLine();
|
||||
foreach (var pkg in pkgs)
|
||||
content.AppendLine($"""[⏬ Update v`{pkg.Version}` ({pkg.Size.AsStorageUnit()})]({pkg.Url})""");
|
||||
{
|
||||
// prefer drm-free link
|
||||
content.Append($"[⏬ Update v`{pkg.Version}` ({(pkg.AltUrl?.Size ?? pkg.Size).AsStorageUnit()})]({pkg.AltUrl?.Url ?? pkg.Url})");
|
||||
if (pkg.AltUrl is { Url: { Length: >0} altUrl })
|
||||
content.Append($" | [with DRM]({pkg.Url})");
|
||||
content.AppendLine();
|
||||
}
|
||||
}
|
||||
else if (pkgs is [var pkg])
|
||||
{
|
||||
var link = $"[⏬ {Path.GetFileName(GetLinkName(pkg.Url))}]({pkg.Url})";
|
||||
if (pkg.AltUrl is { Url: { Length: > 0 } altUrl })
|
||||
link += $" | [with DRM]({pkg.Url})";
|
||||
content.AppendLine(
|
||||
$"""
|
||||
### {title} update v{pkg.Version} ({pkg.Size.AsStorageUnit()})
|
||||
[⏬ {Path.GetFileName(GetLinkName(pkg.Url))}]({pkg.Url})
|
||||
### {title} update v{pkg.Version} ({(pkg.AltUrl?.Size ?? pkg.Size).AsStorageUnit()})
|
||||
{link}
|
||||
"""
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user