View Single Post
Old 03-13-2024, 11:21 AM   #61
neil_swann80
0000000000101010
neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.neil_swann80 ought to be getting tired of karma fortunes by now.
 
neil_swann80's Avatar
 
Posts: 5,383
Karma: 11226895
Join Date: Mar 2023
Location: An island off the coast of Ireland
Device: PB632 [HD3]
I don't think that will work.

A temporary fix for you would mostly likely be:
Code:
    local sql = [[
            REPLACE INTO books_settings
            (bookid, profileid, cpage, npage, completed, opentime)
            VALUES (?, 2, ?, ?, ?, ?)
        ]]
Until someone provides a fix to handle multiple profiles.

At pbterm this clunky line of code returns the current profile name:
Code:
profileName=$(readlink -f /mnt/ext1/system/profiles/.current); echo ${profileName##*/}
This works to get the variable into LUA:
(won't work if profiles never enabled/configured though)
Code:
local h1 = io.popen('test=$(readlink -f /mnt/ext1/system/profiles/.current); echo ${test##*/}')
local h2 = h1:read('*a')
-- removes newline
local profileName = h2:gsub('[\n\r]', '')
h1:close()

Last edited by neil_swann80; 03-14-2024 at 02:10 AM.
neil_swann80 is offline   Reply With Quote