Skip to content

📂 v2.9.3: Split Recording Organization Fix

Choose a tag to compare

@SlonickLab SlonickLab released this 04 Jun 13:00
· 60 commits to main since this release
22cd7b9

A critical bug fix that resolves an issue where split recordings were not being organized into game-specific folders. Thanks to @vunhatchuong for the detailed bug report! (Issue #23)


🐛 Bug Fixes

  • 📂 Split recordings not organized into folders:

    • Fixed a critical Lua variable scoping bug where the on_recording_file_changed() signal handler was accessing a global current_recording_file variable, while all other functions (delayed_recording_init, check_split_files, on_event) accessed a local variable with the same name. This happened because the local declaration was placed after the signal handler function definition — in Lua, local variables are only visible to code that comes after their declaration.
    • Symptom: Split recordings worked on the 1st recording session but failed on the 2nd, 3rd, etc. ("every other recording" pattern). The signal handler retained stale file paths from previous sessions in the global variable, causing it to attempt moving non-existent files instead of the actual split segment.
    • Fix: Moved the local current_recording_file and local split_files declarations before the on_recording_file_changed() function, so all functions now share the same local upvalue.
  • 📁 Initial recording file path not detected (Advanced Output Mode):

    • Fixed an issue where get_last_file proc handler returned empty for adv_file_output (OBS Advanced output mode), leaving current_recording_file uninitialized.
    • New fallback: The script now reads the file path directly from the recording output's settings (obs_output_get_settings) when get_last_file fails, checking both "path" and "url" keys.
  • 🛡️ Safety net in file_changed signal handler:

    • If current_recording_file is still uninitialized at the time of the first split, the signal handler now attempts to recover the previous file path from the recording output reference (recording_output_ref) as a last resort.

💡 Update: Simply replace the Smart_Replay_Mover.lua file with the new version and restart OBS. All your settings and custom names will be preserved.