diff options
author | 2016-11-27 09:56:49 +1100 | |
---|---|---|
committer | 2016-11-27 09:56:49 +1100 | |
commit | 7238415d1f30cae0b47e54dd04eb0b5e558c132e (patch) | |
tree | 3829a830029d7b31878bb9f67dec4d8d519f1e62 /plugins/timer | |
parent | 1637c91a5ccf77dae40a3edab7af1e0b64b92bf7 (diff) |
srcclean (nw)
Diffstat (limited to 'plugins/timer')
-rw-r--r-- | plugins/timer/init.lua | 22 | ||||
-rw-r--r-- | plugins/timer/plugin.json | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/timer/init.lua b/plugins/timer/init.lua index c0f47836398..b5b6d355a03 100644 --- a/plugins/timer/init.lua +++ b/plugins/timer/init.lua @@ -23,18 +23,18 @@ function timer.startplugin() total_time = total_time + (os.time() - start_time) local db = assert(sqlite3.open(timer_db)) - + local insert_stmt = assert( db:prepare("INSERT OR IGNORE INTO timer VALUES (?, ?, 0, 0)") ) insert_stmt:bind_values(emu.romname(), emu.softname()) insert_stmt:step() insert_stmt:reset() - + local update_stmt = assert( db:prepare("UPDATE timer SET total_time=?, play_count=? WHERE driver=? AND software=?") ) update_stmt:bind_values(total_time, play_count,emu.romname(), emu.softname()) update_stmt:step() update_stmt:reset() - - assert(db:close() == sqlite3.OK) + + assert(db:close() == sqlite3.OK) end @@ -48,13 +48,13 @@ function timer.startplugin() local db = assert(sqlite3.open(timer_db)) local found=false db:exec([[select * from sqlite_master where name='timer';]], function(...) found=true return 0 end) - if not found then + if not found then db:exec[[ CREATE TABLE timer ( - driver VARCHAR(32) PRIMARY KEY, - software VARCHAR(40), - total_time INTEGER NOT NULL, - play_count INTEGER NOT NULL - ); ]] + driver VARCHAR(32) PRIMARY KEY, + software VARCHAR(40), + total_time INTEGER NOT NULL, + play_count INTEGER NOT NULL + ); ]] end local stmt, row @@ -69,7 +69,7 @@ function timer.startplugin() total_time = 0 end - assert(db:close() == sqlite3.OK) + assert(db:close() == sqlite3.OK) start_time = os.time() play_count = play_count + 1 diff --git a/plugins/timer/plugin.json b/plugins/timer/plugin.json index 3c4629ba60d..005a0fad9a4 100644 --- a/plugins/timer/plugin.json +++ b/plugins/timer/plugin.json @@ -1,9 +1,9 @@ { "plugin": { - "name": "timer", + "name": "timer", "description": "Timer plugin", - "version": "0.0.1", - "author": "Carl", + "version": "0.0.1", + "author": "Carl", "type": "plugin", "start": "false" } |