Ensure no user ID is present in dropInstanceID
This commit is contained in:
1 parent
5b515be34b
commit
da050828c1
1 file changed
+7
-2
@@ -1428,9 +1428,10 @@ class Twitch:
|
|||||||
if self.settings.dump:
|
if self.settings.dump:
|
||||||
# dump the campaigns data to the dump file
|
# dump the campaigns data to the dump file
|
||||||
with open(DUMP_PATH, 'a', encoding="utf8") as file:
|
with open(DUMP_PATH, 'a', encoding="utf8") as file:
|
||||||
# pre-process a little, so the dump file isn't overly bloated
|
# we need to pre-process the inventory dump a little
|
||||||
dump_data: JsonType = deepcopy(inventory_data)
|
dump_data: JsonType = deepcopy(inventory_data)
|
||||||
for campaign_data in dump_data.values():
|
for campaign_data in dump_data.values():
|
||||||
|
# replace ACL lists with a simple text description
|
||||||
if (
|
if (
|
||||||
campaign_data["allow"]
|
campaign_data["allow"]
|
||||||
and campaign_data["allow"].get("isEnabled", True)
|
and campaign_data["allow"].get("isEnabled", True)
|
||||||
@@ -1440,8 +1441,12 @@ class Twitch:
|
|||||||
campaign_data["allow"]["channels"] = (
|
campaign_data["allow"]["channels"] = (
|
||||||
f"{len(campaign_data['allow']['channels'])} channels"
|
f"{len(campaign_data['allow']['channels'])} channels"
|
||||||
)
|
)
|
||||||
|
# replace drop instance IDs, so they don't include user IDs
|
||||||
|
for drop_data in campaign_data["timeBasedDrops"]:
|
||||||
|
if "self" in drop_data and drop_data["self"]["dropInstanceID"]:
|
||||||
|
drop_data["self"]["dropInstanceID"] = "..."
|
||||||
json.dump(dump_data, file, indent=4, sort_keys=True)
|
json.dump(dump_data, file, indent=4, sort_keys=True)
|
||||||
file.write("\n\n") # add a new line spacer
|
file.write("\n\n") # add 2x new line spacer
|
||||||
json.dump(claimed_benefits, file, indent=4, sort_keys=True, default=str)
|
json.dump(claimed_benefits, file, indent=4, sort_keys=True, default=str)
|
||||||
|
|
||||||
# use the merged data to create campaign objects
|
# use the merged data to create campaign objects
|
||||||
|
|||||||
Reference in new issue
Block a user