mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.8.5.1'
This commit is contained in:
@@ -27,6 +27,7 @@ public interface Xof_file_itm {
|
||||
int Lnki_h();
|
||||
double Lnki_time();
|
||||
int Lnki_page();
|
||||
boolean Orig_exists();
|
||||
byte Orig_repo_id();
|
||||
byte[] Orig_repo_name();
|
||||
byte[] Orig_ttl();
|
||||
|
||||
@@ -107,6 +107,7 @@ public class Xof_fsdb_itm implements Xof_file_itm {
|
||||
this.lnki_w = lnki_w; this.lnki_h = lnki_h; this.lnki_time = lnki_time; this.lnki_page = lnki_page;
|
||||
this.orig_repo_id = orig_repo_id; this.orig_w = orig_w; this.orig_h = orig_h;
|
||||
this.file_is_orig = file_is_orig;
|
||||
this.file_w = lnki_w; // must set file_w, else fsdb_make will always download origs; DATE:2016-08-25
|
||||
this.html_w = lnki_w; this.html_h = lnki_h; // set html_size as file_size (may try to optimize later by removing similar thumbs (EX: 220,221 -> 220))
|
||||
this.Orig_ttl_(orig_ttl);
|
||||
this.orig_ext = Xof_ext_.new_by_id_(orig_ext_id); // NOTE: data in fsdb_make may override lnki_ext; EX: ttl=A.png; but ext=".jpg"
|
||||
@@ -121,6 +122,21 @@ public class Xof_fsdb_itm implements Xof_file_itm {
|
||||
this.file_exists_in_cache = file_exists_in_cache;
|
||||
this.html_w = w; this.html_h = h; this.html_view_url = view_url;
|
||||
}
|
||||
public void Init_by_wm_parse(byte[] lnki_wiki_abrv, boolean repo_is_commons, boolean file_is_orig, byte[] file_ttl_bry, int file_w, double file_time, int file_page) {
|
||||
// set lnki props that all fsdb_consumers expect
|
||||
this.lnki_ttl = file_ttl_bry;
|
||||
this.lnki_w = file_w;
|
||||
this.lnki_h = -1;
|
||||
this.lnki_type = file_is_orig ? Xop_lnki_type.Id_none : Xop_lnki_type.Id_thumb;
|
||||
this.lnki_wiki_abrv = lnki_wiki_abrv;
|
||||
|
||||
this.orig_repo_id = repo_is_commons ? Xof_repo_itm_.Repo_remote : Xof_repo_itm_.Repo_local;
|
||||
this.file_is_orig = file_is_orig;
|
||||
this.Orig_ttl_(file_ttl_bry);
|
||||
this.file_w = file_w;
|
||||
this.lnki_time = file_time;
|
||||
this.lnki_page = file_page;
|
||||
}
|
||||
public void Change_repo(byte orig_repo_id, byte[] orig_repo_name) {
|
||||
this.orig_repo_id = orig_repo_id; this.orig_repo_name = orig_repo_name;
|
||||
}
|
||||
@@ -147,7 +163,9 @@ public class Xof_fsdb_itm implements Xof_file_itm {
|
||||
file_is_orig = Bool_.Y;
|
||||
else {
|
||||
img_size.Html_size_calc(exec_tid, lnki_w, lnki_h, lnki_type, lnki_upright_patch, lnki_upright, orig_ext.Id(), orig_w, orig_h, Xof_img_size.Thumb_width_img);
|
||||
html_w = img_size.Html_w(); html_h = img_size.Html_h();
|
||||
if (lnki_type != Xop_lnki_type.Tid_orig_known) { // NOTE: hdump sets html_w / html_h; don't override; needed for packed-gallery; PAGE:en.w:Mexico; DATE:2016-08-10
|
||||
html_w = img_size.Html_w(); html_h = img_size.Html_h();
|
||||
}
|
||||
file_w = img_size.File_w();
|
||||
file_is_orig = img_size.File_is_orig();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ public class Xof_fsdb_mode {
|
||||
Xof_fsdb_mode(int tid) {this.tid = tid;}
|
||||
public boolean Tid__v2__bld() {return tid == TID__v2__bld;}
|
||||
public void Tid__v2__bld__y_() {tid = TID__v2__bld;}
|
||||
public boolean Tid__v2__mp() {return tid == TID__v2__mp;}
|
||||
public void Tid__v2__mp__y_() {tid = TID__v2__mp;}
|
||||
public boolean Tid__bld() {return tid > TID__v2__gui;}
|
||||
private static final int
|
||||
|
||||
@@ -20,19 +20,20 @@ import gplx.core.envs.*;
|
||||
import gplx.langs.htmls.encoders.*;
|
||||
import gplx.xowa.files.repos.*; import gplx.xowa.files.fsdb.*;
|
||||
public class Xof_url_bldr {
|
||||
private final Bry_bfr bfr = Bry_bfr_.Reset(400);
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(400);
|
||||
private final Gfo_url_encoder encoder_src_http = Gfo_url_encoder_.New__http_url().Make(); // NOTE: changed from new_html_href_mw_ to new_url_ on 2012-11-19; issues with A%2Cb becoming A%252Cb
|
||||
private byte[] ttl; private byte[] md5; private Xof_ext ext; private boolean file_is_thumb; private int file_w;
|
||||
private double time = Xof_lnki_time.Null; private int page = Xof_lnki_page.Null; private byte time_dlm = Byte_ascii.At;
|
||||
private byte[] root; private byte dir_spr; private boolean fsys_tid_is_wnt; private boolean wmf_dir_hive; private boolean wmf_protocol_is_file; private int md5_dir_depth; private byte[] area;
|
||||
private byte[] root; private byte dir_spr; private boolean fsys_is_wnt; private boolean wmf_dir_hive; private boolean wmf_protocol_is_file; private int md5_dir_depth; private byte[] area;
|
||||
public Xof_url_bldr Root_(byte[] v) {root = v; return this;}
|
||||
public Xof_url_bldr Init_by_root(byte[] root, byte dir_spr, boolean wmf_dir_hive, boolean wmf_protocol_is_file, int md5_dir_depth) {
|
||||
public Xof_url_bldr Init_by_root(byte[] root, boolean fsys_is_wnt, byte dir_spr, boolean wmf_dir_hive, boolean wmf_protocol_is_file, int md5_dir_depth) {
|
||||
this.root = root; this.dir_spr = dir_spr; this.wmf_dir_hive = wmf_dir_hive; this.wmf_protocol_is_file = wmf_protocol_is_file; this.md5_dir_depth = md5_dir_depth;
|
||||
this.fsys_tid_is_wnt = Op_sys.Cur().Tid_is_wnt();
|
||||
this.fsys_is_wnt = fsys_is_wnt;
|
||||
return this;
|
||||
}
|
||||
public Xof_url_bldr Init_by_itm(byte mode, byte[] ttl, byte[] md5, Xof_ext ext, int file_w, double time, int page) {
|
||||
this.ttl = ttl; this.md5 = md5; this.ext = ext; this.file_w = file_w; this.time = time; this.page = page;
|
||||
if (wmf_protocol_is_file && fsys_tid_is_wnt) this.ttl = Xof_repo_itm_.Ttl_invalid_fsys_chars(bfr, ttl); // NOTE: changed ttl does not change md5
|
||||
if (wmf_protocol_is_file && fsys_is_wnt) this.ttl = Xof_repo_itm_.Ttl_invalid_fsys_chars(tmp_bfr, ttl); // NOTE: changed ttl does not change md5
|
||||
this.file_is_thumb = mode == Xof_repo_itm_.Mode_thumb;
|
||||
this.area = Xof_repo_itm_.Mode_names_key[mode];
|
||||
return this;
|
||||
@@ -40,17 +41,17 @@ public class Xof_url_bldr {
|
||||
public Xof_url_bldr Init_for_src_file(byte mode, Xof_repo_itm repo, byte[] ttl, byte[] md5, Xof_ext ext, int file_w, double time, int page) {
|
||||
this.wmf_dir_hive = Bool_.Y; this.wmf_protocol_is_file = repo.Tarball();
|
||||
this.dir_spr = repo.Dir_spr(); this.root = repo.Root_bry(); this.area = repo.Mode_names()[mode];
|
||||
this.ttl = repo.Gen_name_src(ttl); this.md5 = md5; this.ext = ext;
|
||||
this.ttl = repo.Gen_name_src(tmp_bfr, ttl); this.md5 = md5; this.ext = ext;
|
||||
this.file_is_thumb = mode == Xof_repo_itm_.Mode_thumb; this.file_w = file_w; this.time = time; this.page = page;
|
||||
return this;
|
||||
}
|
||||
public Xof_url_bldr Init_for_trg_file(byte mode, Xof_repo_itm repo, byte[] ttl, byte[] md5, Xof_ext ext, int file_w, double time, int page) {
|
||||
return Init(Bool_.N, Bool_.N, repo.Dir_spr(), repo.Root_bry()
|
||||
, repo.Mode_names()[mode], repo.Dir_depth(), repo.Gen_name_trg(ttl, md5, ext), md5, ext, mode, file_w, time, page);
|
||||
, repo.Mode_names()[mode], repo.Dir_depth(), repo.Gen_name_trg(tmp_bfr, ttl, md5, ext), md5, ext, mode, file_w, time, page);
|
||||
}
|
||||
public Xof_url_bldr Init_for_trg_html(byte mode, Xof_repo_itm repo, byte[] ttl, byte[] md5, Xof_ext ext, int file_w, double time, int page) {
|
||||
return Init(Bool_.N, Bool_.N, Byte_ascii.Slash, repo.Root_http()
|
||||
, repo.Mode_names()[mode], repo.Dir_depth(), repo.Gen_name_trg(ttl, md5, ext), md5, ext, mode, file_w, time, page);
|
||||
, repo.Mode_names()[mode], repo.Dir_depth(), repo.Gen_name_trg(tmp_bfr, ttl, md5, ext), md5, ext, mode, file_w, time, page);
|
||||
}
|
||||
private Xof_url_bldr Init(boolean wmf_dir_hive, boolean wmf_protocol_is_file, byte dir_spr
|
||||
, byte[] root, byte[] area, int md5_dir_depth
|
||||
@@ -63,20 +64,20 @@ public class Xof_url_bldr {
|
||||
this.file_is_thumb = file_mode == Xof_repo_itm_.Mode_thumb; this.file_w = file_w; this.time = time; this.page = page;
|
||||
return this;
|
||||
}
|
||||
public byte[] Xto_bry() {Bld(); byte[] rv = bfr.To_bry_and_clear(); Clear(); return rv;}
|
||||
public String Xto_str() {Bld(); String rv = bfr.To_str(); Clear(); return rv;}
|
||||
public Io_url Xto_url() {Bld(); Io_url rv = Io_url_.new_fil_(bfr.To_str()); Clear(); return rv;}
|
||||
public byte[] Xto_bry() {Bld(); byte[] rv = tmp_bfr.To_bry_and_clear(); Clear(); return rv;}
|
||||
public String Xto_str() {Bld(); String rv = tmp_bfr.To_str(); Clear(); return rv;}
|
||||
public Io_url Xto_url() {Bld(); Io_url rv = Io_url_.new_fil_(tmp_bfr.To_str()); Clear(); return rv;}
|
||||
public Io_url To_url_trg(Xof_repo_itm repo_itm, Xof_fsdb_itm itm, boolean orig) {
|
||||
byte mode = orig ? Xof_repo_itm_.Mode_orig : Xof_repo_itm_.Mode_thumb;
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), itm.Html_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
}
|
||||
public Io_url To_url_trg(Xof_repo_itm repo_itm, gplx.xowa.files.caches.Xou_cache_itm itm, boolean orig) {
|
||||
byte mode = orig ? Xof_repo_itm_.Mode_orig : Xof_repo_itm_.Mode_thumb;
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext_itm(), itm.Html_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), itm.File_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
}
|
||||
public Io_url To_url_trg(Xof_repo_itm repo_itm, Xof_file_itm itm, boolean orig) {
|
||||
byte mode = orig ? Xof_repo_itm_.Mode_orig : Xof_repo_itm_.Mode_thumb;
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), itm.Html_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext(), itm.File_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
}
|
||||
public Io_url To_url_trg(Xof_repo_itm repo_itm, gplx.xowa.files.caches.Xou_cache_itm itm, boolean orig) {
|
||||
byte mode = orig ? Xof_repo_itm_.Mode_orig : Xof_repo_itm_.Mode_thumb;
|
||||
return this.Init_for_trg_file(mode, repo_itm, itm.Orig_ttl(), itm.Orig_ttl_md5(), itm.Orig_ext_itm(), itm.File_w(), itm.Lnki_time(), itm.Lnki_page()).Xto_url();
|
||||
}
|
||||
private void Bld() {
|
||||
Add_core();
|
||||
@@ -86,85 +87,85 @@ public class Xof_url_bldr {
|
||||
}
|
||||
}
|
||||
private Xof_url_bldr Add_core() {
|
||||
bfr.Add(root); // add root; EX: "C:\xowa\file\"; assume trailing dir_spr
|
||||
tmp_bfr.Add(root); // add root; EX: "C:\xowa\file\"; assume trailing dir_spr
|
||||
if (area != null && !(wmf_dir_hive && !file_is_thumb)) // !(wmf_dir_hive && !thumb) means never add if wmf_dir_hive and orig
|
||||
bfr.Add(area).Add_byte(dir_spr); // add area; EX: "thumb\"
|
||||
tmp_bfr.Add(area).Add_byte(dir_spr); // add area; EX: "thumb\"
|
||||
byte b0 = md5[0];
|
||||
if (wmf_dir_hive) {
|
||||
bfr.Add_byte(b0).Add_byte(dir_spr); // add md5_0 EX: "0/"
|
||||
bfr.Add_byte(b0).Add_byte(md5[1]).Add_byte(dir_spr); // add md5_01 EX: "01/"
|
||||
tmp_bfr.Add_byte(b0).Add_byte(dir_spr); // add md5_0 EX: "0/"
|
||||
tmp_bfr.Add_byte(b0).Add_byte(md5[1]).Add_byte(dir_spr); // add md5_01 EX: "01/"
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < md5_dir_depth; i++)
|
||||
bfr.Add_byte(md5[i]).Add_byte(dir_spr); // add md5_0123 EX: "0/1/2/3"
|
||||
tmp_bfr.Add_byte(md5[i]).Add_byte(dir_spr); // add md5_0123 EX: "0/1/2/3"
|
||||
}
|
||||
if (wmf_dir_hive) {
|
||||
if (wmf_protocol_is_file) // sitting on local file system (as opposed to http)
|
||||
bfr.Add(ttl); // NOTE: file_names are not url-encoded; this includes symbols (') and foreign characters (ö)
|
||||
tmp_bfr.Add(ttl); // NOTE: file_names are not url-encoded; this includes symbols (') and foreign characters (ö)
|
||||
else // wmf_http
|
||||
bfr.Add(encoder_src_http.Encode(ttl)); // NOTE: file_names must be url-encoded; JAVA will default to native charset which on Windows will be 1252; foreign character urls will fail due to conversion mismatch (1252 on windows; UTF-8 on WMF); PAGE:en.w:Möbius strip
|
||||
tmp_bfr.Add(encoder_src_http.Encode(ttl)); // NOTE: file_names must be url-encoded; JAVA will default to native charset which on Windows will be 1252; foreign character urls will fail due to conversion mismatch (1252 on windows; UTF-8 on WMF); PAGE:en.w:Möbius strip
|
||||
}
|
||||
else
|
||||
bfr.Add(ttl); // add title; EX: "A.png"
|
||||
tmp_bfr.Add(ttl); // add title; EX: "A.png"
|
||||
return this;
|
||||
}
|
||||
private Xof_url_bldr Add_thumb_xowa() {
|
||||
bfr.Add_byte(dir_spr); // add dir_spr; EX: "\"
|
||||
bfr.Add_int_variable(file_w).Add(Bry_px); // add file_w; EX: "220px"
|
||||
tmp_bfr.Add_byte(dir_spr); // add dir_spr; EX: "\"
|
||||
tmp_bfr.Add_int_variable(file_w).Add(Bry_px); // add file_w; EX: "220px"
|
||||
if (Xof_lnki_time.Null_n(time))
|
||||
bfr.Add_byte(time_dlm).Add_str_a7(Xof_lnki_time.X_str(time)); // add time EX: "@5"
|
||||
tmp_bfr.Add_byte(time_dlm).Add_str_a7(Xof_lnki_time.X_str(time)); // add time EX: "@5"
|
||||
else if (page != Xof_lnki_page.Null)
|
||||
bfr.Add_byte(Byte_ascii.Dash).Add_int_variable(page); // add page EX: "-5"
|
||||
bfr.Add_byte(Byte_ascii.Dot); // add . EX: "."
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dash).Add_int_variable(page); // add page EX: "-5"
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dot); // add . EX: "."
|
||||
if (file_is_thumb)
|
||||
bfr.Add(ext.Ext_view()); // add view_ext EX: ".png"
|
||||
tmp_bfr.Add(ext.Ext_view()); // add view_ext EX: ".png"
|
||||
else
|
||||
bfr.Add(ext.Ext()); // add orig_ext EX: ".svg"
|
||||
tmp_bfr.Add(ext.Ext()); // add orig_ext EX: ".svg"
|
||||
return this;
|
||||
}
|
||||
private Xof_url_bldr Add_thumb_wmf() {
|
||||
bfr.Add_byte(dir_spr); // add dir_spr; EX: "\"
|
||||
tmp_bfr.Add_byte(dir_spr); // add dir_spr; EX: "\"
|
||||
int file_ext_id = ext.Id();
|
||||
switch (file_ext_id) {
|
||||
case Xof_ext_.Id_ogg:
|
||||
case Xof_ext_.Id_ogv:
|
||||
case Xof_ext_.Id_webm:
|
||||
bfr.Add_int_variable(file_w); // add file_w; EX: "220"; PAGE:en.w:Alice_Brady; DATE:2015-08-06
|
||||
bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
tmp_bfr.Add_int_variable(file_w); // add file_w; EX: "220"; PAGE:en.w:Alice_Brady; DATE:2015-08-06
|
||||
tmp_bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
if (Xof_lnki_time.Null_n(time))
|
||||
bfr.Add(Bry_seek).Add_str_a7(Xof_lnki_time.X_str(time)).Add_byte(Byte_ascii.Dash);// add seek; EX: "seek%3D5-"
|
||||
tmp_bfr.Add(Bry_seek).Add_str_a7(Xof_lnki_time.X_str(time)).Add_byte(Byte_ascii.Dash);// add seek; EX: "seek%3D5-"
|
||||
else
|
||||
bfr.Add_byte(Byte_ascii.Dash); // add mid; EX: "-"; NOTE: was "mid-"; DATE:2015-08-06
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dash); // add mid; EX: "-"; NOTE: was "mid-"; DATE:2015-08-06
|
||||
break;
|
||||
case Xof_ext_.Id_tif:
|
||||
case Xof_ext_.Id_tiff:
|
||||
Add_thumb_wmf_page(Bry_lossy_page1, Bry_lossy_page);
|
||||
bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
tmp_bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
tmp_bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
break;
|
||||
case Xof_ext_.Id_pdf:
|
||||
case Xof_ext_.Id_djvu:
|
||||
Add_thumb_wmf_page(Bry_page1, Bry_page);
|
||||
bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
tmp_bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
tmp_bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
break;
|
||||
default:
|
||||
bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
tmp_bfr.Add_int_variable(file_w); // add file_w; EX: "220"
|
||||
tmp_bfr.Add(Bry_px_dash); // add px; EX: "px-"
|
||||
break;
|
||||
}
|
||||
int ttl_len = ttl.length;
|
||||
if (ttl_len > 160) { // long file name
|
||||
bfr.Add(Bry_thumnbail_w_dot);
|
||||
bfr.Add(ext.Ext());
|
||||
tmp_bfr.Add(Bry_thumnbail_w_dot);
|
||||
tmp_bfr.Add(ext.Ext());
|
||||
}
|
||||
else
|
||||
bfr.Add(encoder_src_http.Encode(ttl)); // add ttl again; EX: "A.png"
|
||||
tmp_bfr.Add(encoder_src_http.Encode(ttl)); // add ttl again; EX: "A.png"
|
||||
switch (file_ext_id) {
|
||||
case Xof_ext_.Id_svg:
|
||||
case Xof_ext_.Id_bmp:
|
||||
case Xof_ext_.Id_xcf:
|
||||
bfr.Add_byte(Byte_ascii.Dot).Add(Xof_ext_.Bry_png); // add .png; EX: "A.svg" -> "A.svg.png" NOTE: MediaWiki always adds as lowercase
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dot).Add(Xof_ext_.Bry_png); // add .png; EX: "A.svg" -> "A.svg.png" NOTE: MediaWiki always adds as lowercase
|
||||
break;
|
||||
case Xof_ext_.Id_pdf:
|
||||
case Xof_ext_.Id_tif: // add .jpg EX: "A.tif" -> "A.tif.jpg" NOTE: MediaWiki always adds as lowercase
|
||||
@@ -173,18 +174,18 @@ public class Xof_url_bldr {
|
||||
case Xof_ext_.Id_ogv:
|
||||
case Xof_ext_.Id_djvu:
|
||||
case Xof_ext_.Id_webm:
|
||||
bfr.Add_byte(Byte_ascii.Dot).Add(Xof_ext_.Bry_jpg);
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dot).Add(Xof_ext_.Bry_jpg);
|
||||
break;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private void Add_thumb_wmf_page(byte[] bry_page_1, byte[] bry_page) {
|
||||
if (Xof_lnki_time.Null_y(page))
|
||||
bfr.Add(bry_page_1); // add "lossy-page1-" EX: "lossy-page1-"
|
||||
tmp_bfr.Add(bry_page_1); // add "lossy-page1-" EX: "lossy-page1-"
|
||||
else {
|
||||
bfr.Add(bry_page); // add "lossy-page" EX: "lossy-page"
|
||||
bfr.Add_int_variable(page); // add page EX: 123
|
||||
bfr.Add_byte(Byte_ascii.Dash); // add - EX: "-"
|
||||
tmp_bfr.Add(bry_page); // add "lossy-page" EX: "lossy-page"
|
||||
tmp_bfr.Add_int_variable(page); // add page EX: 123
|
||||
tmp_bfr.Add_byte(Byte_ascii.Dash); // add - EX: "-"
|
||||
}
|
||||
}
|
||||
private Xof_url_bldr Clear() {
|
||||
@@ -192,7 +193,7 @@ public class Xof_url_bldr {
|
||||
file_w = Xof_img_size.Null;
|
||||
time = Xof_lnki_time.Null;
|
||||
ext = null;
|
||||
bfr.Clear();
|
||||
tmp_bfr.Clear();
|
||||
return this;
|
||||
}
|
||||
public static final byte[]
|
||||
@@ -204,8 +205,6 @@ public class Xof_url_bldr {
|
||||
private static final byte[]
|
||||
Bry_lossy_page = Bry_.new_a7("lossy-page"), Bry_page = Bry_.new_a7("page")
|
||||
, Bry_lossy_page1 = Bry_.new_a7("lossy-page1-"), Bry_page1 = Bry_.new_a7("page1-"), Bry_seek = Bry_.new_a7("seek%3D");
|
||||
public static final Xof_url_bldr Temp = new Xof_url_bldr();
|
||||
private static final Gfo_url_encoder encoder_src_http = Gfo_url_encoder_.Http_url; // NOTE: changed from new_html_href_mw_ to new_url_ on 2012-11-19; issues with A%2Cb becoming A%252Cb
|
||||
public static Xof_url_bldr new_v2() {
|
||||
Xof_url_bldr rv = new Xof_url_bldr();
|
||||
rv.time_dlm = Byte_ascii.Dash;
|
||||
|
||||
@@ -55,7 +55,7 @@ class Xof_url_bldr_fxt {
|
||||
public Xof_url_bldr_fxt Seek_(int v) {seek = v; return this;} private double seek = Xof_lnki_time.Null;
|
||||
public Xof_url_bldr_fxt Expd_src_(String v) {expd_src = v; return this;} private String expd_src;
|
||||
public Xof_url_bldr_fxt Test() {
|
||||
url_bldr.Init_by_root(Bry_.new_u8(root), dir_spr, Bool_.Y, Bool_.N, 2);
|
||||
url_bldr.Init_by_root(Bry_.new_u8(root), Bool_.N, dir_spr, Bool_.Y, Bool_.N, 2);
|
||||
url_bldr.Init_by_itm (Xof_repo_itm_.Mode_thumb, Bry_.new_u8(ttl), Bry_.new_u8(md5), ext, w, seek, page);
|
||||
Tfds.Eq(expd_src, url_bldr.Xto_str());
|
||||
return this;
|
||||
|
||||
@@ -21,6 +21,7 @@ import gplx.xowa.guis.cbks.js.*; import gplx.xowa.files.repos.*;
|
||||
import gplx.xowa.wikis.tdbs.metas.*;
|
||||
import gplx.xowa.parsers.utils.*;
|
||||
public class Xof_xfer_itm implements Xof_file_itm {
|
||||
private Xof_url_bldr tmp_url_bldr = dflt_url_bldr;
|
||||
public Xof_xfer_itm() {
|
||||
lnki_type = orig_repo_id = Byte_.Max_value_127;
|
||||
lnki_w = lnki_h = file_w = orig_w = orig_h = html_w = html_h = html_gallery_mgr_h = Int_.Neg1;
|
||||
@@ -42,6 +43,7 @@ public class Xof_xfer_itm implements Xof_file_itm {
|
||||
public int Lnki_h() {return lnki_h;} private int lnki_h;
|
||||
public double Lnki_time() {return lnki_time;} private double lnki_time;
|
||||
public int Lnki_page() {return lnki_page;} private int lnki_page;
|
||||
public boolean Orig_exists() {return orig_exists;} private boolean orig_exists;
|
||||
public byte Orig_repo_id() {return orig_repo_id;} private byte orig_repo_id;
|
||||
public byte[] Orig_repo_name() {return orig_repo_name;} private byte[] orig_repo_name;
|
||||
public byte[] Orig_ttl() {return orig_ttl;} private byte[] orig_ttl;
|
||||
@@ -91,6 +93,7 @@ public class Xof_xfer_itm implements Xof_file_itm {
|
||||
else
|
||||
this.Orig_ttl_(orig_ttl);
|
||||
this.orig_ext = orig_ext; // overwrite ext with whatever's in file_orig; needed for ogg -> oga / ogv
|
||||
this.orig_exists = true;
|
||||
}
|
||||
public void Init_at_gallery_bgn(int html_w, int html_h, int file_w) {
|
||||
this.html_w = html_w; this.html_h = html_h;
|
||||
@@ -127,8 +130,6 @@ public class Xof_xfer_itm implements Xof_file_itm {
|
||||
trg_repo_root = trg_repo_itm == null ? Bry_.Empty : trg_repo_itm.Root_http();
|
||||
} private Xof_repo_itm trg_repo_itm;
|
||||
public byte[] Trg_repo_root() {return trg_repo_root;} private byte[] trg_repo_root = Bry_.Empty; // HACK: needed for hdump
|
||||
public Xof_url_bldr Url_bldr(){ return url_bldr;}
|
||||
public void Url_bldr_(Xof_url_bldr v) {url_bldr = v;} private Xof_url_bldr url_bldr = Xof_url_bldr.Temp;
|
||||
public void Ctor_for_html(int exec_tid, int lnki_upright_patch, Xof_img_size img_size, Xof_repo_itm repo, Xof_url_bldr url_bldr) {
|
||||
Calc_html_size(exec_tid, lnki_upright_patch, img_size);
|
||||
this.html_view_url = url_bldr.To_url_trg(repo, this, file_is_orig);
|
||||
@@ -179,8 +180,8 @@ public class Xof_xfer_itm implements Xof_file_itm {
|
||||
file_is_orig = img_size.File_is_orig();
|
||||
}
|
||||
}
|
||||
private Io_url Trg_view_url(byte mode_id, int width) {return url_bldr.Init_for_trg_file(mode_id, trg_repo_itm, lnki_ttl, orig_ttl_md5, orig_ext, width, lnki_time, lnki_page).Xto_url();}
|
||||
public Io_url Trg_orig_url(byte mode_id, int width) {return url_bldr.Init_for_trg_file(mode_id, trg_repo_itm, lnki_ttl, orig_ttl_md5, orig_ext, width, lnki_time, lnki_page).Xto_url();}
|
||||
private Io_url Trg_view_url(byte mode_id, int width) {return tmp_url_bldr.Init_for_trg_file(mode_id, trg_repo_itm, lnki_ttl, orig_ttl_md5, orig_ext, width, lnki_time, lnki_page).Xto_url();}
|
||||
public Io_url Trg_orig_url(byte mode_id, int width) {return tmp_url_bldr.Init_for_trg_file(mode_id, trg_repo_itm, lnki_ttl, orig_ttl_md5, orig_ext, width, lnki_time, lnki_page).Xto_url();}
|
||||
public boolean Calc_by_meta() {return Calc_by_meta(false);}
|
||||
public boolean Calc_by_meta(boolean caller_is_file_page) {
|
||||
file_exists = false;
|
||||
@@ -285,6 +286,7 @@ public class Xof_xfer_itm implements Xof_file_itm {
|
||||
file_exists = true;
|
||||
return true;
|
||||
}
|
||||
private static final Xof_url_bldr dflt_url_bldr = new Xof_url_bldr(); // NOTE: only used by v1
|
||||
}
|
||||
/*
|
||||
NOTE_1:Lnki_thumbable
|
||||
|
||||
@@ -125,7 +125,7 @@ public class Xof_bin_mgr {
|
||||
fsdb.Html_view_url_(trg);
|
||||
for (int i = 0; i < wkrs_len; i++) {
|
||||
Xof_bin_wkr wkr = wkrs[i];
|
||||
boolean found = Get_bin(Bool_.N, fsdb.Html_w(), trg, save_to_fsys, rdr_wrapper, fsdb, wkr);
|
||||
boolean found = Get_bin(Bool_.N, fsdb.File_w(), trg, save_to_fsys, rdr_wrapper, fsdb, wkr); // NOTE: must use File_w, not Html_w; else missing images in packed gallery in hdump; PAGE:en.w:France; DATE:2016-08-22
|
||||
if (found) // orig found; return it;
|
||||
return Set_found(save_to_fsys, fsdb, trg, rdr_wrapper);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class Xof_bin_mgr {
|
||||
fsdb.Html_view_url_(trg);
|
||||
for (int i = 0; i < wkrs_len; i++) {
|
||||
Xof_bin_wkr wkr = wkrs[i];
|
||||
boolean found = Get_bin(Bool_.Y, fsdb.Html_w(), trg, save_to_fsys, rdr_wrapper, fsdb, wkr);
|
||||
boolean found = Get_bin(Bool_.Y, fsdb.File_w(), trg, save_to_fsys, rdr_wrapper, fsdb, wkr); // NOTE: must use File_w, not Html_w; else missing images in packed gallery in hdump; PAGE:en.w:France; DATE:2016-08-22
|
||||
if (found) // thumb found; return it;
|
||||
return Set_found(save_to_fsys, fsdb, trg, rdr_wrapper);
|
||||
if (fsdb.Orig_ext().Id_is_video()) continue; // item is video; don't download orig as imageMagick can't thumbnail it; DATE:2015-06-16
|
||||
|
||||
@@ -56,13 +56,13 @@ class Xof_bin_wkr__fsys_wmf extends Xof_bin_wkr__fsys_wmf_base {
|
||||
@Override public byte Tid() {return Xof_bin_wkr_.Tid_fsys_wmf;}
|
||||
@Override public String Key() {return Xof_bin_wkr_.Key_fsys_wmf;}
|
||||
@Override public void Init_by_root() {
|
||||
this.Url_bldr().Init_by_root(Bry_.Empty, Op_sys.Cur().Fsys_dir_spr_byte(), Bool_.Y, Bool_.Y, Xof_repo_itm_.Dir_depth_wmf);
|
||||
this.Url_bldr().Init_by_root(Bry_.Empty, Op_sys.Cur().Tid_is_wnt(), Op_sys.Cur().Fsys_dir_spr_byte(), Bool_.Y, Bool_.Y, Xof_repo_itm_.Dir_depth_wmf);
|
||||
}
|
||||
}
|
||||
class Xof_bin_wkr__fsys_xowa extends Xof_bin_wkr__fsys_wmf_base {
|
||||
@Override public byte Tid() {return Xof_bin_wkr_.Tid_fsys_xowa;}
|
||||
@Override public String Key() {return Xof_bin_wkr_.Key_fsys_xowa;}
|
||||
@Override public void Init_by_root() {
|
||||
this.Url_bldr().Init_by_root(Bry_.Empty, Op_sys.Cur().Fsys_dir_spr_byte(), Bool_.N, Bool_.N, Xof_repo_itm_.Dir_depth_xowa);
|
||||
this.Url_bldr().Init_by_root(Bry_.Empty, Op_sys.Cur().Tid_is_wnt(), Op_sys.Cur().Fsys_dir_spr_byte(), Bool_.N, Bool_.N, Xof_repo_itm_.Dir_depth_xowa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.core.primitives.*; import gplx.dbs.*; import gplx.dbs.cfgs.*;
|
||||
import gplx.xowa.files.fsdb.*; import gplx.xowa.files.repos.*;
|
||||
import gplx.xowa.wikis.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.users.data.*;
|
||||
public class Xou_cache_mgr {
|
||||
private final Xoa_wiki_mgr wiki_mgr; private final Xou_cache_tbl cache_tbl; private final Db_cfg_tbl cfg_tbl; private final Bry_bfr key_bfr = Bry_bfr_.Reset(512);
|
||||
private final Xoa_wiki_mgr wiki_mgr; private final Xou_cache_tbl cache_tbl; private final Db_cfg_tbl cfg_tbl; private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(512);
|
||||
private final Ordered_hash hash = Ordered_hash_.New_bry(); private final Xof_url_bldr url_bldr = Xof_url_bldr.new_v2(); private final Object thread_lock = new Object();
|
||||
private final Io_url cache_dir; private boolean db_load_needed = true;
|
||||
public Xou_cache_mgr(Xoa_wiki_mgr wiki_mgr, Io_url cache_dir, Xou_db_file db_file) {
|
||||
@@ -54,7 +54,7 @@ public class Xou_cache_mgr {
|
||||
if (!enabled) return null;
|
||||
synchronized (thread_lock) {
|
||||
this.Page_bgn();
|
||||
byte[] key = Xou_cache_itm.Key_gen(key_bfr, wiki, ttl, type, upright, w, h, time, page, user_thumb_w);
|
||||
byte[] key = Xou_cache_itm.Key_gen(tmp_bfr, wiki, ttl, type, upright, w, h, time, page, user_thumb_w);
|
||||
Xou_cache_itm rv = (Xou_cache_itm)hash.Get_by(key);
|
||||
if (rv == Xou_cache_itm.Null) {
|
||||
rv = cache_tbl.Select_one(wiki, ttl, type, upright, w, h, time, page, user_thumb_w);
|
||||
@@ -68,7 +68,7 @@ public class Xou_cache_mgr {
|
||||
synchronized (thread_lock) {
|
||||
Xou_cache_itm itm = Get_or_null(fsdb.Lnki_wiki_abrv(), fsdb.Lnki_ttl(), fsdb.Lnki_type(), fsdb.Lnki_upright(), fsdb.Lnki_w(), fsdb.Lnki_h(), fsdb.Lnki_time(), fsdb.Lnki_page(), fsdb.User_thumb_w());
|
||||
if (itm == Xou_cache_itm.Null) {
|
||||
itm = new Xou_cache_itm(key_bfr, Db_cmd_mode.Tid_create, fsdb.Lnki_wiki_abrv(), fsdb.Lnki_ttl(), fsdb.Lnki_type(), fsdb.Lnki_upright(), fsdb.Lnki_w(), fsdb.Lnki_h(), fsdb.Lnki_time(), fsdb.Lnki_page(), fsdb.User_thumb_w()
|
||||
itm = new Xou_cache_itm(tmp_bfr, Db_cmd_mode.Tid_create, fsdb.Lnki_wiki_abrv(), fsdb.Lnki_ttl(), fsdb.Lnki_type(), fsdb.Lnki_upright(), fsdb.Lnki_w(), fsdb.Lnki_h(), fsdb.Lnki_time(), fsdb.Lnki_page(), fsdb.User_thumb_w()
|
||||
, fsdb.Orig_repo_id(), fsdb.Orig_ttl(), fsdb.Orig_ext().Id(), fsdb.Orig_w(), fsdb.Orig_h()
|
||||
, fsdb.Html_w(), fsdb.Html_h(), fsdb.Lnki_time(), fsdb.Lnki_page()
|
||||
, fsdb.File_is_orig(), fsdb.File_w(), fsdb.Lnki_time(), fsdb.Lnki_page(), fsdb.File_size()
|
||||
@@ -85,7 +85,7 @@ public class Xou_cache_mgr {
|
||||
if (db_load_needed) {
|
||||
db_load_needed = false;
|
||||
fsys_size_cur = cfg_tbl.Assert_long("user.file_cache", "size_sum", 0);
|
||||
cache_tbl.Select_all(key_bfr, hash);
|
||||
cache_tbl.Select_all(tmp_bfr, hash);
|
||||
}
|
||||
}
|
||||
public void Page_end(Xoa_wiki_mgr wiki_mgr) { // threaded
|
||||
@@ -117,7 +117,7 @@ public class Xou_cache_mgr {
|
||||
Xoa_app_.Usr_dlg().Note_many("", "", "cache compress started");
|
||||
synchronized (thread_lock) {
|
||||
try {
|
||||
this.Db_save(); cache_tbl.Select_all(key_bfr, hash); // save and load
|
||||
this.Db_save(); cache_tbl.Select_all(tmp_bfr, hash); // save and load
|
||||
Ordered_hash grp_hash = Ordered_hash_.New(); // aggregate by file path; needed when same commons file used by two wikis
|
||||
int len = hash.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
@@ -168,7 +168,7 @@ public class Xou_cache_mgr {
|
||||
byte[] orig_ttl = cache.Orig_ttl();
|
||||
byte[] orig_md5 = cache.Orig_ttl_md5();
|
||||
Xof_ext orig_ext = cache.Orig_ext_itm();
|
||||
orig_ttl = trg_repo.Gen_name_trg(orig_ttl, orig_md5, orig_ext);
|
||||
orig_ttl = trg_repo.Gen_name_trg(tmp_bfr, orig_ttl, orig_md5, orig_ext);
|
||||
byte mode_id = cache.File_is_orig() ? Xof_repo_itm_.Mode_orig : Xof_repo_itm_.Mode_thumb;
|
||||
return url_bldr.Init_for_trg_file(mode_id, trg_repo, orig_ttl, orig_md5, orig_ext, cache.File_w()
|
||||
, Xof_lnki_time.Convert_to_xowa_thumbtime (orig_ext.Id(), cache.File_time())
|
||||
|
||||
@@ -20,27 +20,29 @@ import gplx.core.btries.*; import gplx.core.consoles.*;
|
||||
import gplx.xowa.apps.fsys.*; import gplx.xowa.files.exts.*;
|
||||
import gplx.xowa.wikis.domains.*;
|
||||
public class Xof_repo_itm implements Gfo_invk {
|
||||
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);
|
||||
private final Xoa_fsys_mgr app_fsys; private final Xof_rule_mgr ext_rule_mgr;
|
||||
public Xof_repo_itm(byte[] key, Xoa_fsys_mgr app_fsys, Xof_rule_mgr ext_rule_mgr, byte[] wiki_domain) {
|
||||
this.key = key; this.app_fsys = app_fsys; this.ext_rule_mgr = ext_rule_mgr;
|
||||
Wiki_domain_(wiki_domain);
|
||||
}
|
||||
public byte[] Key() {return key;} private final byte[] key;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private byte[] wiki_domain;
|
||||
public byte[] Wiki_abrv_xo() {return wiki_abrv_xo;} private byte[] wiki_abrv_xo;
|
||||
public byte[] Root_bry() {return root_bry;} private byte[] root_bry;
|
||||
public byte[] Root_http() {return root_http;} private byte[] root_http = Bry_.Empty;
|
||||
public byte Dir_spr() {return dir_spr;} private byte dir_spr;
|
||||
public boolean Fsys_is_wnt() {return fsys_is_wnt;} public Xof_repo_itm Fsys_is_wnt_(boolean v) {fsys_is_wnt = v; return this;} private boolean fsys_is_wnt;
|
||||
public boolean Wmf_fsys() {return wmf_fsys;} public Xof_repo_itm Wmf_fsys_(boolean v) {wmf_fsys = v; return this;} private boolean wmf_fsys;
|
||||
public boolean Wmf_api() {return wmf_api;} public Xof_repo_itm Wmf_api_(boolean v) {wmf_api = v; return this;} private boolean wmf_api;
|
||||
public boolean Tarball() {return tarball;} public Xof_repo_itm Tarball_(boolean v) {tarball = v; return this;} private boolean tarball;
|
||||
public byte[][] Mode_names() {return mode_names;} private byte[][] mode_names = new byte[][] {Xof_repo_itm_.Mode_names_key[0], Xof_repo_itm_.Mode_names_key[1]};
|
||||
public int Dir_depth() {return dir_depth;} public Xof_repo_itm Dir_depth_(int v) {dir_depth = v; return this;} private int dir_depth = 4;
|
||||
public Xof_rule_grp Ext_rules() {return ext_rules;} private Xof_rule_grp ext_rules;
|
||||
public Xof_repo_itm Ext_rules_(byte[] ext_rules_key) {ext_rules = ext_rule_mgr.Get_or_new(ext_rules_key); return this;}
|
||||
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) {
|
||||
public byte[] Key() {return key;} private final byte[] key;
|
||||
public byte[] Wiki_domain() {return wiki_domain;} private byte[] wiki_domain;
|
||||
public byte[] Wiki_abrv_xo() {return wiki_abrv_xo;} private byte[] wiki_abrv_xo;
|
||||
public byte[] Root_bry() {return root_bry;} private byte[] root_bry;
|
||||
public byte[] Root_http() {return root_http;} private byte[] root_http = Bry_.Empty;
|
||||
public String Root_str() {return root_str;} private String root_str;
|
||||
public byte Dir_spr() {return dir_spr;} private byte dir_spr;
|
||||
public boolean Fsys_is_wnt() {return fsys_is_wnt;} public Xof_repo_itm Fsys_is_wnt_(boolean v) {fsys_is_wnt = v; return this;} private boolean fsys_is_wnt;
|
||||
public boolean Shorten_ttl() {return shorten_ttl;} public Xof_repo_itm Shorten_ttl_(boolean v) {shorten_ttl = v; return this;} private boolean shorten_ttl = true;
|
||||
public boolean Wmf_fsys() {return wmf_fsys;} public Xof_repo_itm Wmf_fsys_(boolean v) {wmf_fsys = v; return this;} private boolean wmf_fsys;
|
||||
public boolean Wmf_api() {return wmf_api;} public Xof_repo_itm Wmf_api_(boolean v) {wmf_api = v; return this;} private boolean wmf_api;
|
||||
public boolean Tarball() {return tarball;} public Xof_repo_itm Tarball_(boolean v) {tarball = v; return this;} private boolean tarball;
|
||||
public byte[][] Mode_names() {return mode_names;} private byte[][] mode_names = new byte[][] {Xof_repo_itm_.Mode_names_key[0], Xof_repo_itm_.Mode_names_key[1]};
|
||||
public int Dir_depth() {return dir_depth;} public Xof_repo_itm Dir_depth_(int v) {dir_depth = v; return this;} private int dir_depth = 4;
|
||||
public Xof_rule_grp Ext_rules() {return ext_rules;} private Xof_rule_grp ext_rules;
|
||||
public Xof_repo_itm Ext_rules_(byte[] ext_rules_key) {ext_rules = ext_rule_mgr.Get_or_new(ext_rules_key); return this;}
|
||||
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_itm domain_itm = Xow_domain_itm_.parse(v);
|
||||
if (domain_itm == null) {
|
||||
@@ -63,15 +65,16 @@ public class Xof_repo_itm implements Gfo_invk {
|
||||
this.dir_spr = root_url.Info().DirSpr_byte();
|
||||
this.root_http = root_url.To_http_file_bry();
|
||||
}
|
||||
this.root_str = root_str;
|
||||
return this;
|
||||
}
|
||||
public byte[] Gen_name_src(byte[] name) {
|
||||
public byte[] Gen_name_src(Bry_bfr tmp_bfr, byte[] name) {
|
||||
if (!fsys_is_wnt || wmf_fsys) return name;
|
||||
return Xof_repo_itm_.Ttl_invalid_fsys_chars(tmp_bfr, name);
|
||||
}
|
||||
public byte[] Gen_name_trg(byte[] bry, byte[] md5, Xof_ext ext) {
|
||||
byte[] rv = Gen_name_src(bry);
|
||||
return Xof_repo_itm_.Ttl_shorten_ttl(tmp_bfr, rv, ttl_max_len, md5, ext.Ext());
|
||||
public byte[] Gen_name_trg(Bry_bfr tmp_bfr, byte[] bry, byte[] md5, Xof_ext ext) {
|
||||
byte[] rv = Gen_name_src(tmp_bfr, bry);
|
||||
return shorten_ttl ? Xof_repo_itm_.Ttl_shorten_ttl(tmp_bfr, rv, Ttl__max_len, md5, ext.Ext()) : rv;
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_owner)) throw Err_.new_unimplemented_w_msg("deprecated repo_itm.owner");
|
||||
@@ -84,5 +87,5 @@ public class Xof_repo_itm implements Gfo_invk {
|
||||
return this;
|
||||
}
|
||||
private static final String Invk_owner = "owner", Invk_fsys_ = "fsys_", Invk_ext_rules_ = "ext_rules_", Invk_primary_ = "primary_", Invk_wmf_api_ = "wmf_api_", Invk_tarball_ = "tarball_";
|
||||
private static final int ttl_max_len = 180;
|
||||
public static final int Ttl__max_len = 180;
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ public interface Xow_repo_mgr {
|
||||
Xof_repo_pair Repos_get_by_wiki(byte[] wiki);
|
||||
Xof_repo_pair[] Repos_ary();
|
||||
Xof_repo_itm Get_trg_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
Xof_repo_itm Get_src_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
Xof_repo_itm Get_src_by_id_or_null(int id, byte[] lnki_ttl, byte[] page_url);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ public class Xowe_repo_mgr implements Xow_repo_mgr, Gfo_invk {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void Repos_clear() {repos.Clear();}
|
||||
public void Clone(Xowe_repo_mgr src) {
|
||||
this.Repos_clear();
|
||||
int len = src.Repos_len();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
Xof_repo_pair repo_pair = src.Repos_get_at(i);
|
||||
@@ -75,6 +77,9 @@ public class Xowe_repo_mgr implements Xow_repo_mgr, Gfo_invk {
|
||||
else
|
||||
return pair.Src();
|
||||
}
|
||||
public Xof_repo_itm Get_trg_by_tid_or_null(byte[] tid) {
|
||||
return null;
|
||||
}
|
||||
public Xof_repo_pair[] Repos_ary() {if (repos_ary == null) repos_ary = (Xof_repo_pair[])repos.To_ary(Xof_repo_pair.class); return repos_ary;} private Xof_repo_pair[] repos_ary;
|
||||
public boolean Xfer_by_meta(Xof_xfer_itm xfer_itm, Xof_xfer_queue queue) {
|
||||
byte[] ttl = xfer_itm.Lnki_ttl();
|
||||
|
||||
@@ -80,6 +80,8 @@ public class Xof_xfer_queue {
|
||||
fsdb.Html_gallery_mgr_h_(xfer.Html_gallery_mgr_h());
|
||||
fsdb.Html_img_wkr_(xfer.Html_img_wkr());
|
||||
fsdb.File_exists_(xfer.File_exists());
|
||||
if (xfer.Lnki_type() == gplx.xowa.parsers.lnkis.Xop_lnki_type.Tid_orig_known)
|
||||
fsdb.Init_at_gallery_bgn(xfer.Html_w(), xfer.Html_h(), xfer.File_w());
|
||||
rv.Add(fsdb);
|
||||
}
|
||||
this.Clear();
|
||||
|
||||
Reference in New Issue
Block a user