Do not show duplicate media in person gallery

svn: r10560
This commit is contained in:
Gary Burton 2008-04-13 20:38:46 +00:00
parent 389ebc0f86
commit 6d3aaf4496

View File

@ -577,9 +577,12 @@ class BasePage:
of.write('\t<div id="indivgallery" class="subsection">\n')
of.write('\t\t<h4>%s</h4>\n' % _('Gallery'))
displayed = []
for mediaref in photolist:
photo_handle = mediaref.get_reference_handle()
photo = db.get_object_from_handle(photo_handle)
if photo_handle in displayed:
continue
mime_type = photo.get_mime_type()
title = photo.get_description()
if title == "":
@ -603,6 +606,7 @@ class BasePage:
self.photo_list[photo_handle] = [lnk]
except (IOError,OSError),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</div>\n\n')