Open susanodd opened 6 days ago
This code is linked to temporary files and removes them from the hidden file input field in the drop file area and from the preview gallery. I don't see a need to remove this. Except that it does not work if there are multiple drop video boxes on one page, but that's not the case right?
This code is linked to temporary files and removes them from the hidden file input field in the drop file area and from the preview gallery. I don't see a need to remove this. Except that it does not work if there are multiple drop video boxes on one page, but that's not the case right?
I'm not sure actually. The perspective videos are on the left column now. I get bugs with this but can't figure out where the bug is. All of the upload code puts things in the temporary storage. It could be that Django erases this on its own.
GUESSWORK I suspect something that the file hasn't been completely copied. (But I can't prove this.) When the perspective videos were on the right column (like as the NME videos) they did not have this problem. I can't decipher the nesting structure. Maybe the panel where the perspective videos are is somehow nested inside the scope of something else? Or that there is no scope so they're inside of "body" (and share by default) (I only know that this happens on the nesting because of dark mode. Sometimes things were inheriting from body because there was no div element containing them. So it's possible that the left column video code is somehow sharing a scope.
@Jetske all the gloss video forms use the same form class which includes the return url.
Is it possible that the javascript code for the left column could hijack a return url from a perspective video? The return url does not differentiate which form it was returning from. Do I need an extra block around it to segment if from the normal videos code?
There was a problem with the Delete button because it was deleting all the videos. It is linked to the gloss, not a particular gloss video id. I repaired that, but then the reversion is doing weird stuff too. Then I modified the order of evaluation because it was using variables that referred to objects that were being deleted in a previous step of reversion.
(I didn't do anything to the normal videos code because I can't use the record or drag and drop on Ubuntu/MacOS. So I can't debug it properly. Both Firefox and Safari do some "browser" temp files. I can't drag and drop screenshots into GitHub, for example. It ends up hidden as a local asset. Maybe this is messing up Django which also has temp storage.)
I modified one of the "temp storage" tests on a new video file because using a print statement, it does not match the actual type of such an object, so it's always false. The type it tests for is not a valid type. Maybe an import is missing? For the models.py file there are a lot of local imports. Normally they are supposed to be at the top, except the models.py suffers from circular import because the classes are not defined yet, so they're inside lots of methods. It could be that an import is missing. A lot of older code uses try-except but does not mention what the exception is, so basically those would not be reported since any exception would be caught.
[CODE]
BUG related to videos being deleted. There are too many submit buttons in the LEFT column where videos are uploaded. ALL the "video forms" SHARE one "form implementation" internally. There is a hidden redirect field but all the videos on the Gloss page go back to the Gloss page.
https://github.com/Signbank/Global-signbank/blob/9c35b16e31e8179c07c58deba58da9fc6590319c/signbank/dictionary/templates/dictionary/gloss_detail.html#L839
Can this line of code be removed? Or can it be attached to a url with a specific video id. (GlossVideo id, not a gloss id.) All the temporary videos are temporarily saved in the same folder. These get cleaned up. Is this removing temporary files or gloss video objects? If code is linked to temporary files and they are deleted they disappear. Some of the (original) video code unlinks files.
An alternative would be totally separate forms for each of the video types so they don't share code and don't use the same redirect. This would also depend on when the page is initialized or if a previous form is used, or a new form is created. Django makes new form objects if the page is reloaded. Also it's dubious that a redirect is here.