Giter Site home page Giter Site logo

Comments (10)

hugleo avatar hugleo commented on June 12, 2024 1

PS:

There are one more item in config that is defined with nil value:

NETWORK_PROXY = nil,

Will be affected as well.

from koreader.

hugleo avatar hugleo commented on June 12, 2024

Maybe something messing with the config?

What the contents of defaults.custom.lua file?

from koreader.

jonnyl2 avatar jonnyl2 commented on June 12, 2024

Indeed, I commented out the STARDICT line and that fixed it.

This is how the last 3 lines of defaults.custom.lua looked like before:

    },
    STARDICT_DATA_DIR = "/mnt/onboard/.adds/dict", 
}

Is this not the proper way to define a custom dictionary location? The dictionaries were loaded from there correctly. I don't remember when I last opened the Advanced settings -- it could have been months ago.

from koreader.

hugleo avatar hugleo commented on June 12, 2024

Could you try like that?

STARDICT_DATA_DIR = /mnt/onboard/.adds/dict,

EDIT: That will evenΒ΄t read

I'm looking at it...

from koreader.

hius07 avatar hius07 commented on June 12, 2024

When building the list of the default default values the program iterates over all key-values from defaults.lua.

for k, v in pairs(ro_defaults) do
self.state[k] = {
idx = 1,
value = v,
custom = false,
dirty = false,
default_value = v,
}
end

But defaults.lua contains
STARDICT_DATA_DIR = nil,

Lua pairs skips keys with nil values, so when building the list of custom default values we got crash in line 47
for k, v in pairs(rw_defaults) do
self.state[k].value = v
self.state[k].custom = true
end

because self.state["STARDICT_DATA_DIR"] is nil.

from koreader.

hugleo avatar hugleo commented on June 12, 2024

yes, but not exactly.

The problem is here with dofile: https://github.com/koreader/koreader/blob/master/frontend/luadefaults.lua#L46
dofile will not load STARDICT_DATA_DIR even if is explicit defined with nil value.

We use this var here: https://github.com/koreader/koreader/blob/master/frontend/apps/reader/modules/readerdictionary.lua#L110

I suggest change to STARDICT_DATA_DIR = false in defaults.lua, what do you think?

from koreader.

Frenzie avatar Frenzie commented on June 12, 2024

Shouldn't we have seen this 2 or more years ago already? What changed since?

from koreader.

hugleo avatar hugleo commented on June 12, 2024

for reference: https://stackoverflow.com/questions/40441508/how-to-represent-nil-in-a-table or https://forums.solar2d.com/t/inserting-nil-into-table/327955/3

> t = {a = "1", STARDICT_DATA_DIR = nil, b = 2}
for key,_ in pairs(t) do
   print(key)
end
b
a
> 

from koreader.

pazos avatar pazos commented on June 12, 2024

Shouldn't we have seen this 2 or more years ago already? What changed since?

Four since f756a6a πŸ€”

TBH I didn't check advanced settings back then so it is probably broken since its inception.

from koreader.

hugleo avatar hugleo commented on June 12, 2024

Shouldn't we have seen this 2 or more years ago already? What changed since?

Four since f756a6a πŸ€”

TBH I didn't check advanced settings back then so it is probably broken since its inception.

This one will not crash. Is since this: #9546 ;-)

from koreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.