~jamesh/mediascanner2/folder-coverart

« back to all changes in this revision

Viewing changes to src/daemon/MetadataExtractor.cc

  • Committer: CI Train Bot
  • Author(s): James Henstridge
  • Date: 2015-11-02 02:52:41 UTC
  • mfrom: (308.3.3 m4a-thumbnail)
  • Revision ID: ci-train-bot@canonical.com-20151102025241-66kyt26kvnx1nwry
Fix the metadata extractor so that it correctly extracts the date and presence of cover art from MPEG 4 audio files. Fixes: #1492407
Approved by: PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
    int i, num;
151
151
    string tagname(tag);
152
152
 
153
 
    if(tagname == GST_TAG_IMAGE) {
 
153
    if(tagname == GST_TAG_IMAGE || tagname == GST_TAG_PREVIEW_IMAGE) {
154
154
        mfb->setHasThumbnail(true);
155
155
        return;
156
156
    }
180
180
                mfb->setDate(dt_string);
181
181
                g_free(dt_string);
182
182
            }
 
183
        } else if (G_VALUE_HOLDS(val, G_TYPE_DATE)) {
 
184
            if (tagname == GST_TAG_DATE) {
 
185
                GDate *dt = static_cast<GDate*>(g_value_get_boxed(val));
 
186
                if (!dt) {
 
187
                    continue;
 
188
                }
 
189
                char buf[100];
 
190
                if (g_date_strftime(buf, sizeof(buf), "%Y-%m-%d", dt) != 0) {
 
191
                    mfb->setDate(buf);
 
192
                }
 
193
            }
183
194
        } else if (G_VALUE_HOLDS_UINT(val)) {
184
195
            if (tagname == GST_TAG_TRACK_NUMBER) {
185
196
                mfb->setTrackNumber(g_value_get_uint(val));