Do not show duplicate media in person gallery

svn: r10561
This commit is contained in:
Gary Burton 2008-04-13 20:40:12 +00:00
parent 20aac61668
commit d97f73f71b

View File

@ -458,10 +458,13 @@ class BasePage:
db = self.report.database db = self.report.database
of.write('\t<div id="indivgallery" class="subsection">\n') of.write('\t<div id="indivgallery" class="subsection">\n')
of.write('\t\t<h4>%s</h4>\n' % _('Gallery')) of.write('\t\t<h4>%s</h4>\n' % _('Gallery'))
displayed = []
for mediaref in photolist: for mediaref in photolist:
photo_handle = mediaref.get_reference_handle() photo_handle = mediaref.get_reference_handle()
photo = db.get_object_from_handle(photo_handle) photo = db.get_object_from_handle(photo_handle)
if photo_handle in displayed:
continue
mime_type = photo.get_mime_type() mime_type = photo.get_mime_type()
title = photo.get_description() title = photo.get_description()
@ -493,6 +496,7 @@ class BasePage:
photo_list[photo_handle] = [lnk] photo_list[photo_handle] = [lnk]
except (IOError, OSError), msg: except (IOError, OSError), msg:
WarningDialog(_("Could not add photo to page"), str(msg)) WarningDialog(_("Could not add photo to page"), str(msg))
displayed.append(photo_handle)
of.write('\t\t<div class="fullclear"></div>\n') of.write('\t\t<div class="fullclear"></div>\n')
of.write('\t</div>\n\n') of.write('\t</div>\n\n')