mirror of
https://github.com/gnosygnu/xowa.git
synced 2025-05-30 14:04:56 +00:00
Wiki: Support renamed folders for non-commons images
This commit is contained in:
parent
ffc112a085
commit
906bcdc6fe
@ -78,9 +78,23 @@ public class Xow_file_mgr implements Gfo_invk {
|
||||
String cfg_domain_str = wiki.Data__core_mgr().Db__core().Tbl__cfg().Select_str("xowa.bldr.session", "wiki_domain");
|
||||
// FOLDER.RENAME: do not change to fs.dir if renamed; DATE:2017-02-06
|
||||
if (String_.Eq(cfg_domain_str, wiki.Domain_str())) {
|
||||
// wiki has not been renamed; use fs.dir
|
||||
gplx.xowa.files.fsdb.fs_roots.Fs_root_core fsdir_core = gplx.xowa.files.fsdb.fs_roots.Fs_root_core.Set_fsdb_mgr(this, this.wiki);
|
||||
fsdir_core.Orig_dir_(wiki.Fsys_mgr().Root_dir().GenSubDir_nest("file", "orig"));
|
||||
}
|
||||
else {
|
||||
// wiki has been renamed; apply "imported name" to wikis; note that this won't support renamed wikia wikis; DATE:2017-02-07
|
||||
byte[] cfg_domain_bry = Bry_.new_u8(cfg_domain_str);
|
||||
Xof_repo_pair[] repo_pairs = wiki.File__repo_mgr().Repos_ary();
|
||||
for (int i = 0; i < repo_pairs.length; i++) {
|
||||
Xof_repo_pair repo_pair = repo_pairs[i];
|
||||
if (Bry_.Eq(wiki.Domain_bry(), repo_pair.Trg().Wiki_domain())) {
|
||||
repo_pair.Wiki_domain_(cfg_domain_bry);
|
||||
repo_pair.Src().Wiki_domain_(cfg_domain_bry);
|
||||
repo_pair.Trg().Wiki_domain_(cfg_domain_bry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Cfg_set(String grp, String key, String val) { // TEST: should only be called by tests
|
||||
|
@ -21,9 +21,10 @@ public class Xof_repo_pair implements Gfo_invk {
|
||||
this.id = id; this.wiki_domain = wiki_domain; this.src = src; this.trg = trg;
|
||||
}
|
||||
public byte Id() {return id;} private byte id;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private final byte[] wiki_domain;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private byte[] wiki_domain;
|
||||
public Xof_repo_itm Src() {return src;} private final Xof_repo_itm src;
|
||||
public Xof_repo_itm Trg() {return trg;} private final Xof_repo_itm trg;
|
||||
public void Wiki_domain_(byte[] v) {wiki_domain = v;}
|
||||
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_repo_id_)) id = m.ReadByte("v");
|
||||
|
@ -1056,10 +1056,10 @@ public class Xomw_File {
|
||||
// }
|
||||
// }
|
||||
|
||||
Xomw_params_handler normalisedParams = handlerParams;
|
||||
// Xomw_params_handler normalisedParams = handlerParams;
|
||||
// handler.normaliseParams(this, normalisedParams);
|
||||
|
||||
byte[] thumbName = this.thumbName(normalisedParams);
|
||||
// byte[] thumbName = this.thumbName(normalisedParams);
|
||||
// byte[] thumbUrl = this.getThumbUrl(thumbName);
|
||||
// byte[] thumbPath = this.getThumbPath(thumbName); // final thumb path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user