gnosygnu / xowa

xowa offline wiki application
Other
379 stars 40 forks source link

Module:Spoken Wikipedia:44 attempt to perform arithmetic __add on number and nil #830

Open desb42 opened 3 years ago

desb42 commented 3 years ago

Found this html buiding 2020-12-01 enwiki

An example is en.wikipedia.org/wiki/Alfred_Nobel

In late Nov 2020, mw changed Template:Spoken_Wikipedia to use Module:Spoken_Wikipedia

From about line 46 are the lines

local fileTitle = mw.title.new(filename, 'File')
if fileTitle and fileTitle.file and fileTitle.file.exists
then
    size = size + fileTitle.file.size
end

Note the fileTitle.file.size The file object exists, but it does not have a size key

A temporary fix is to add a line to 400_xowa\src\gplx\xowa\xtns\scribunto\libs\Scrib_lib_title.java In function GetFileInfo

, Keyval_.new_("size"       , 0)    // TODO_OLD: get file size somehow

obviously it should not be zero, but at least it makes Spoken_Wikipedia work

desb42 commented 3 years ago

Also found that there was another key missing

, Keyval_.new_("mimeType"   , Xof_ext_.Mime_type__ary[itm.Ext_id()])
desb42 commented 3 years ago

it turns out that yet another change to Spoken_Wikipedia has exposed yet another missing key (changed Jan 2021)

the key is length (or as I would call it duration)