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

Suspected bug with adding annotations to existing AnnotationPage #194

Open
glenrobson opened this issue Apr 26, 2024 · 0 comments
Open

Suspected bug with adding annotations to existing AnnotationPage #194

glenrobson opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@glenrobson
Copy link
Contributor

If I wanted to add an annotation to an existing annotationPage I could call the add_annotation method as follows:

canvas.make_annotation(id=f"{URI_PRIFIX}/{identifier}", 
                                               motivation="supplementing", 
                                               target=c.id, 
                                               anno_page_id=annotationPageId,
                                               body={"id": f"https://archive.org/download/{identifier}/{vttFile['name']}",
                                                     "type": "Text",
                                                    "format": "text/vtt",
                                                    })

The first time this will happen it will create a new annotation page with the correct id. The second time I try and add an annotation to this page it will add it to the first annotationPage:

anno_page = self.annotations[0]

rather than searching through the annotaiton pages looking for the one that matches the ID.

Expected behaviour:

When passing in a annotationPage id the code should find that annotaiton page if it exists and add the annotation to the correct page.

Observed behaviour:

Untested but if the canvas already has a annotationPage then the annotaiton will be added to the first annotation page.

Potential bug location(s):

anno_page = self.annotations[0]

@glenrobson glenrobson added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant