Skip to content

Commit

Permalink
#1370: AnnotateGlossList Only show video path and eaf path if file ac…
Browse files Browse the repository at this point in the history
…tually exists.
  • Loading branch information
susanodd committed Nov 7, 2024
1 parent 792606d commit 148a822
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions signbank/dictionary/adminviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -7577,9 +7577,9 @@ def annotatedglosslist_ajax_complete(request, annotatedgloss_id):
elif fieldname == 'isRepresentative':
display_value = this.isRepresentative
elif fieldname == 'annotatedvideo':
display_value = this.annotatedsentence.get_video_path()
display_value = this.annotatedsentence.get_video()
elif fieldname == 'eaffile':
display_value = this.annotatedsentence.get_eaf_path()
display_value = this.annotatedsentence.get_eaf()
else:
display_value = ''
column_values.append((fieldname, display_value))
Expand Down
12 changes: 11 additions & 1 deletion signbank/dictionary/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4196,7 +4196,17 @@ def get_video(self):
return video_path
else:
return ''


def get_eaf(self):
"""Return the video object for this gloss or None if no video available"""

eaf_path = self.get_eaf_path()
filepath = os.path.join(settings.WRITABLE_FOLDER, eaf_path)
if os.path.exists(filepath.encode('utf-8')):
return eaf_path
else:
return ''

def has_video(self):
"""Test to see if the video for this sign is present"""

Expand Down

0 comments on commit 148a822

Please sign in to comment.