Ensure listRecs doesn't list old-style recorded tracks (Otherwise Gadgetbridge fails parsing the filename)
parent
026bcb86d9
commit
ac2b49ca2e
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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 = []
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue