about summary refs log tree commit diff
path: root/pkgs/games/humblebundle
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-15 10:29:26 +0200
committeraszlig <aszlig@nix.build>2018-07-15 10:34:09 +0200
commit8005779640207a46089476721ce1a5441b579478 (patch)
treee991adf30b8d756f1ddf4afc16ba25125b3c6c41 /pkgs/games/humblebundle
parent753d37c21993283ac93352adb0c01a0cddce186d (diff)
fetchHumbleBundle: Fix subproduct name collision
Every HumbleBundle purchase has a list of subproducts and those have
so-called 'machine_name' attributes which are unique. However in our
fetcher we used the 'human_name' as a unique key, which isn't really
unique and in case of bastion the soundtrack subproduct is has the
human_name "Bastion" and the actual game has the *same* name as well.

Using the machine_name as the unique key now solves the problem that
certain games couldn't be found if you for example also have the
soundtrack.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/humblebundle')
-rw-r--r--pkgs/games/humblebundle/fetch-humble-bundle/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/games/humblebundle/fetch-humble-bundle/default.nix b/pkgs/games/humblebundle/fetch-humble-bundle/default.nix
index dbf6c862..44b0537a 100644
--- a/pkgs/games/humblebundle/fetch-humble-bundle/default.nix
+++ b/pkgs/games/humblebundle/fetch-humble-bundle/default.nix
@@ -114,7 +114,7 @@
           prodname = subproduct.human_name.encode('ascii', 'replace')
           downloads = [(download.machine_name, download.download_struct)
                        for download in subproduct.downloads]
-          yield (prodname, downloads)
+          yield ((subproduct.machine_name, prodname), downloads)
 
     def find_download(downloads):
       for machine_name, dstruct in sum(downloads.values(), []):
@@ -161,7 +161,7 @@
       print >>sys.stderr, ${pyStr "Cannot find download for ${machineName}!"}
       print >>sys.stderr, 'Available machine names:'
       for name, dstructs in sorted(products.items(), key=lambda x: x[0]):
-        print >>sys.stderr, "  * " + name
+        print >>sys.stderr, "  * " + name[1]
         print >>sys.stderr, "    " + ', '.join(map(lambda x: x[0], dstructs))
       raise SystemExit(1)
     elif dstruct.md5 != ${pyStr md5}: