Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)

master
Gordon Williams 2025-04-23 09:45:13 +01:00
parent 026bcb86d9
commit ac2b49ca2e
3 changed files with 5 additions and 5 deletions

View File

@ -43,6 +43,6 @@
0.40: Ensure we send health 'activity' message to gadgetbridge (added 2v26) 0.40: Ensure we send health 'activity' message to gadgetbridge (added 2v26)
0.41: When using `actfetch`, fetch historical activity type too 0.41: When using `actfetch`, fetch historical activity type too
0.42: Add handling for android STREAM_MUSIC volume level info, emitting on 0.42: Add handling for android STREAM_MUSIC volume level info, emitting on
arrival. (Needs Gadgetbridge nightly (either flavor) for now, or stable arrival. (Needs Gadgetbridge nightly (either flavour) for now, or stable
version 85 when it's out) version 85 when it's out)
0.43: Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)

View File

@ -232,8 +232,8 @@ exports.gbHandler = (event) => {
}, },
//{t:"listRecs", id:"20230616a"} //{t:"listRecs", id:"20230616a"}
"listRecs": function() { "listRecs": function() {
let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21)); let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21)).filter(s => s.length>7 /*ignore 'old' tracks without date*/);
if (event.id.length > 2) { // Handle if there was no id supplied. Then we send a list all available recorder logs back. if (event.id && event.id.length > 2) { // Handle if there was no id supplied. Then we send a list all available recorder logs back.
let firstNonsyncedIdx = recs.findIndex((logId) => logId > event.id); let firstNonsyncedIdx = recs.findIndex((logId) => logId > event.id);
if (-1 == firstNonsyncedIdx) { if (-1 == firstNonsyncedIdx) {
recs = [] recs = []

View File

@ -2,7 +2,7 @@
"id": "android", "id": "android",
"name": "Android Integration", "name": "Android Integration",
"shortName": "Android", "shortName": "Android",
"version": "0.42", "version": "0.43",
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
"icon": "app.png", "icon": "app.png",
"tags": "tool,system,messages,notifications,gadgetbridge", "tags": "tool,system,messages,notifications,gadgetbridge",