Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excess number of backup videos being created by the API #1397

Open
susanodd opened this issue Nov 26, 2024 · 3 comments
Open

Excess number of backup videos being created by the API #1397

susanodd opened this issue Nov 26, 2024 · 3 comments

Comments

@susanodd
Copy link
Collaborator

susanodd commented Nov 26, 2024

For some reason, numerous video uploads are being done for the same gloss repeatedly, each creating a new backup of the previous video upload. Sometimes upwards of 30 video files. There are matching requests for each of these. "Op hol slaan"

@Jetske
Copy link
Collaborator

Jetske commented Nov 26, 2024

After asking @rem0g it turns out this was probably an upload script stuck in a loop. Has been fixed.

To clean up the duplicate backup files, is there already command for that (if so I can't find it)? Or what would be the best way to do this?

@susanodd
Copy link
Collaborator Author

susanodd commented Nov 26, 2024

There were some more today, so I don't know if it's totally fixed. Regardless, there is nothing to stop the API user from uploading the same video file over and over again.

There isn't a command for them. The files need to be deleted before you can delete the objects.
But then the version numbers need to be modified, because they won't be correct anymore.
I was working on that for the old format "bak.bak" files. But I didn't delete files. I only removed objects if there was no file.
Then enumerated over what was left to give them new version numbers.
I'm guessing though that all the backup files created can safely be deleted.

I guess we could implement a command to do that in the admin.
The files need to be "unlinked". You can see that in the video code.

If you just remove the files you can also just remove the objects.
We don't really know how extensive this is.

If you look at the files in the terminal screen, it's kind of impossible to determine just by looking what is to delete. All the file names start with the same first two characters, then you need to browse to the end to see if it's the same gloss or not.
So it would be time consuming to do by hand.
It would also be difficult to keep searching in the admin for ones to select, to delete. (Assuming a new admin command.)
It's also unfortunate that all the new backup files have version 1.
An admin command to "delete a backup video" would need to

  1. unlink the file if a file exists
  2. delete the object
  3. renumber all the versions of all the other backup videos for the same gloss

@Jetske I'll make a command as such.

Probably in the API request, it ought to check if the "new" video is the same as the "existing" video. There's an OS command for that.

@susanodd
Copy link
Collaborator Author

susanodd commented Nov 27, 2024

@susanodd is making a video admin as well as a Manage Video Storage "remove backups" command for selected GlossVideo objects:

If the object is a backup:

  1. unlink the file if a file exists
  2. delete the object
  3. renumber all the versions of all the other backup videos for the same gloss

@Woseseltops:

Probably in the API request, it ought to check if the "new" video is the same as the "existing" video. There's an OS command for that. Ignore the request if so. (Note, there is nothing to stop the API from uploading the same video over and over again. This necessitates the command above. On Signbank, the user would become RSI-exhausted doing repeated uploads by hand.)

I'm adding commands to do this in the Manage Video Storage page (other issue).

With the introduction of perspective views on the NME videos, more and more videos will be uploaded.
It is important to clear up all the excessive backup files in order to maintain a CLEAR and OVERZICHTELIJK database.

@susanodd susanodd added the API label Nov 27, 2024
susanodd added a commit that referenced this issue Nov 27, 2024
after selection was deleted, version numbers adjusted for new set. Change extension of backup file if it has the wrong video extension for its format.
susanodd pushed a commit that referenced this issue Nov 29, 2024
change file extension command, match file type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants