Skip to content

Commit

Permalink
Disable Humble Trove support (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkashkin committed Feb 5, 2022
1 parent f5aa1ff commit 448a0bd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.16.1-{build}-{branch}
version: 0.16.2-{build}-{branch}

pull_requests:
do_not_increment_build_number: true
Expand Down
2 changes: 1 addition & 1 deletion data/com.github.tkashkin.gamehub.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<summary>Humble access token</summary>
</key>
<key name="load-trove-games" type="b">
<default>true</default>
<default>false</default>
<summary>Is Trove enabled</summary>
</key>
</schema>
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('com.github.tkashkin.gamehub', 'vala', 'c', version: '0.16.1')
project('com.github.tkashkin.gamehub', 'vala', 'c', version: '0.16.2')

i18n = import('i18n')
gnome = import('gnome')
Expand Down
10 changes: 8 additions & 2 deletions src/data/sources/humble/Trove.vala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ namespace GameHub.Data.Sources.Humble

public override bool enabled
{
get { return Settings.Auth.Humble.instance.enabled && Settings.Auth.Humble.instance.load_trove_games; }
get {
// Disable Trove unconditionally: https://github.com/tkashkin/GameHub/issues/611
// return Settings.Auth.Humble.instance.enabled && Settings.Auth.Humble.instance.load_trove_games;
return false;
}
set { Settings.Auth.Humble.instance.load_trove_games = value; }
}

Expand Down Expand Up @@ -86,7 +90,9 @@ namespace GameHub.Data.Sources.Humble
{
var xpath = new Xml.XPath.Context(html);

var trove_json = xpath.eval("//script[@id='webpack-monthly-trove-data']/text()")->nodesetval->item(0)->content.strip();
var xpath_object = xpath.eval("//script[@id='webpack-monthly-trove-data']/text()");
var xpath_nodeset = xpath_object != null ? xpath_object->nodesetval : null;
var trove_json = xpath_nodeset != null && !xpath_nodeset->is_empty() ? xpath_nodeset->item(0)->content.strip() : null;

if(trove_json != null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/ui/dialogs/SettingsDialog/pages/sources/Humble.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ namespace GameHub.UI.Dialogs.SettingsDialog.Pages.Sources

humble_auth = Settings.Auth.Humble.instance;

add_switch(_("Load games from Humble Trove"), humble_auth.load_trove_games, v => { humble_auth.load_trove_games = v; update(); request_restart(); });
// Disable Trove unconditionally: https://github.com/tkashkin/GameHub/issues/611
// add_switch(_("Load games from Humble Trove"), humble_auth.load_trove_games, v => { humble_auth.load_trove_games = v; update(); request_restart(); });

add_separator();

Expand Down

0 comments on commit 448a0bd

Please sign in to comment.