Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Video files disappearing, too many submit buttons for overlapping forms #1358

Open susanodd opened 6 days ago

susanodd commented 6 days ago

[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.

Jetske commented 4 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?

susanodd commented 4 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?

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.

susanodd commented 3 days ago

@Jetske all the gloss video forms use the same form class which includes the return url.