execm filters: the change to let filters set arbitrary metadata lost the top doc size, now saved aside
This commit is contained in:
parent
3bbaf51b5f
commit
01d0f4b734
3 changed files with 24 additions and 24 deletions
|
@ -80,7 +80,6 @@ DEF_CSTR(dj_keycontent, "content");
|
||||||
DEF_CSTR(dj_keyipath, "ipath");
|
DEF_CSTR(dj_keyipath, "ipath");
|
||||||
DEF_CSTR(dj_keymd5, "md5");
|
DEF_CSTR(dj_keymd5, "md5");
|
||||||
DEF_CSTR(dj_keymt, "mimetype");
|
DEF_CSTR(dj_keymt, "mimetype");
|
||||||
DEF_CSTR(dj_keydocsize, "docsize");
|
|
||||||
DEF_CSTR(dj_keyanc, "rclanc");
|
DEF_CSTR(dj_keyanc, "rclanc");
|
||||||
|
|
||||||
#endif /* _CSTR_H_INCLUDED_ */
|
#endif /* _CSTR_H_INCLUDED_ */
|
||||||
|
|
|
@ -517,9 +517,9 @@ bool FileInterner::dijontorcl(Rcl::Doc& doc)
|
||||||
// point if the last container filter is directly
|
// point if the last container filter is directly
|
||||||
// returning text/plain content, so that there is no
|
// returning text/plain content, so that there is no
|
||||||
// ipath-less filter at the top
|
// ipath-less filter at the top
|
||||||
char cbuf[30];
|
lltodecstr(doc.text.length(), doc.fbytes);
|
||||||
sprintf(cbuf, "%d", int(doc.text.length()));
|
LOGDEB("FileInterner::dijontorcl: fbytes->" << doc.fbytes <<
|
||||||
doc.fbytes = cbuf;
|
endl);
|
||||||
}
|
}
|
||||||
} else if (it->first == cstr_dj_keymd) {
|
} else if (it->first == cstr_dj_keymd) {
|
||||||
doc.dmtime = it->second;
|
doc.dmtime = it->second;
|
||||||
|
@ -584,23 +584,21 @@ void FileInterner::collectIpathAndMT(Rcl::Doc& doc) const
|
||||||
for (vector<RecollFilter*>::const_iterator hit = m_handlers.begin();
|
for (vector<RecollFilter*>::const_iterator hit = m_handlers.begin();
|
||||||
hit != m_handlers.end(); hit++) {
|
hit != m_handlers.end(); hit++) {
|
||||||
const map<string, string>& docdata = (*hit)->get_meta_data();
|
const map<string, string>& docdata = (*hit)->get_meta_data();
|
||||||
if (getKeyValue(docdata, cstr_dj_keyipath, ipathel)) {
|
ipathel.clear();
|
||||||
if (!ipathel.empty()) {
|
getKeyValue(docdata, cstr_dj_keyipath, ipathel);
|
||||||
// Non-empty ipath. This stack element is for an
|
if (!ipathel.empty()) {
|
||||||
// actual embedded document, not a format translation.
|
// Non-empty ipath. This stack element is for an
|
||||||
hasipath = true;
|
// actual embedded document, not a format translation.
|
||||||
getKeyValue(docdata, cstr_dj_keymt, doc.mimetype);
|
hasipath = true;
|
||||||
getKeyValue(docdata, cstr_dj_keyfn, doc.meta[Rcl::Doc::keyfn]);
|
getKeyValue(docdata, cstr_dj_keymt, doc.mimetype);
|
||||||
} else {
|
getKeyValue(docdata, cstr_dj_keyfn, doc.meta[Rcl::Doc::keyfn]);
|
||||||
if (doc.fbytes.empty())
|
} else {
|
||||||
getKeyValue(docdata, cstr_dj_keydocsize, doc.fbytes);
|
if (doc.fbytes.empty()) {
|
||||||
}
|
lltodecstr((*hit)->get_docsize(), doc.fbytes);
|
||||||
doc.ipath += colon_hide(ipathel) + cstr_isep;
|
LOGDEB("collectIpath..: fbytes->" << doc.fbytes << endl);
|
||||||
} else {
|
}
|
||||||
if (doc.fbytes.empty())
|
}
|
||||||
getKeyValue(docdata, cstr_dj_keydocsize, doc.fbytes);
|
doc.ipath += colon_hide(ipathel) + cstr_isep;
|
||||||
doc.ipath += cstr_isep;
|
|
||||||
}
|
|
||||||
// We set the author field from the innermost doc which has
|
// We set the author field from the innermost doc which has
|
||||||
// one: allows finding, e.g. an image attachment having no
|
// one: allows finding, e.g. an image attachment having no
|
||||||
// metadata by a search on the sender name. Only do this for
|
// metadata by a search on the sender name. Only do this for
|
||||||
|
|
|
@ -92,9 +92,11 @@ public:
|
||||||
return set_document_string(mtype, std::string(cp, sz));
|
return set_document_string(mtype, std::string(cp, sz));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_docsize(off_t size)
|
virtual void set_docsize(off_t size) {
|
||||||
{
|
m_docsize = size;
|
||||||
m_metaData[cstr_dj_keydocsize] = ulltodecstr(size);
|
}
|
||||||
|
virtual off_t get_docsize() const {
|
||||||
|
return m_docsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool has_documents() const {return m_havedoc;}
|
virtual bool has_documents() const {return m_havedoc;}
|
||||||
|
@ -146,6 +148,7 @@ protected:
|
||||||
// m_id is and md5 of the filter definition line (from mimeconf) and
|
// m_id is and md5 of the filter definition line (from mimeconf) and
|
||||||
// is used when fetching/returning filters to / from the cache.
|
// is used when fetching/returning filters to / from the cache.
|
||||||
std::string m_id;
|
std::string m_id;
|
||||||
|
off_t m_docsize; // Size of the top document
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue