From aeabd553e0e8f4152576bf4ec09192c8ffcafb3f Mon Sep 17 00:00:00 2001 From: Kaurin <2141359+Kaurin@users.noreply.github.com> Date: Sat, 11 Nov 2023 15:32:39 +0000 Subject: [PATCH] fix --- rs_Assets.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rs_Assets.py b/rs_Assets.py index 3757897..d1d064a 100644 --- a/rs_Assets.py +++ b/rs_Assets.py @@ -379,12 +379,14 @@ def _from_config_file(self, asset_config_file: str) -> List["LiveryAsset"]: self._top_level_assets.append(asset) # Check if we have any duplicate basenames for downloadable assets + basenames = [] for asset in self.get_assets_with_gdrive_id(): - for asset_compare in self.get_assets_with_gdrive_id(): - if asset.basename == asset_compare.basename: - raise ValueError( - f"Duplicate basenames for downloadable assets found in config file: {asset.basename}" - ) + basenames.append(asset.basename) + if len(basenames) != len(set(basenames)): + difference = set([x for x in basenames if basenames.count(x) > 1]) + raise ValueError( + f"Duplicate basenames found in {asset_config_file}: {difference}" + ) # Wait for downloads to finish, and the do post-download processing compress_and_checksum_futures = []