Html_dump: Update title to redirected page

pull/620/head
gnosygnu 8 years ago
parent fed89cd89b
commit 3c1898b9ef

@ -37,7 +37,7 @@ public class Xow_hdump_mgr__load implements Gfo_invk {
Xow_hdump_mode.Cfg__reg_type(cfg_mgr.Type_mgr()); Xow_hdump_mode.Cfg__reg_type(cfg_mgr.Type_mgr());
cfg_mgr.Bind_many_wiki(this, wiki, Cfg__read_preferred, Cfg__html_mode); cfg_mgr.Bind_many_wiki(this, wiki, Cfg__read_preferred, Cfg__html_mode);
} }
public void Load_by_edit(Xoae_page wpg) { public void Load_by_xowe(Xoae_page wpg) {
tmp_hpg.Ctor_by_hview(wpg.Wiki(), wpg.Url(), wpg.Ttl(), wpg.Db().Page().Id()); tmp_hpg.Ctor_by_hview(wpg.Wiki(), wpg.Url(), wpg.Ttl(), wpg.Db().Page().Id());
Load(tmp_hpg, wpg.Ttl()); Load(tmp_hpg, wpg.Ttl());
wpg.Db().Html().Html_bry_(tmp_hpg.Db().Html().Html_bry()); wpg.Db().Html().Html_bry_(tmp_hpg.Db().Html().Html_bry());

@ -34,33 +34,34 @@ public class Xowe_page_mgr {
// load page meta; wait_for_popups // load page meta; wait_for_popups
Xoae_page page = wiki.Data_mgr().Load_page_and_parse(url, ttl, wiki.Lang(), tab, false); Xoae_page page = wiki.Data_mgr().Load_page_and_parse(url, ttl, wiki.Lang(), tab, false);
ttl = page.Ttl(); // note that Load_page_and_parse can redirect ttl; EX: Special:Random -> A; DATE:2017-01-05
Wait_for_popups(wiki.App()); Wait_for_popups(wiki.App());
// auto-update // auto-update
read_mgr.Auto_update(wiki, page, ttl); read_mgr.Auto_update(wiki, page, ttl);
// load page from html_db // load from html_db
boolean from_html_db = page.Db().Page().Html_db_id() != -1; boolean from_html_db = page.Db().Page().Html_db_id() != -1;
boolean read_from_html_db_preferred = wiki.Html__hdump_mgr().Load_mgr().Read_preferred(); boolean read_from_html_db_preferred = wiki.Html__hdump_mgr().Load_mgr().Read_preferred();
if (from_html_db) { if (from_html_db) {
if (read_from_html_db_preferred) { if (read_from_html_db_preferred) {
wiki.Html__hdump_mgr().Load_mgr().Load_by_edit(page); wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page);
from_html_db = Bry_.Len_gt_0(page.Db().Html().Html_bry()); // NOTE: archive.org has some wtxt_dbs which included page|html_db_id without actual html_dbs; DATE:2016-06-22 from_html_db = Bry_.Len_gt_0(page.Db().Html().Html_bry()); // NOTE: archive.org has some wtxt_dbs which included page|html_db_id without actual html_dbs; DATE:2016-06-22
} }
else else
from_html_db = false; from_html_db = false;
} }
// load page from wtxt_db; occurs if (a) no html_db_id; (b) option says to use wtxt db; (c) html_db_id exists, but no html_db; // load from wtxt_db; occurs if (a) no html_db_id; (b) option says to use wtxt db; (c) html_db_id exists, but no html_db;
if (!from_html_db) { if (!from_html_db) {
wiki.Parser_mgr().Parse(page, false); wiki.Parser_mgr().Parse(page, false);
// load from html_dbs if no wtxt found and option just marked as not read_preferred // load from html_db if no wtxt found and option just marked as not read_preferred
if ( Bry_.Len_eq_0(page.Db().Text().Text_bry()) // no wtxt found if ( Bry_.Len_eq_0(page.Db().Text().Text_bry()) // no wtxt found
&& !ttl.Ns().Id_is_special() // skip special && !ttl.Ns().Id_is_special() // skip special
&& !read_from_html_db_preferred // read preferred not marked && !read_from_html_db_preferred // read preferred not marked
) { ) {
wiki.Html__hdump_mgr().Load_mgr().Load_by_edit(page); wiki.Html__hdump_mgr().Load_mgr().Load_by_xowe(page);
from_html_db = Bry_.Len_gt_0(page.Db().Html().Html_bry()); from_html_db = Bry_.Len_gt_0(page.Db().Html().Html_bry());
} }
} }

Loading…
Cancel
Save