Skip to content

Commit

Permalink
Android: GB Activity tracks, handle first read
Browse files Browse the repository at this point in the history
... when there is no id of the last read recorder log supplied from
Gadgetbridge.
  • Loading branch information
thyttan committed Jul 7, 2023
1 parent 290a6f2 commit b9f3a5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/android/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@

"listRecs": function() { // GB({t:"listRecs", id:"20230616a"})
let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21));
if (event.id.length > 2) { // Handle if there was no id supplied. Then we send a list all available recorder logs back.
recs = recs.slice(recs.indexOf(event.id)); // FIXME: Currently does not handle if the last fetched log was deleted on the watch, so that there won't be any entry corresponding to `event.id`
recs.shift();
}
Bluetooth.println("");
Bluetooth.println(JSON.stringify({t:"trksList", list: recs})); // TODO: split up in multiple transmissions?
},
Expand Down

0 comments on commit b9f3a5e

Please sign in to comment.