change Recent Updates to show recent updates

Before was showing recently created games. Now showing recently updated
games.
main
Dozens B. McCuzzins 2024-02-03 15:03:05 -07:00
parent 6712f8b1db
commit a47a0d7e95
2 changed files with 13 additions and 8 deletions

View File

@ -95,10 +95,10 @@ See `justfile` for more examples
- [x] ~~tui?~~ run `just new` - [x] ~~tui?~~ run `just new`
- [x] add Update to CLI - [x] add Update to CLI
- [x] add Date to update menu. sometimes i add the session log after the session has happened! - [x] add Date to update menu. sometimes i add the session log after the session has happened!
- [x] refactor edit/update search functions
- [x] change Recent Games from 'recently created' to 'recently updated' ?
- [ ] CLI flags mode - [ ] CLI flags mode
- [ ] refactor edit/update search functions
- [ ] rename Update to Log or Session Log? - [ ] rename Update to Log or Session Log?
- [ ] change Recent Games from 'recently created' to 'recently updated' ?
## Resources ## Resources

View File

@ -109,10 +109,15 @@ main_menu
function recent_games_update () { function recent_updates () {
count=`recsel -t Game $db -c` count=`recsel -t Update $db -c`
recent="$((count - 7))" recent="$((count - 7))"
recsel $db -t Game -e "Id > ${recent}" | recfmt "${gamemenutmpl}" recsel $db \
-t Update \
-e "Id > ${recent}" \
-j Game \
-p Game_Id:Id,Game_Module:Module,Game_System:System \
| recfmt "${gamemenutmpl}"
read -p "Number> " id read -p "Number> " id
case $id in case $id in
"" | "b" | "B" | "x" | "X" | "q" | "Q") "" | "b" | "B" | "x" | "X" | "q" | "Q")
@ -124,7 +129,7 @@ esac
function search_games_update () { function search_updates () {
read -p "Query> " q read -p "Query> " q
recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}" recsel $db -t Game -i -q "${q}" | recfmt "${gamemenutmpl}"
read -p "Number> " id read -p "Number> " id
@ -179,9 +184,9 @@ read -p "> " menu
case "$menu" in case "$menu" in
1 | "r" | "R") 1 | "r" | "R")
recent_games_update;; recent_updates;;
2 | "s" | "S") 2 | "s" | "S")
search_games_update;; search_updates;;
3 | "m" | "M" | "q" | "Q" | "b" | "B") 3 | "m" | "M" | "q" | "Q" | "b" | "B")
main_menu;; main_menu;;
*) *)