RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

New function in GUI

Open rivenintech opened this issue 3 years ago • 2 comments

Description

I think the process of adding new background videos is currently really annoying. You have to add it to CONSTANTS.py, then add it to .config.template.toml. I created an option to add a new background video easily (in GUI), by displaying the form that the user has to fill out.

image

I think it works pretty well, but it might need some improvement.

Issue Fixes

#986

Changes summary

  • GUI.py - GUI backend made with Flask.
  • index.html - added the "Add background video" button with a pop-up appearing after clicking it (it might look like I changed the whole file, but I forgot my VSCode formats HTML automatically... 😞).
  • requirements.txt - added Flask and tomlkit (tomlkit doesn't change the .toml file style after dump).
  • changed utils/CONSTANTS.py to utils/backgrounds.json - I can edit it with Flask, and it will be useful in the future (if I create a background manager).
  • background.py - loads utils/backgrounds.json and adds lambda function to get the proper position.

Any other information

I think the current GUI lacks many features and I would like to work on improving it, but I would like to get your opinion on it.

rivenintech avatar Aug 14 '22 12:08 rivenintech

I'm mostly happy with this, however there is a CodeQL warning that I'll take a look at tomorrow.

looks good to me too But you check out that codeQL error

JasonLovesDoggo avatar Aug 15 '22 05:08 JasonLovesDoggo

This regex should give no CodeQL error. Because it limits the characters. Could you test it? ^(?:https?:)?(?:\/\/)?(?:youtu\.be\/|(?:www\.|m\.)?youtube\.com\/(?:watch|v|embed)(?:\.php)?(?:\?.*v=|\/))([a-zA-Z0-9\_-]{7,15})(?:[\?&][a-zA-Z0-9\_-]+=[a-zA-Z0-9\_-]+)*$

OpenSourceSimon avatar Aug 17 '22 13:08 OpenSourceSimon

Yeah this looks great, can't see any immediate issues. Thanks!

Can I merge then?

JasonLovesDoggo avatar Aug 22 '22 02:08 JasonLovesDoggo

Yeah this looks great, can't see any immediate issues. Thanks!

Can I merge then?

Don't merge it yet. I think I found a little bug. I'll fix it in a few minutes.

rivenintech avatar Aug 22 '22 11:08 rivenintech

Yeah this looks great, can't see any immediate issues. Thanks!

Can I merge then?

Don't merge it yet. I think I found a little bug. I'll fix it in a few minutes.

I think I fixed it. The problem was with "__comment" in backgrounds.json (after adding "__comment" to the backgrounds.json code crashed because it treated "__comment" as one of the backgrounds). Now it should work fine.

rivenintech avatar Aug 22 '22 12:08 rivenintech

Yeah this looks great, can't see any immediate issues. Thanks!

I guess I'll merge then

JasonLovesDoggo avatar Aug 22 '22 16:08 JasonLovesDoggo