Make sure easybake uses the normalized name in return notes.

This commit is contained in:
voussoir 2017-04-20 18:28:11 -07:00
parent 24b6970617
commit cc0c847eb5
2 changed files with 5 additions and 2 deletions

View file

@ -929,6 +929,8 @@ class Tag(ObjectBase, GroupableMixin):
self.photodb.log.debug('Committing - add synonym')
self.photodb.commit()
return synname
def convert_to_synonym(self, mastertag, *, commit=True):
'''
Convert this tag into a synonym for a different tag.

View file

@ -1354,8 +1354,9 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
if rename_to:
tag = self.get_tag(tag)
note = ('rename', '%s=%s' % (tag.name, rename_to))
old_name = tag.name
tag.rename(rename_to)
note = ('rename', '%s=%s' % (old_name, tag.name))
output_notes.append(note)
else:
tag_parts = tag.split('.')
@ -1370,7 +1371,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
tag = tags[-1]
if synonym:
tag.add_synonym(synonym)
synonym = tag.add_synonym(synonym)
note = ('new_synonym', '%s+%s' % (tag.name, synonym))
output_notes.append(note)
print('New syn %s' % synonym)