Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbyperson committed Oct 3, 2024
1 parent 84b1001 commit 2cee188
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions reaper/cogs/log_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,27 +294,24 @@ async def on_message(self, message):
inline=False,
)

# First case: Handles paths with 'packages' and 'mods' subfolders (without capturing audio_file)
# Audio can be loaded under /packages or /mods so its easier to have two regexes
audio_matches_case1 = re.findall(
r"Finished async read of audio sample R2Northstar\\packages\\([^\\]+)\\mods\\[^\\]+\\audio\\([^\\]+)",
log,
)

# Second case: Handles paths with only 'mods' folder (without capturing audio_file)
audio_matches_case2 = re.findall(
r"Finished async read of audio sample R2Northstar\\mods\\([^\\]+)\\audio\\([^\\]+)",
log,
)

loaded_audio = {}
# Handling matches for the first case
for mod_folder, audio_folder in audio_matches_case1:
if audio_folder not in loaded_audio:
loaded_audio[audio_folder] = []
if mod_folder not in loaded_audio[audio_folder]:
loaded_audio[audio_folder].append(mod_folder)

# Handling matches for the second case
for mod_folder, audio_folder in audio_matches_case2:
if audio_folder not in loaded_audio:
loaded_audio[audio_folder] = []
Expand Down

0 comments on commit 2cee188

Please sign in to comment.