thelabcat / rumble-chat-actor

Interact with the chat of your livestreams in Python
GNU General Public License v3.0
2 stars 0 forks source link

ClipCommand should avoid overwriting clips #13

Closed thelabcat closed 3 months ago

thelabcat commented 3 months ago

When saving a clip, the two clip commands should increment a suffix until the file does not show up in a glob of the output folder. this should happen before the notif message that the clip was saved so it displays the incremented name.

thelabcat commented 3 months ago

if filename in glob.glob("*", root_dir = self.clip_save_path):

thelabcat commented 3 months ago
increment = 0
safe_filename = filename
while safe_filename in glob.glob("*", root_dir = self.clip_save_path):
    increment += 1
    safe_filename = filename + f"({increment})"