Skip to content

Commit

Permalink
importer: fixed name for unmatched tables to display in the correct case
Browse files Browse the repository at this point in the history
  • Loading branch information
stojy committed Nov 15, 2022
1 parent 4f5e90b commit a77ae9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ClrVpin/Models/Importer/GameItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public GameItem(LocalGame localLocalGame)
public int Index { get; set; } // 1 based index of every game in the list

public string Name => Names.FirstOrDefault(x => x != null);
public string[] Names => new[] { OnlineGame?.Name, LocalGame?.Fuzzy.TableDetails?.NameOriginalCase }; // for unmatched, default to the fuzzy parsed table name
public string[] Names => new[] { OnlineGame?.Name, LocalGame?.Fuzzy.TableDetails?.ActualNameTrimmed }; // for unmatched, default to the fuzzy parsed table name

public string Manufacturer => Manufacturers.FirstOrDefault(x => x != null);
public string[] Manufacturers => new[] { OnlineGame?.Manufacturer, LocalGame?.Game.Manufacturer };
Expand Down
2 changes: 1 addition & 1 deletion ClrVpin/Shared/Fuzzy/Fuzzy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static FuzzyItemDetails GetTableDetails(string sourceName, bool isFileNam
var cleanManufacturer = CleanPostSplit(manufacturer, false);
var cleanManufacturerNoWhiteSpace = CleanPostSplit(manufacturer, true);

return new FuzzyItemDetails(sourceName, cleanName?.Trim() ?? "", cleanName.ToNullLowerAndTrim(), cleanNameWithoutWhiteSpace.ToNullLowerAndTrim(), cleanNameWithoutParenthesis.ToNullLowerAndTrim(),
return new FuzzyItemDetails(sourceName, sourceName?.Trim() ?? "", cleanName.ToNullLowerAndTrim(), cleanNameWithoutWhiteSpace.ToNullLowerAndTrim(), cleanNameWithoutParenthesis.ToNullLowerAndTrim(),
cleanManufacturer.ToNullLowerAndTrim(), cleanManufacturerNoWhiteSpace.ToNullLowerAndTrim(), year);
}

Expand Down
6 changes: 3 additions & 3 deletions ClrVpin/Shared/Fuzzy/FuzzyItemDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ public class FuzzyItemNameDetails
{
public string ActualName { get; protected init; }
public string Name { get; protected init;} // lower case
public string NameOriginalCase { get; protected init;}
public string ActualNameTrimmed { get; protected init;}
public string NameWithoutWhiteSpace { get; protected init;}
public string NameWithoutParenthesis { get; protected init;}
}

public class FuzzyItemDetails : FuzzyItemNameDetails
{
public FuzzyItemDetails(string actualName, string nameOriginalCase, string name, string nameWithoutWhiteSpace, string nameWithoutParenthesis, string manufacturer, string manufacturerNoWhiteSpace, int? year)
public FuzzyItemDetails(string actualName, string actualNameTrimmed, string name, string nameWithoutWhiteSpace, string nameWithoutParenthesis, string manufacturer, string manufacturerNoWhiteSpace, int? year)
{
ActualName = actualName;
NameOriginalCase = nameOriginalCase;
ActualNameTrimmed = actualNameTrimmed;
Name = name;
NameWithoutWhiteSpace = nameWithoutWhiteSpace;
NameWithoutParenthesis = nameWithoutParenthesis;
Expand Down

0 comments on commit a77ae9d

Please sign in to comment.