From 2545e42548aaf85432fba6649fb4d417ea2eb431 Mon Sep 17 00:00:00 2001 From: 64Core <64core@pm.me> Date: Wed, 29 Mar 2023 22:19:54 -0500 Subject: [PATCH] PR #78 More Linting Fixes --- itchiodl/library.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/itchiodl/library.py b/itchiodl/library.py index 6ade474..af16b76 100644 --- a/itchiodl/library.py +++ b/itchiodl/library.py @@ -2,13 +2,11 @@ import json from concurrent.futures import ThreadPoolExecutor import functools import threading +from pathlib import Path import requests from bs4 import BeautifulSoup -from os.path import exists from itchiodl.game import Game from itchiodl.utils import NoDownloadError -from pathlib import Path - class Library: """Representation of a user's game library""" @@ -57,7 +55,8 @@ class Library: duplicates += 1 # The duplicate download key check assumes that a consecutive # string of ten identical game ids indicates the list has not changed - # Duplicate game keys can happen if you buy multiple bundles containing the same item + # Duplicate game keys can happen + # if you buy multiple bundles containing the same item # print("duplicate game ID", s["game_id"]) # Old debug line if duplicates > 9: print("Assuming that the owned keys have not changed") @@ -100,10 +99,11 @@ class Library: ) k = json.loads(gsp.text) game = Game(k) - if str(game_id) in self.key_pairs.keys(): - game.id = self.key_pairs[str(game_id)] - else: - game.id = False + game.id = self.key_pairs.get(str(game_id), False) + #if str(game_id) in self.key_pairs.keys(): + # game.id = self.key_pairs[str(game_id)] + #else: + # game.id = False game.game_id = game_id self.games.append(game)