Skip to content

Commit

Permalink
small update, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
spektor56 committed Apr 24, 2020
1 parent bf7ce7d commit 26aa11c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions LBGDBMetadata/LBGDBMetadata.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -30,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
16 changes: 16 additions & 0 deletions LBGDBMetadata/LbgdbLazyMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ private GameImage GetBestImage(List<GameImage> images, HashSet<string> imageType
continue;
}

if (options.GameData.Region != null)
{
filteredImages = images
.Where(image =>
image.Type == coverType && image.Region != null &&
image.Region.Equals(options.GameData.Region.Name, StringComparison.OrdinalIgnoreCase))
.OrderByDescending(image => image.ID);
if (filteredImages.Any())
{
return filteredImages.First();
}
}

filteredImages = images.Where(image => image.Type == coverType && image.Region != null && image.Region.Equals(LaunchBox.Region.Canada, StringComparison.OrdinalIgnoreCase)).OrderByDescending(image => image.ID);
if (filteredImages.Any())
{
Expand Down Expand Up @@ -290,11 +303,14 @@ public override List<MetadataField> AvailableFields

public override MetadataFile GetIcon()
{
/*
using (MemoryStream ms = new MemoryStream())
{
LBGDBMetadata.Properties.Resources.launchbox.Save(ms);
return new MetadataFile("LaunchBox", ms.ToArray());
}
*/
return base.GetIcon();
}

public override int? GetCriticScore()
Expand Down
2 changes: 1 addition & 1 deletion LBGDBMetadata/LbgdbMetadataPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public override OnDemandMetadataProvider GetMetadataProvider(MetadataRequestOpti
MetadataField.Links,
MetadataField.CriticScore,
MetadataField.CommunityScore,
MetadataField.Icon,
//MetadataField.Icon,
MetadataField.CoverImage,
MetadataField.BackgroundImage

Expand Down

0 comments on commit 26aa11c

Please sign in to comment.