Skip to content

Commit

Permalink
V1.0.1 (#21)
Browse files Browse the repository at this point in the history
* Fix Video features incorrectly added

* Fix Video features incorrectly added
  • Loading branch information
sharkusmanch authored Apr 3, 2022
1 parent 95e8505 commit 6e14a84
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extension.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Id: PCGamingWikiMetadata_c038558e-427b-4551-be4c-be7009ce5a8d
Name: PCGamingWiki Metadata Provider
Author: sharkusmanch
Version: 1.0.0
Version: 1.0.1
Module: PCGamingWikiMetadata.dll
Type: MetadataProvider
Icon: icon.png
6 changes: 6 additions & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
AddonId: PCGamingWikiMetadata_c038558e-427b-4551-be4c-be7009ce5a8d
Packages:
- Version: 1.0.1
RequiredApiVersion: 6.2.2
ReleaseDate: 2022-04-03
PackageUrl: https://github.com/sharkusmanch/playnite-pcgamingwiki-metadata-provider/releases/download/v1.0.1/PCGamingWiki_Metadata_Provider_v1.0.1.pext
Changelog:
- Fix video features incorrectly added to ineligible games
- Version: 1.0.0
RequiredApiVersion: 6.2.2
ReleaseDate: 2022-04-03
Expand Down
11 changes: 8 additions & 3 deletions src/PCGWGameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void InitalizeSettingsMappings()
};
}

private bool IsSettingEnabled(string key)
private bool IsSettingDisabled(string key)
{
Func<bool> enabled;
bool settingExists = this.settingsMap.TryGetValue(key, out enabled);
Expand All @@ -68,7 +68,7 @@ private bool IsSettingEnabled(string key)

public void AddTaxonomy(string key, string text)
{
if (IsSettingEnabled(key))
if (IsSettingDisabled(key))
{
return;
}
Expand Down Expand Up @@ -128,11 +128,14 @@ public void AddCloudSaves(string launcher, string description)

public void AddVideoFeature(string key, string rating)
{
if (IsSettingEnabled(key) && NativeOrLimitedSupport(rating))
if (IsSettingDisabled(key) || !NativeOrLimitedSupport(rating))
{
return;
}

logger.Debug($"Adding {key} {rating} for {Game.Name}");
logger.Debug($"Supported {NativeOrLimitedSupport(rating)}");

switch (key)
{
case PCGamingWikiType.Video.HDR:
Expand All @@ -156,6 +159,8 @@ public void SetXboxPlayAnywhere()

private bool NativeOrLimitedSupport(string rating)
{
logger.Debug(rating);

return rating == PCGamingWikiType.Rating.NativeSupport ||
rating == PCGamingWikiType.Rating.Limited;
}
Expand Down
14 changes: 14 additions & 0 deletions tests/PCGWGame_Test_BAT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ public void TestMultiplayer()
features.Should().NotContain("Local Multiplayer: Co-Op", "Local Multiplayer: Versus");
}

[Fact]
public void TestHDR()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("HDR");
}

[Fact]
public void TestRayTracing()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("Ray Tracing");
}

public void Dispose()
{

Expand Down
14 changes: 14 additions & 0 deletions tests/PCGWGame_Test_CITIES.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ public void TestParsePerspectives()
arr.Should().Contain("Bird's-eye view");
}

[Fact]
public void TestHDR()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("HDR");
}

[Fact]
public void TestRayTracing()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("Ray Tracing");
}

[Fact]
public void TestParseControls()
{
Expand Down
14 changes: 14 additions & 0 deletions tests/PCGWGame_Test_CODMW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ public void TestControllerSupport()
features.Should().Contain("Full Controller Support");
}

[Fact]
public void TestHDR()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().Contain("HDR");
}

[Fact]
public void TestRayTracing()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().Contain("Ray Tracing");
}

[Fact]
public void TestMultiplayer()
{
Expand Down
16 changes: 16 additions & 0 deletions tests/PCGWGame_Test_DQ11.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public PCGWGame_Test_DQ11()
this.client.GetSettings().ImportTagThemes = false;
this.client.GetSettings().ImportTagArtStyle = false;
this.client.GetSettings().ImportXboxPlayAnywhere = false;
this.client.GetSettings().ImportFeatureHDR = true;
this.client.GetSettings().ImportFeatureRayTracing = true;

this.client.FetchGamePageContent(this.testGame);
}
Expand Down Expand Up @@ -130,6 +132,20 @@ public void TestControllerSupport()
features.Should().Contain("Full Controller Support");
}

[Fact]
public void TestHDR()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("HDR");
}

[Fact]
public void TestRayTracing()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("Ray Tracing");
}

public void Dispose()
{

Expand Down
14 changes: 14 additions & 0 deletions tests/PCGWGame_Test_OVERCOOKED.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ public void TestMultiplayer()
features.Should().Contain("Local Multiplayer: 2-4", "Local Multiplayer: Co-op", "Local Multiplayer: Versus");
}

[Fact]
public void TestHDR()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("HDR");
}

[Fact]
public void TestRayTracing()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().NotContain("Ray Tracing");
}

public void Dispose()
{

Expand Down

0 comments on commit 6e14a84

Please sign in to comment.