Compare commits
5 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
672f5df0f9 | ||
|
|
804d9c1efe | ||
|
|
9270b35648 | ||
|
|
5a6d01db3c | ||
|
|
ef9c1416ec |
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ using nietras.SeparatedValues;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -32,21 +33,22 @@ namespace Ryujinx.Ava.Utilities.Compat
|
||||
{
|
||||
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)
|
||||
? titleIdRow
|
||||
: default(Optional<string>);
|
||||
|
||||
var issueTitleRow = row[header.IndexOf("issue_title")].ToString();
|
||||
var issueTitleRow = ColStr(row[header.IndexOf("\"issue_title\"")]);
|
||||
if (TitleId.HasValue)
|
||||
issueTitleRow = issueTitleRow.ReplaceIgnoreCase($" - {TitleId}", string.Empty);
|
||||
|
||||
GameName = issueTitleRow.Trim().Trim('"');
|
||||
|
||||
IssueLabels = row[header.IndexOf("issue_labels")].ToString().Split(';');
|
||||
Status = row[header.IndexOf("extracted_status")].ToString().ToLower() switch
|
||||
IssueLabels = ColStr(row[header.IndexOf("\"issue_labels\"")]).Split(';');
|
||||
Status = ColStr(row[header.IndexOf("\"extracted_status\"")]).ToLower() switch
|
||||
{
|
||||
"playable" => LocaleKeys.CompatibilityListPlayable,
|
||||
"ingame" => LocaleKeys.CompatibilityListIngame,
|
||||
@@ -56,23 +58,23 @@ namespace Ryujinx.Ava.Utilities.Compat
|
||||
_ => 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;
|
||||
|
||||
if (row[header.IndexOf("events_count")].TryParse<int>(out var eventsCount))
|
||||
EventCount = eventsCount;
|
||||
return;
|
||||
|
||||
string ColStr(SepReader.Col col) => col.ToString().Trim('"');
|
||||
}
|
||||
|
||||
public int IssueNumber { get; }
|
||||
public string GameName { get; }
|
||||
public Optional<string> TitleId { get; }
|
||||
public string[] IssueLabels { get; }
|
||||
public LocaleKeys? Status { get; }
|
||||
public DateTime LastEvent { get; }
|
||||
public int EventCount { get; }
|
||||
|
||||
public string LocalizedStatus => LocaleManager.Instance[Status!.Value];
|
||||
public string FormattedTitleId => TitleId.OrElse(new string(' ', 16));
|
||||
public string FormattedTitleId => TitleId
|
||||
.OrElse(new string(' ', 16));
|
||||
|
||||
public string FormattedIssueLabels => IssueLabels
|
||||
.Where(it => !it.StartsWithIgnoreCase("status"))
|
||||
@@ -82,13 +84,11 @@ namespace Ryujinx.Ava.Utilities.Compat
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder("CompatibilityEntry: {");
|
||||
sb.Append($"{nameof(IssueNumber)}={IssueNumber}, ");
|
||||
sb.Append($"{nameof(GameName)}=\"{GameName}\", ");
|
||||
sb.Append($"{nameof(TitleId)}={TitleId}, ");
|
||||
sb.Append($"{nameof(IssueLabels)}=\"{IssueLabels}\", ");
|
||||
sb.Append($"{nameof(Status)}=\"{Status}\", ");
|
||||
sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\", ");
|
||||
sb.Append($"{nameof(EventCount)}={EventCount}");
|
||||
sb.Append($"{nameof(LastEvent)}=\"{LastEvent}\"");
|
||||
sb.Append('}');
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -47,9 +47,8 @@
|
||||
<Grid Width="750" ColumnDefinitions="Auto,Auto,Auto,*"
|
||||
Margin="5">
|
||||
<TextBlock Grid.Column="0"
|
||||
FontFamily="{StaticResource JetBrainsMono}"
|
||||
Text="{Binding GameName}"
|
||||
Width="333"
|
||||
Width="320"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Width="135"
|
||||
@@ -60,14 +59,12 @@
|
||||
<TextBlock Grid.Column="2"
|
||||
Padding="7, 0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource JetBrainsMono}"
|
||||
Text="{Binding LocalizedStatus}"
|
||||
Width="85"
|
||||
Foreground="{Binding Status, Converter={x:Static helpers:PlayabilityStatusConverter.Shared}}"
|
||||
TextWrapping="NoWrap" />
|
||||
<TextBlock Grid.Column="3"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource JetBrainsMono}"
|
||||
Text="{Binding FormattedIssueLabels}"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user