diff options
| author | 2022-06-25 04:57:24 +1000 | |
|---|---|---|
| committer | 2022-06-25 04:57:24 +1000 | |
| commit | 923ef2c25db75ccb6a6d747304fc9c79ef454a46 (patch) | |
| tree | 1a53bc7898adc2a7015a5a9e208c5df8cb024023 /plugins/data/init.lua | |
| parent | 2f453da00cab66472bde7bc40ca22ce7f4b89e74 (diff) | |
-plugins.data: Reworked the code substantialy.
* Use the plugin data folder for storing the cache. The history folder
may be read-only or shared with different configurations.
* Don't create the cache database or surrounding folder if there's
nothing to store in it.
* Actually use prepared queries multiple times rather than always
destroying them after a single use.
* Added proper error checking for most database operations.
* Improved query performance by avoiding outer joins and table scans.
-bus/nubus: Made the Macintosh Display Cards map the blue channel to
white with monochrome monitors. Also added logging for PLL
configuration to help debug how CRTC and RAMDAC clocks work in the
future.
Diffstat (limited to 'plugins/data/init.lua')
| -rw-r--r-- | plugins/data/init.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/data/init.lua b/plugins/data/init.lua index f58742e8d34..eb3ad1ae9b3 100644 --- a/plugins/data/init.lua +++ b/plugins/data/init.lua @@ -4,12 +4,12 @@ -- heading if it supports the set otherwise nil and get which returns the data -- the script should be named data_<name>.lua -- this is set default on in the plugin.json -local exports = {} -exports.name = "data" -exports.version = "0.0.1" -exports.description = "Data plugin" -exports.license = "BSD-3-Clause" -exports.author = { name = "Carl" } +local exports = { + name = 'data', + version = '0.0.2', + description = 'Data plugin', + license = 'BSD-3-Clause', + author = { name = 'Carl' } } local data = exports @@ -26,7 +26,7 @@ function data.startplugin() local cur_list emu.register_start( - function() + function () data_scr = {} for file in lfs.dir(plugindir) do local name = string.match(file, '^(data_.*).lua$') @@ -40,7 +40,7 @@ function data.startplugin() end) emu.register_callback( - function(set) + function (set) local ret = {} if set == '' then set = emu.romname() @@ -70,13 +70,13 @@ function data.startplugin() 'data_list') emu.register_callback( - function(num) + function (num) return valid_lst[num + 1].get() end, 'data') emu.register_callback( - function(num) + function (num) local ver if valid_lst[num + 1].ver then ver = valid_lst[num + 1].ver() |
