Doc tweaks & changelog for #1589

This commit is contained in:
Adrian Sampson 2015-09-02 15:05:23 -07:00
parent 2547f174b8
commit bc137b174f
2 changed files with 18 additions and 9 deletions

View file

@ -1461,11 +1461,14 @@ class MediaFile(object):
yield property.decode('utf8')
@classmethod
def field_sort_name(cls, name):
"""Get field name for sorting purposes. Fields names are kept
unchanged, unless they are instances of :class:`DateItemField`,
in which case `year`, `month`, and `day` are replaced by `date0`,
`date1`, and `date2`, respectively.
def _field_sort_name(cls, name):
"""Get a sort key for a field name that determines the order
fields should be written in.
Fields names are kept unchanged, unless they are instances of
:class:`DateItemField`, in which case `year`, `month`, and `day`
are replaced by `date0`, `date1`, and `date2`, respectively, to
make them appear in that order.
"""
if isinstance(cls.__dict__[name], DateItemField):
name = re.sub('year', 'date0', name)
@ -1475,11 +1478,14 @@ class MediaFile(object):
@classmethod
def sorted_fields(cls):
"""Get the names of all writable metadata fields sorted by
lexicographic order (except for instances of :class:`DateItemField`,
which are sorted in year-month-day order).
"""Get the names of all writable metadata fields, sorted in the
order that they should be written.
This is a lexicographic order, except for instances of
:class:`DateItemField`, which are sorted in year-month-day
order.
"""
for property in sorted(cls.fields(), key=cls.field_sort_name):
for property in sorted(cls.fields(), key=cls._field_sort_name):
yield property
@classmethod

View file

@ -33,6 +33,9 @@ Fixes:
* :doc:`/plugins/fetchart`: The plugin now fetches PNGs but not GIFs. (It
still fetches JPEGs.) This avoids an error when trying to embed images,
since not all formats support GIFs. :bug:`1588`
* Date fields are now written in the correct order (year-month-day), which
eliminates an intermittent bug where the latter two fields would not get
written to files. Thanks to :user:`jdetrey`. :bug:`1303` :bug:`1589`
1.3.14 (August 2, 2015)