New function in GUI
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.

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.tomlfile style afterdump). - changed
utils/CONSTANTS.pytoutils/backgrounds.json- I can edit it with Flask, and it will be useful in the future (if I create a background manager). -
background.py- loadsutils/backgrounds.jsonand 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.
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
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\_-]+)*$
Yeah this looks great, can't see any immediate issues. Thanks!
Can I merge then?
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.
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.
Yeah this looks great, can't see any immediate issues. Thanks!
I guess I'll merge then