comparison rdf/RDFFeatureWriter.h @ 1144:c8e291700c0e

Write Track in RDF only if title/artist metadata present, not simply on the basis of a TrackMetadata object existing
author Chris Cannam
date Wed, 04 Nov 2015 12:06:12 +0000
parents e25dc8d57565
children c01cbe41aeb5
comparison
equal deleted inserted replaced
1143:d649818fc249 1144:c8e291700c0e
68 RDFDescriptionMap m_rdfDescriptions; 68 RDFDescriptionMap m_rdfDescriptions;
69 69
70 typedef map<QString, TrackMetadata> TrackMetadataMap; 70 typedef map<QString, TrackMetadata> TrackMetadataMap;
71 TrackMetadataMap m_metadata; 71 TrackMetadataMap m_metadata;
72 72
73 bool haveTitleArtistMetadata(QString trackId) const {
74 // Formerly in various places we used to test whether a track
75 // appeared in the metadata map at all, in order to determine
76 // whether it had any associated metadata. That won't work any
77 // more because metadata now includes duration, which can
78 // appear even if no title/artist are given and which is not
79 // something whose presence indicates the involvement of a
80 // "publication Track". So check for artist/title explicitly.
81 auto mitr = m_metadata.find(trackId);
82 if (mitr == m_metadata.end()) return false;
83 return (mitr->second.title != "" || mitr->second.maker != "");
84 }
85
73 QString m_fixedEventTypeURI; 86 QString m_fixedEventTypeURI;
74 87
75 virtual void reviewFileForAppending(QString filename); 88 virtual void reviewFileForAppending(QString filename);
76 89
77 void writePrefixes(QTextStream *); 90 void writePrefixes(QTextStream *);