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 Aug 9, 2023
1 parent 33f6e72 commit 0b6b8cd
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 0b6b8cd

Please sign in to comment.