public void Fsdb_search_by_list( List_adp itms, Xow_wiki cur_wiki, Xoa_page page, Xog_js_wkr js_wkr) { if (!fsdb_enabled) return; int len = itms.Count(); Gfo_usr_dlg usr_dlg = Gfo_usr_dlg_.Instance; Xow_wiki wiki = page.Commons_mgr().Source_wiki_or(cur_wiki); Xou_cache_mgr cache_mgr = wiki.App().User().User_db_mgr().Cache_mgr(); for (int i = 0; i < len; i++) { if (usr_dlg.Canceled()) return; Xof_fsdb_itm fsdb = (Xof_fsdb_itm) itms.Get_at(i); if (fsdb.Hdump_mode() == Xof_fsdb_itm.Hdump_mode__null) { Xof_orig_itm orig = wiki.File__orig_mgr().Find_by_ttl_or_null(fsdb.Lnki_ttl(), i, len); if (orig != Xof_orig_itm.Null) { // orig exists; gplx.xowa.files.repos.Xof_repo_itm repo = wiki.File__repo_mgr().Get_trg_by_id_or_null(orig.Repo(), fsdb.Lnki_ttl(), Bry_.Empty); if (repo == null) continue; fsdb.Init_at_orig( orig.Repo(), repo.Wiki_domain(), orig.Ttl(), orig.Ext(), orig.W(), orig.H(), orig.Redirect()); } } fsdb.Init_at_xfer(i, len); Xof_file_wkr.Show_img( fsdb, usr_dlg, wiki.File__bin_mgr(), wiki.File__mnt_mgr(), cache_mgr, wiki.File__repo_mgr(), js_wkr, img_size, url_bldr, page); } }
public static Xof_fsdb_itm Make_fsdb( Xowe_wiki wiki, byte[] lnki_ttl, Xof_img_size img_size, Xof_url_bldr url_bldr) { Xof_fsdb_itm fsdb = new Xof_fsdb_itm(); lnki_ttl = Xoa_ttl.Replace_spaces(Xoa_app_.Utl__encoder_mgr().Http_url().Decode(lnki_ttl)); fsdb.Init_at_lnki( Xof_exec_tid.Tid_viewer_app, wiki.Domain_itm().Abrv_xo(), lnki_ttl, Xop_lnki_type.Id_none, Xop_lnki_tkn.Upright_null, Xof_img_size.Size_null_deprecated, Xof_img_size.Size_null_deprecated, Xof_lnki_time.Null, Xof_lnki_page.Null, Xof_patch_upright_tid_.Tid_all); fsdb.Init_at_hdoc( Int_.MaxValue, Xof_html_elem .Tid_img); // NOTE: set elem_id to "impossible" number, otherwise it will auto-update an // image on the page with a super-large size; [[File:Alfred Sisley 062.jpg]] Xof_orig_itm orig = wiki.File__orig_mgr().Find_by_ttl_or_null(lnki_ttl); if (orig == Xof_orig_itm.Null) return null; // orig not found; need orig in order to get repo Xof_repo_itm repo = wiki.File__repo_mgr().Get_trg_by_id_or_null(orig.Repo(), lnki_ttl, Bry_.Empty); if (repo == null) return null; // repo not found fsdb.Init_at_orig( orig.Repo(), repo.Wiki_domain(), orig.Ttl(), orig.Ext(), orig.W(), orig.H(), orig.Redirect()); fsdb.Init_at_html(Xof_exec_tid.Tid_viewer_app, img_size, repo, url_bldr); fsdb.File_is_orig_(true); return fsdb; }