docs: compat: Remove issue_number & events_count columns

That's mostly for archival purposes; we don't need it.
This commit is contained in:
Evan Husted 2025-01-07 18:49:04 -06:00
parent 804d9c1efe
commit 672f5df0f9
2 changed files with 4319 additions and 4320 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@ using nietras.SeparatedValues;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -32,21 +33,22 @@ namespace Ryujinx.Ava.Utilities.Compat
{ {
public CompatibilityEntry(SepReaderHeader header, SepReader.Row row) public CompatibilityEntry(SepReaderHeader header, SepReader.Row row)
{ {
IssueNumber = row[header.IndexOf("issue_number")].Parse<int>(); if (row.ColCount != header.ColNames.Count)
throw new InvalidDataException($"CSV row {row.RowIndex} ({row.ToString()}) has mismatched column count");
var titleIdRow = row[header.IndexOf("extracted_game_id")].ToString(); var titleIdRow = ColStr(row[header.IndexOf("\"extracted_game_id\"")]);
TitleId = !string.IsNullOrEmpty(titleIdRow) TitleId = !string.IsNullOrEmpty(titleIdRow)
? titleIdRow ? titleIdRow
: default(Optional<string>); : default(Optional<string>);
var issueTitleRow = row[header.IndexOf("issue_title")].ToString(); var issueTitleRow = ColStr(row[header.IndexOf("\"issue_title\"")]);
if (TitleId.HasValue) if (TitleId.HasValue)
issueTitleRow = issueTitleRow.ReplaceIgnoreCase($" - {TitleId}", string.Empty); issueTitleRow = issueTitleRow.ReplaceIgnoreCase($" - {TitleId}", string.Empty);
GameName = issueTitleRow.Trim().Trim('"'); GameName = issueTitleRow.Trim().Trim('"');
IssueLabels = row[header.IndexOf("issue_labels")].ToString().Split(';'); IssueLabels = ColStr(row[header.IndexOf("\"issue_labels\"")]).Split(';');
Status = row[header.IndexOf("extracted_status")].ToString().ToLower() switch Status = ColStr(row[header.IndexOf("\"extracted_status\"")]).ToLower() switch
{ {
"playable" => LocaleKeys.CompatibilityListPlayable, "playable" => LocaleKeys.CompatibilityListPlayable,
"ingame" => LocaleKeys.CompatibilityListIngame, "ingame" => LocaleKeys.CompatibilityListIngame,
@ -56,20 +58,19 @@ namespace Ryujinx.Ava.Utilities.Compat
_ => null _ => null
}; };
if (row[header.IndexOf("last_event_date")].TryParse<DateTime>(out var dt)) if (DateTime.TryParse(ColStr(row[header.IndexOf("\"last_event_date\"")]), out var dt))
LastEvent = dt; LastEvent = dt;
if (row[header.IndexOf("events_count")].TryParse<int>(out var eventsCount)) return;
EventCount = eventsCount;
string ColStr(SepReader.Col col) => col.ToString().Trim('"');
} }
public int IssueNumber { get; }
public string GameName { get; } public string GameName { get; }
public Optional<string> TitleId { get; } public Optional<string> TitleId { get; }
public string[] IssueLabels { get; } public string[] IssueLabels { get; }
public LocaleKeys? Status { get; } public LocaleKeys? Status { get; }
public DateTime LastEvent { get; } public DateTime LastEvent { get; }
public int EventCount { get; }
public string LocalizedStatus => LocaleManager.Instance[Status!.Value]; public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
public string FormattedTitleId => TitleId public string FormattedTitleId => TitleId
@ -83,13 +84,11 @@ namespace Ryujinx.Ava.Utilities.Compat
public override string ToString() public override string ToString()
{ {
var sb = new StringBuilder("CompatibilityEntry: {"); var sb = new StringBuilder("CompatibilityEntry: {");
sb.Append($"{nameof(IssueNumber)}={IssueNumber}, ");
sb.Append($"{nameof(GameName)}=\"{GameName}\", "); sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
sb.Append($"{nameof(TitleId)}={TitleId}, "); sb.Append($"{nameof(TitleId)}={TitleId}, ");
sb.Append($"{nameof(IssueLabels)}=\"{IssueLabels}\", "); sb.Append($"{nameof(IssueLabels)}=\"{IssueLabels}\", ");
sb.Append($"{nameof(Status)}=\"{Status}\", "); sb.Append($"{nameof(Status)}=\"{Status}\", ");
sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\", "); sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\"");
sb.Append($"{nameof(EventCount)}={EventCount}");
sb.Append('}'); sb.Append('}');
return sb.ToString(); return sb.ToString();