1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-08-24 00:32:13 -04:00
parent df10db140c
commit ed911e3de5
220 changed files with 2618 additions and 1569 deletions

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files; import gplx.*; import gplx.xowa.*;
import gplx.xowa.wikis.*;
import gplx.xowa.wikis.domains.*;
import gplx.xowa.files.repos.*;
public class Xof_fsdb_itm_fxt {
private byte[] wiki_abrv;
@@ -53,7 +53,7 @@ public class Xof_fsdb_itm_fxt {
return this;
}
public Xof_fsdb_itm_fxt Orig__commons__lnki() {
this.orig_repo_name = Xow_domain_.Domain_bry_commons;
this.orig_repo_name = Xow_domain_itm_.Bry__commons;
this.orig_repo_id = Xof_repo_itm_.Repo_remote;
this.orig_ttl = lnki_ttl;
this.orig_ext = Xof_ext_.new_by_ttl_(orig_ttl);
@@ -62,7 +62,7 @@ public class Xof_fsdb_itm_fxt {
return this;
}
public Xof_fsdb_itm_fxt Orig__enwiki__lnki() {
this.orig_repo_name = Xow_domain_.Domain_bry_enwiki;
this.orig_repo_name = Xow_domain_itm_.Bry__enwiki;
this.orig_repo_id = Xof_repo_itm_.Repo_local;
this.orig_ttl = lnki_ttl;
this.orig_ext = Xof_ext_.new_by_ttl_(orig_ttl);

View File

@@ -29,9 +29,12 @@ public class Xof_img_size {
public void Html_size_calc(int exec_tid, int lnki_w, int lnki_h, byte lnki_type, int upright_patch, double lnki_upright, int orig_ext, int orig_w, int orig_h, int thm_dflt_w) {
synchronized (this) {
this.Clear(); // always clear before calc; caller should be responsible, but just to be safe.
if (Xof_ext_.Id_supports_time(orig_ext) && lnki_w == Xof_img_size.Null) // use orig_w if no size specified for video; EX:[[File:A.ogv]] -> [[File:A.ogv|550px]] where 550px is orig_w; DATE:2015-08-07
lnki_w = orig_w;
if (Enm_.HasInt(lnki_type, Xop_lnki_type.Id_frame) // frame: always return orig size; Linker.php!makeThumbLink2; // Use image dimensions, don't scale
if ( Xof_ext_.Id_supports_time(orig_ext) // ext is video
&& lnki_w == Xof_img_size.Null // no size specified
&& !Xop_lnki_type.Id_is_thumbable(lnki_type) // not thumb which is implicitly 220; PAGE:en.w:Edward_Snowden; DATE:2015-08-17
)
lnki_w = orig_w; // use original size; EX:[[File:A.ogv]] -> [[File:A.ogv|550px]] where 550px is orig_w; DATE:2015-08-07
if (Enm_.Has_int(lnki_type, Xop_lnki_type.Id_frame) // frame: always return orig size; Linker.php!makeThumbLink2; // Use image dimensions, don't scale
&& lnki_h == Null) { // unless lnki_h specified; DATE:2013-12-22
html_w = file_w = orig_w;
html_h = file_h = orig_h;

View File

@@ -81,6 +81,9 @@ public class Xof_img_size_tst {
@Test public void Video__use_orig_w(){ // PURPOSE: video should use orig_w; DATE:2015-08-07
fxt.Lnki_type_(Xop_lnki_type.Id_none).Lnki_ext_(Xof_ext_.Id_ogv).Lnki_(-1, -1).Orig_(500, 250).Test_html(500, 250, Bool_.N);
}
@Test public void Video__use_thumb(){ // PURPOSE: video should use thumb_w, not orig_w; PAGE:en.w:Edward_Snowden DATE:2015-08-17
fxt.Lnki_type_(Xop_lnki_type.Id_thumb).Lnki_ext_(Xof_ext_.Id_ogv).Lnki_(-1, -1).Orig_(440, 220).Test_html(220, 110, Bool_.N);
}
}
class Xof_img_size_fxt {
private Xof_img_size img_size = new Xof_img_size();

View File

@@ -20,11 +20,11 @@ public class Xof_patch_upright_tid_ {
public static final int Tid_unpatched = 0, Tid_use_thumb_w = 1, Tid_fix_default = 2;
public static final int Tid_all = Tid_use_thumb_w | Tid_fix_default;
public static int Merge(boolean use_thumb_w, boolean fix_default) {
if (use_thumb_w && fix_default) return Enm_.AddInt(Tid_use_thumb_w, Tid_fix_default);
if (use_thumb_w && fix_default) return Enm_.Add_int(Tid_use_thumb_w, Tid_fix_default);
else if (use_thumb_w) return Tid_use_thumb_w;
else if (fix_default) return Tid_fix_default;
else return Tid_unpatched;
}
public static boolean Split_use_thumb_w(int tid) {return Enm_.HasInt(tid, Tid_use_thumb_w);}
public static boolean Split_fix_default(int tid) {return Enm_.HasInt(tid, Tid_fix_default);}
public static boolean Split_use_thumb_w(int tid) {return Enm_.Has_int(tid, Tid_use_thumb_w);}
public static boolean Split_fix_default(int tid) {return Enm_.Has_int(tid, Tid_fix_default);}
}

View File

@@ -19,7 +19,7 @@ package gplx.xowa.files.bins; import gplx.*; import gplx.xowa.*; import gplx.xow
import gplx.ios.*; import gplx.core.threads.*;
import gplx.xowa.apps.*;
import gplx.xowa.files.fsdb.*; import gplx.xowa.files.repos.*;
import gplx.xowa.wikis.*;
import gplx.xowa.wikis.domains.*;
public class Xof_bin_wkr__http_wmf implements Xof_bin_wkr {
private final Xow_repo_mgr repo_mgr; private final IoEngine_xrg_downloadFil download_wkr;
private final Io_download_mgr download_mgr;
@@ -38,11 +38,11 @@ public class Xof_bin_wkr__http_wmf implements Xof_bin_wkr {
if (!rv) {
Handle_error();
if (!rv && fsdb.Orig_repo_id() == Xof_repo_itm_.Repo_local) { // image is not found in local; check commons; occurs with bldr which relies on inaccurate data in image dumps; PAGE:en.w:Apollo_13; DATE:2015-08-05
src = Make_src(Xow_domain_.Domain_bry_commons, fsdb.Orig_ttl(), fsdb.Orig_ttl_md5(), fsdb.Orig_ext(), is_thumb, w, fsdb.Lnki_time(), fsdb.Lnki_page(), Io_url_.Empty);
src = Make_src(Xow_domain_itm_.Bry__commons, fsdb.Orig_ttl(), fsdb.Orig_ttl_md5(), fsdb.Orig_ext(), is_thumb, w, fsdb.Lnki_time(), fsdb.Lnki_page(), Io_url_.Empty);
rdr = download_mgr.Download_as_rdr(src);
rv = rdr.Exists();
if (rv)
fsdb.Change_repo(Xof_repo_itm_.Repo_remote, Xow_domain_.Domain_bry_commons); // set commons.wikimedia.org; DATE:2015-08-05
fsdb.Change_repo(Xof_repo_itm_.Repo_remote, Xow_domain_itm_.Bry__commons); // set commons.wikimedia.org; DATE:2015-08-05
else
Handle_error();
}

View File

@@ -159,7 +159,7 @@ public class Xou_cache_mgr {
Xoa_app_.Usr_dlg().Note_many("", "", "cache compress done");
}
private Io_url Calc_url(Xou_cache_itm cache) {
byte[] wiki_domain = Xow_domain_abrv_xo_.To_itm(cache.Lnki_wiki_abrv()).Domain_bry();
byte[] wiki_domain = Xow_abrv_xo_.To_itm(cache.Lnki_wiki_abrv()).Domain_bry();
Xow_wiki wiki = wiki_mgr.Get_by_key_or_make_init_y(wiki_domain); if (wiki == null) return Io_url_.Empty; // wiki is not available; should only happen in read-only mode; DATE:2015-05-23
Xof_repo_itm trg_repo = wiki.File__repo_mgr().Get_trg_by_id_or_null(cache.Orig_repo_id(), cache.Lnki_ttl(), Bry_.Empty);
if (trg_repo == null) return Io_url_.Empty;

View File

@@ -25,11 +25,15 @@ public class Fs_root_fsdb_mgr implements Xof_fsdb_mgr, GfoInvkAble { // read ima
public void Init_by_wiki(Xow_wiki wiki) {this.wiki = (Xowe_wiki)wiki;}
public void Fsdb_search_by_list(List_adp itms, Xow_wiki wiki, Xoa_page page, Xog_js_wkr js_wkr) {
int itms_len = itms.Count();
// Xou_cache_mgr cache_mgr = wiki.App().User().User_db_mgr().Cache_mgr(); // repo_id is 127; DATE:2015-08-23
for (int i = 0; i < itms_len; i++) {
Xof_fsdb_itm itm = (Xof_fsdb_itm)itms.Get_at(i);
if (fsdb_wkr.Find_file(itm))
if (fsdb_wkr.Find_file(itm)) {
Js_img_mgr.Update_img(page, js_wkr, itm);
// cache_mgr.Update(itm);
}
}
// cache_mgr.Db_save();
}
private Io_url Xto_url(byte[] v) {
if (Op_sys.Cur().Tid_is_wnt())

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.fsdb.tsts; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*; import gplx.xowa.files.fsdb.*;
import gplx.fsdb.*; import gplx.fsdb.meta.*; import gplx.dbs.*; import gplx.xowa.files.origs.*; import gplx.xowa.files.bins.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.exts.*; import gplx.xowa.files.gui.*;
import gplx.xowa.wikis.*; import gplx.xowa.files.repos.*; import gplx.xowa.wikis.data.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.files.repos.*; import gplx.xowa.wikis.data.*;
import gplx.fsdb.data.*;
class Xof_file_fxt {
private Xoae_app app; private Xof_fsdb_mgr__sql fsdb_mgr; private Xowe_wiki wiki; private Xof_orig_mgr orig_mgr;
@@ -84,10 +84,10 @@ class Xof_repo_fxt {
byte[] src_en_wiki = Bry_.new_a7("src_en_wiki");
byte[] trg_commons = Bry_.new_a7("trg_commons");
byte[] trg_en_wiki = Bry_.new_a7("trg_en_wiki");
Ini_repo_add(file_mgr, src_commons, "mem/src/commons.wikimedia.org/", Xow_domain_.Domain_str_commons, false);
Ini_repo_add(file_mgr, src_en_wiki, "mem/src/en.wikipedia.org/" , Xow_domain_.Domain_str_enwiki, false);
Ini_repo_add(file_mgr, trg_commons, "mem/root/common/", Xow_domain_.Domain_str_commons, true).Primary_(true);
Ini_repo_add(file_mgr, trg_en_wiki, "mem/root/enwiki/", Xow_domain_.Domain_str_enwiki, true).Primary_(true);
Ini_repo_add(file_mgr, src_commons, "mem/src/commons.wikimedia.org/", Xow_domain_itm_.Str__commons, false);
Ini_repo_add(file_mgr, src_en_wiki, "mem/src/en.wikipedia.org/" , Xow_domain_itm_.Str__enwiki, false);
Ini_repo_add(file_mgr, trg_commons, "mem/root/common/", Xow_domain_itm_.Str__commons, true).Primary_(true);
Ini_repo_add(file_mgr, trg_en_wiki, "mem/root/enwiki/", Xow_domain_itm_.Str__enwiki, true).Primary_(true);
Xowe_repo_mgr wiki_repo_mgr = wiki.File_mgr().Repo_mgr();
Xof_repo_pair pair = null;
pair = wiki_repo_mgr.Add_repo(src_commons, trg_commons);
@@ -136,14 +136,14 @@ class Xof_fsdb_arg {
public byte[] Bin() {return bin;} private final byte[] bin;
public DateAdp Modified() {return modified;} private final DateAdp modified = Fsd_thm_tbl.Modified_null;
public String Hash() {return hash;} private final String hash = Fsd_thm_tbl.Hash_null;
public static Xof_fsdb_arg new_comm_file(String ttl) {return new_(Xow_domain_.Domain_bry_commons, Bool_.N, ttl, Xof_img_size.Null, Xof_img_size.Null, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl) {return new_(Xow_domain_.Domain_bry_commons, Bool_.Y, ttl, W_default, H_default, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl, int w, int h) {return new_(Xow_domain_.Domain_bry_commons, Bool_.Y, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl, int w, int h, int s) {return new_(Xow_domain_.Domain_bry_commons, Bool_.Y, ttl, w, h, s);}
public static Xof_fsdb_arg new_comm_orig(String ttl, int w, int h) {return new_(Xow_domain_.Domain_bry_commons, Bool_.N, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm(boolean thumb, String ttl, int w, int h) {return new_(Xow_domain_.Domain_bry_commons, thumb, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_wiki_thumb(String ttl, int w, int h) {return new_(Xow_domain_.Domain_bry_enwiki, Bool_.Y, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_wiki_orig(String ttl, int w, int h) {return new_(Xow_domain_.Domain_bry_enwiki, Bool_.N, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_file(String ttl) {return new_(Xow_domain_itm_.Bry__commons, Bool_.N, ttl, Xof_img_size.Null, Xof_img_size.Null, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl) {return new_(Xow_domain_itm_.Bry__commons, Bool_.Y, ttl, W_default, H_default, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl, int w, int h) {return new_(Xow_domain_itm_.Bry__commons, Bool_.Y, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm_thumb(String ttl, int w, int h, int s) {return new_(Xow_domain_itm_.Bry__commons, Bool_.Y, ttl, w, h, s);}
public static Xof_fsdb_arg new_comm_orig(String ttl, int w, int h) {return new_(Xow_domain_itm_.Bry__commons, Bool_.N, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_comm(boolean thumb, String ttl, int w, int h) {return new_(Xow_domain_itm_.Bry__commons, thumb, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_wiki_thumb(String ttl, int w, int h) {return new_(Xow_domain_itm_.Bry__enwiki, Bool_.Y, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_wiki_orig(String ttl, int w, int h) {return new_(Xow_domain_itm_.Bry__enwiki, Bool_.N, ttl, w, h, Xof_lnki_time.Null_as_int);}
public static Xof_fsdb_arg new_(byte[] wiki, boolean is_thumb, String ttl_str, int w, int h, int time) {
byte[] ttl = Bry_.new_u8(ttl_str);
int ext = Xof_ext_.new_by_ttl_(ttl).Id();

View File

@@ -26,7 +26,7 @@ public class Js_img_mgr {
html_itm.Html_redlink(html_id);
}
private static void Update_img(Xoa_page page, Xog_js_wkr js_wkr, Js_img_wkr img_wkr, int uid, byte lnki_type, byte elem_tid, int html_w, int html_h, Io_url html_view_url, int orig_w, int orig_h, Io_url html_orig_url, byte[] lnki_ttl, int gallery_mgr_h) {
if (!page.Wiki().App().App_type().Uid_is_gui()) return; // do not update html widget unless app is gui; null ref on http server; DATE:2014-09-17
if (!page.Wiki().App().App_type().Uid_supports_js()) return; // do not update html widget unless app is gui; null ref on http server; DATE:2014-09-17
switch (elem_tid) {
case Xof_html_elem.Tid_gallery_v2:
img_wkr.Html_update(page, js_wkr, uid, html_w, html_h, html_view_url, orig_w, orig_h, html_orig_url, lnki_ttl);

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.repos; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.btries.*; import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*;
import gplx.xowa.wikis.*; import gplx.xowa.wikis.domains.*;
import gplx.xowa.wikis.domains.*;
public class Xof_repo_itm implements GfoInvkAble {
private final Xoa_fsys_mgr app_fsys; private final Xof_rule_mgr ext_rule_mgr; private final Bry_bfr tmp_bfr = Bry_bfr.reset_(300);
public Xof_repo_itm(byte[] key, Xoa_fsys_mgr app_fsys, Xof_rule_mgr ext_rule_mgr, byte[] wiki_domain) {
@@ -41,13 +41,13 @@ public class Xof_repo_itm implements GfoInvkAble {
public boolean Primary() {return primary;} public Xof_repo_itm Primary_(boolean v) {primary = v; return this;} private boolean primary;
public void Wiki_domain_(byte[] v) {
this.wiki_domain = v;
Xow_domain domain_itm = Xow_domain_.parse(v);
Xow_domain_itm domain_itm = Xow_domain_itm_.parse(v);
if (domain_itm == null) {
Xoa_app_.Usr_dlg().Warn_many("", "", "repo:invalid domain; raw=~{0}", v);
this.wiki_abrv_xo = Bry_.Empty;
}
else
this.wiki_abrv_xo = Xow_domain_abrv_xo_.To_bry(v, domain_itm.Lang_itm(), domain_itm.Domain_type());
this.wiki_abrv_xo = Xow_abrv_xo_.To_bry(v, domain_itm.Lang_actl_key(), domain_itm.Domain_type());
}
public Xof_repo_itm Root_str_(String root_str) {
this.wmf_fsys = String_.Has_at_bgn(root_str, "http") || String_.Has_at_bgn(root_str, "ftp");

View File

@@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.repos; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*; import gplx.xowa.wikis.*;
import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*;
import gplx.xowa.wikis.domains.*;
public class Xow_repo_mgr_ {
public static void Assert_repos(Xoae_app app, Xowe_wiki wiki) {
Xoa_repo_mgr repo_mgr = app.File_mgr().Repo_mgr();
@@ -32,7 +33,7 @@ public class Xow_repo_mgr_ {
if (pair_mgr.Repos_len() == 0) { // no pairs defined; add at least 1
Xof_repo_itm repo_src = repo_mgr.Get_by(File_repo_xowa_null);
if (repo_src == null) {
repo_itm = new Xof_repo_itm(File_repo_xowa_null, app_fsys_mgr, ext_rule_mgr, Xow_domain_type_.Key_bry_home);
repo_itm = new Xof_repo_itm(File_repo_xowa_null, app_fsys_mgr, ext_rule_mgr, Xow_domain_type_.Bry__home);
repo_mgr.Add(repo_itm);
}
pair_mgr.Add_repo(File_repo_xowa_null, domain_bry);

View File

@@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.repos; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.xowa.wikis.*; import gplx.xowa.files.xfers.*;
import gplx.xowa.files.xfers.*;
import gplx.xowa.wikis.domains.*;
public class Xowe_repo_mgr implements Xow_repo_mgr, GfoInvkAble {
private Xowe_wiki wiki; private final List_adp repos = List_adp_.new_();
public Xowe_repo_mgr(Xowe_wiki wiki) {
@@ -192,7 +193,7 @@ public class Xowe_repo_mgr implements Xow_repo_mgr, GfoInvkAble {
Xoa_repo_mgr repo_mgr = wiki.Appe().File_mgr().Repo_mgr();
Xof_repo_itm src_repo = repo_mgr.Get_by(src_repo_key), trg_repo = repo_mgr.Get_by(trg_repo_key);
byte[] src_wiki_key = src_repo.Wiki_domain(), trg_wiki_key = trg_repo.Wiki_domain();
if (!Bry_.Eq(src_wiki_key, trg_wiki_key) && !Bry_.Eq(src_wiki_key, Xow_domain_type_.Key_bry_home)) throw Err_.new_wo_type("wiki keys do not match", "src", String_.new_u8(src_wiki_key), "trg", String_.new_u8(trg_wiki_key));
if (!Bry_.Eq(src_wiki_key, trg_wiki_key) && !Bry_.Eq(src_wiki_key, Xow_domain_type_.Bry__home)) throw Err_.new_wo_type("wiki keys do not match", "src", String_.new_u8(src_wiki_key), "trg", String_.new_u8(trg_wiki_key));
Xof_repo_pair pair = new Xof_repo_pair((byte)repos.Count(), src_wiki_key, src_repo, trg_repo);
repos.Add(pair);
return pair;

View File

@@ -65,7 +65,7 @@ public class Xof_xfer_queue {
}
private void Exec_v2(Xowe_wiki wiki, Xoae_page page) {
wiki.File_mgr().Init_file_mgr_by_load(wiki);
Xog_js_wkr js_wkr = wiki.App().App_type().Uid_is_gui() ? page.Tab_data().Tab().Html_itm() : Xog_js_wkr_.Noop;
Xog_js_wkr js_wkr = wiki.App().App_type().Uid_supports_js() ? page.Tab_data().Tab().Html_itm() : Xog_js_wkr_.Noop;
wiki.File_mgr().Fsdb_mgr().Fsdb_search_by_list(Xfer_itms_to_fsdb_itms(wiki, page, xfer_list, wiki.File_mgr().Patch_upright()), wiki, page, js_wkr);
}
private List_adp Xfer_itms_to_fsdb_itms(Xowe_wiki cur_wiki, Xoae_page page, List_adp xfer_list, int upright_patch) {

View File

@@ -16,7 +16,8 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.xfers; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.ios.*; import gplx.xowa.wikis.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.repos.*;
import gplx.ios.*;
import gplx.xowa.wikis.domains.*; import gplx.xowa.files.cnvs.*; import gplx.xowa.files.repos.*;
import gplx.xowa.wmfs.apis.*; import gplx.xowa.files.exts.*; import gplx.xowa.files.imgs.*;
public class Xof_xfer_queue_base_fxt {
public Xoapi_orig_mok Api_size() {return api_size;} private Xoapi_orig_mok api_size = Xoapi_orig_mok._;
@@ -26,8 +27,8 @@ public class Xof_xfer_queue_base_fxt {
Io_mgr.I.InitEngine_mem();
if (app == null) {
app = Xoa_app_fxt.app_();
en_wiki = Xoa_app_fxt.wiki_(app, Xow_domain_.Domain_str_enwiki);
commons = Xoa_app_fxt.wiki_(app, Xow_domain_.Domain_str_commons);
en_wiki = Xoa_app_fxt.wiki_(app, Xow_domain_itm_.Str__enwiki);
commons = Xoa_app_fxt.wiki_(app, Xow_domain_itm_.Str__commons);
app.Wiki_mgr().Add(commons);
app.Wiki_mgr().Add(en_wiki);
@@ -40,10 +41,10 @@ public class Xof_xfer_queue_base_fxt {
byte[] src_en_wiki = Bry_.new_a7("src_en_wiki");
byte[] trg_commons = Bry_.new_a7("trg_commons");
byte[] trg_en_wiki = Bry_.new_a7("trg_en_wiki");
src_commons_repo = Ini_repo_add(file_mgr, src_commons, "mem/src/commons.wikimedia.org/", Xow_domain_.Domain_str_commons, false);
src_en_wiki_repo = Ini_repo_add(file_mgr, src_en_wiki, "mem/src/en.wikipedia.org/" , Xow_domain_.Domain_str_enwiki, false);
Ini_repo_add(file_mgr, trg_commons, "mem/trg/commons.wikimedia.org/", Xow_domain_.Domain_str_commons, true).Primary_(true);
Ini_repo_add(file_mgr, trg_en_wiki, "mem/trg/en.wikipedia.org/" , Xow_domain_.Domain_str_enwiki, true).Primary_(true);
src_commons_repo = Ini_repo_add(file_mgr, src_commons, "mem/src/commons.wikimedia.org/", Xow_domain_itm_.Str__commons, false);
src_en_wiki_repo = Ini_repo_add(file_mgr, src_en_wiki, "mem/src/en.wikipedia.org/" , Xow_domain_itm_.Str__enwiki, false);
Ini_repo_add(file_mgr, trg_commons, "mem/trg/commons.wikimedia.org/", Xow_domain_itm_.Str__commons, true).Primary_(true);
Ini_repo_add(file_mgr, trg_en_wiki, "mem/trg/en.wikipedia.org/" , Xow_domain_itm_.Str__enwiki, true).Primary_(true);
Xowe_repo_mgr wiki_repo_mgr = en_wiki.File_mgr().Repo_mgr();
Xof_repo_pair pair = null;
pair = wiki_repo_mgr.Add_repo(src_commons, trg_commons);

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.files.xfers; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
import gplx.core.primitives.*; import gplx.dbs.*;
import gplx.ios.*; import gplx.xowa.wikis.*; import gplx.xowa.files.*;
import gplx.ios.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.files.*;
public class Xof_xfer_queue_html_fxt extends Xof_xfer_queue_base_fxt {
private final Xof_xfer_queue queue = new Xof_xfer_queue();
@Override public void Clear(boolean src_repo_is_wmf) {
@@ -41,7 +41,7 @@ public class Xof_xfer_queue_html_fxt extends Xof_xfer_queue_base_fxt {
public Xof_xfer_queue_html_fxt Html_orig_src_(String v) {html_orig_src = v; return this;} private String html_orig_src;
public Xof_xfer_queue_html_fxt ini_page_api(String wiki_str, String ttl_str, String redirect_str, int orig_w, int orig_h) {return ini_page_api(wiki_str, ttl_str, redirect_str, orig_w, orig_h, true);}
public Xof_xfer_queue_html_fxt ini_page_api(String wiki_str, String ttl_str, String redirect_str, int orig_w, int orig_h, boolean pass) {
String wiki_key = String_.Eq(wiki_str, "commons") ? Xow_domain_.Domain_str_commons : Xow_domain_.Domain_str_enwiki;
String wiki_key = String_.Eq(wiki_str, "commons") ? Xow_domain_itm_.Str__commons : Xow_domain_itm_.Str__enwiki;
this.Api_size().Ini(wiki_key, ttl_str, redirect_str, orig_w, orig_h, pass);
return this;
}