def read_date(taglib, **opts)
      v10_year = taglib.id3v1_tag.year.to_s if taglib.id3v1_tag.year > 0
      v24_date = read_first_tag(taglib, ['TDRC'])

      # check variables in order of importance
      date_str = v24_date || v10_year
      puts "MP3#date: date_str = \"#{date_str}\"" if $DEBUG

      date_str
    end
def read_date(taglib, **opts)
      v10_year = taglib.id3v1_tag.year.to_s if taglib.id3v1_tag.year > 0
      v24_date = read_first_tag(taglib, ['TDRC'])

      # check variables in order of importance
      date_str = v24_date || v10_year
      puts "MP3#date: date_str = \"#{date_str}\"" if $DEBUG

      date_str
    end
NOTE: id3v2.3 tags (TYER+TDAT) will lose month/day information due to taglib's
 internal frame conversion. During the conversion, the TDAT frame is
 dropped and only the TYER frame is used in the conversion to TDRC.
 (see: https://github.com/taglib/taglib/issues/127)