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

Some annotated videos / annotation files not saved #1370

Open
Jetske opened this issue Nov 5, 2024 · 5 comments
Open

Some annotated videos / annotation files not saved #1370

Jetske opened this issue Nov 5, 2024 · 5 comments
Assignees
Labels

Comments

@Jetske
Copy link
Collaborator

Jetske commented Nov 5, 2024

See https://signbank.cls.ru.nl/dictionary/gloss/2326 which should have 3 sentences but shows none. The 3 annotatedvideo objects are not there, and the annotation file is also missing.

@Jetske Jetske self-assigned this Nov 5, 2024
@susanodd
Copy link
Collaborator

susanodd commented Nov 6, 2024

If you click on the results in the scroll bar, and then visit the pages, you see that the video format is not supported.

https://signbank.cls.ru.nl/dictionary/annotatedsentence/21

On my browser, it shows the not supported format video image.

@susanodd
Copy link
Collaborator

susanodd commented Nov 6, 2024

@Jetske I added a model method to get the path for the eaf file in order to display it in the list.

The path in the object is correct but the file does not exist.

However, it returns the correct path.
If you look in the admin for the Annotated Glosses, in the column eaf file, they are all filled in.
The ones where the file is missing are sentence 2 and 29.
But they have the eaf file inside the objects.
This is a bit weird.
So the method to retrieve the path is also going to need to check if the path/file exists?

@susanodd
Copy link
Collaborator

susanodd commented Nov 6, 2024

[for jetske only]

Here is some code (modified to test for it being empty):

    def get_eaffile_name(self):
        return os.path.basename(self.eaffile.name) if self.eaffile else ""

That is the type-safe way to implement it.
But if it's empty, then that is a problem.

This is actually the same as doing

str(self.eaffile) ? That should just return the relative path, right?

Is it possible one of the operations ended up erasing the file by accident?
The upload has this as a required field.

susanodd pushed a commit that referenced this issue Nov 7, 2024
Show video and eaf file and timestamps in admin
@susanodd
Copy link
Collaborator

susanodd commented Nov 7, 2024

@Jetske I added some Admin to be able to investigate what is stored. #1372

In the Annotated Gloss List (search), the paths only show up in the results list now if the file exists.
This is meant to assist administration in identifying when something is missing.
We still don't know why the files disappeared.

UPDATE: CODE IS LIVE]

susanodd pushed a commit that referenced this issue Nov 7, 2024
susanodd added a commit that referenced this issue Nov 8, 2024
#1370: Admin and Video Admin for Annotated Sentences/Videos
@susanodd
Copy link
Collaborator

susanodd commented Nov 8, 2024

@Jetske this isn't directly related, but I am already aware of this type error. Now I saw it in the logs while I'm testing code on signbank-test.


  File "/var/www/repo/signbank/dictionary/models.py", line 2372, in add_nme_video
    if isinstance(videofile, File) or videofile.content_type == 'django.core.files.uploadedfile.InMemoryUploadedFile':
                                      ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'content_type'

This is a wrong type. The videofile does not have a content_type.

The code in question is repeated in all the various methods.

I guess I'm going through logs starting in July.
But it's showing logs for all the containers in the same file. (I wonder if this is correct.)

@susanodd susanodd added the bug label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants