don't just delete the m3u file for multi-part roms#58
Conversation
|
I'm going to test this in a bit since I don't think the new behaviour is doing what we're expecting it to... |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the ROM removal flow by deleting all files referenced in a multi-part ROM’s .m3u manifest instead of only removing the manifest itself.
- Replaces the inline
os.removein the contextual menu with a call to a new helper. - Introduces
_remove_rom_filesto traverse.m3ulists and delete each referenced file. - Preserves single-file ROM removal behavior for non-multi ROMs.
Comments suppressed due to low confidence (3)
RomM/romm.py:874
- Missing docstring for
_remove_rom_files. Add a brief description of the method’s purpose, parameters, and behavior.
def _remove_rom_files(self, rom):
RomM/romm.py:880
- [nitpick] The variable
fis too generic. Consider renaming it tom3u_fileorfile_handleto clarify its role.
with open(rom_list_path, "r") as f:
RomM/romm.py:877
- Add unit tests for the multi-part ROM deletion path to ensure that all files listed in the
.m3uare correctly removed and edge cases (empty lines, missing files) are handled.
if rom.multi:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
It worked correctly for me when I tested on both a psx game with multiple chd files in the .hidden directory as well as when I tested on a nds game which is by nature a single file. Is there a particular concern you had? |
No concern, I'm just having trouble visualizing the new logic. Once I run things on my device with some logs it should all make sense! |
gantoine
left a comment
There was a problem hiding this comment.
Ah I get it now! I would have deleted matching files in the .hidden folder but I think your approach is more robust. 💪🏼
Description
multi-disk roms only deleted the .m3u which doesn't claw back much disk space. Logic is added to traverse the .m3u file and delete the files that it points at
Checklist
Please check all that apply.
Screenshots