Fix internfile bug which prevented the propagation of a proper title in some cases

This commit is contained in:
Jean-Francois Dockes 2022-01-14 17:18:49 +01:00
parent 844b4e8b03
commit 47ea12353a
5 changed files with 12 additions and 13 deletions

View File

@ -562,13 +562,13 @@ bool FileInterner::dijontorcl(Rcl::Doc& doc)
const string *val = 0; const string *val = 0;
if (!doc.peekmeta(Rcl::Doc::keymd5, &val) || val->empty()) if (!doc.peekmeta(Rcl::Doc::keymd5, &val) || val->empty())
doc.meta[Rcl::Doc::keymd5] = ent.second; doc.meta[Rcl::Doc::keymd5] = ent.second;
} else if (ent.first == cstr_dj_keymt || } else if (ent.first == cstr_dj_keymt || ent.first == cstr_dj_keycharset) {
ent.first == cstr_dj_keycharset) {
// don't need/want these. // don't need/want these.
} else { } else {
LOGDEB2("dijontorcl: " << m_cfg->fieldCanon(ent.first) << " -> " << LOGDEB2("dijontorcl: " << m_cfg->fieldCanon(ent.first) << " -> " << ent.second << "\n");
ent.second << endl); if (!ent.second.empty()) {
doc.addmeta(m_cfg->fieldCanon(ent.first), ent.second); doc.meta[m_cfg->fieldCanon(ent.first)] = ent.second;
}
} }
} }
if (doc.meta[Rcl::Doc::keyabs].empty() && if (doc.meta[Rcl::Doc::keyabs].empty() &&
@ -583,7 +583,7 @@ const set<string> nocopyfields{cstr_dj_keycontent, cstr_dj_keymd,
cstr_dj_keyanc, cstr_dj_keyorigcharset, cstr_dj_keyfn, cstr_dj_keyanc, cstr_dj_keyorigcharset, cstr_dj_keyfn,
cstr_dj_keymt, cstr_dj_keycharset, cstr_dj_keyds}; cstr_dj_keymt, cstr_dj_keycharset, cstr_dj_keyds};
static void copymeta(const RclConfig *cfg,Rcl::Doc& doc, const RecollFilter* hp) static void copymeta(const RclConfig *cfg, Rcl::Doc& doc, const RecollFilter* hp)
{ {
for (const auto& entry : hp->get_meta_data()) { for (const auto& entry : hp->get_meta_data()) {
if (nocopyfields.find(entry.first) == nocopyfields.end()) { if (nocopyfields.find(entry.first) == nocopyfields.end()) {
@ -650,7 +650,7 @@ void FileInterner::collectIpathAndMT(Rcl::Doc& doc) const
// handlers to use setfield() instead of embedding // handlers to use setfield() instead of embedding
// metadata in the HTML meta tags. // metadata in the HTML meta tags.
if (i == 0 || !pathelprev.empty()) { if (i == 0 || !pathelprev.empty()) {
copymeta(m_cfg, doc, m_handlers[i]); copymeta(m_cfg, doc, m_handlers[i == 0 ? 0 : i-1]);
} }
if (doc.fbytes.empty()) { if (doc.fbytes.empty()) {
lltodecstr(m_handlers[i]->get_docsize(), doc.fbytes); lltodecstr(m_handlers[i]->get_docsize(), doc.fbytes);
@ -744,8 +744,7 @@ int FileInterner::addHandler()
LOGINFO("FileInterner::addHandler: no filter for [" << mimetype << "]\n"); LOGINFO("FileInterner::addHandler: no filter for [" << mimetype << "]\n");
return ADD_CONTINUE; return ADD_CONTINUE;
} }
newflt->set_property(Dijon::Filter::OPERATING_MODE, newflt->set_property(Dijon::Filter::OPERATING_MODE, m_forPreview ? "view" : "index");
m_forPreview ? "view" : "index");
if (!charset.empty()) if (!charset.empty())
newflt->set_property(Dijon::Filter::DEFAULT_CHARSET, charset); newflt->set_property(Dijon::Filter::DEFAULT_CHARSET, charset);

View File

@ -1 +1 @@
FreqFor maildir_uniquexxx : 692 FreqFor maildir_uniquexxx : 734

View File

@ -1,2 +1,2 @@
1 results 1 results
application/msword [file:///home/dockes/projets/fulltext/testrecoll/embed/thunderbirdlocalfolders.zip] [xingfx1.doc] 24576 bytes application/msword [file:///home/dockes/projets/fulltext/testrecoll/embed/thunderbirdlocalfolders.zip] [xingfx1.doc (Sending a word document)] 24576 bytes

View File

@ -1,2 +1,2 @@
1 results 1 results
text/plain [file:///home/dockes/projets/fulltext/testrecoll/orgmode/orgmode-example.org] [law and legal code versioned on github] 370 bytes text/x-orgmode-sub [file:///home/dockes/projets/fulltext/testrecoll/orgmode/orgmode-example.org] [law and legal code versioned on github] 487 bytes

View File

@ -2,5 +2,5 @@
0 results 0 results
0 results 0 results
2 results 2 results
application/octet-stream [file:///home/dockes/projets/fulltext/testrecoll/rfc2231/thunder] [épatantuniquefilenameterm.bin (vrai attach)] 5785 bytes
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/rfc2231/thunder] [vrai attach] 11208 bytes message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/rfc2231/thunder] [vrai attach] 11208 bytes
application/octet-stream [file:///home/dockes/projets/fulltext/testrecoll/rfc2231/thunder] [épatantuniquefilenameterm.bin] 5785 bytes