-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GrapheneOS call recorder (was: File Name Parsing issue) #30
Comments
RegExp pattern must be inserted without delimiters and discarding filename extension. Sadly the default BCR date format uses There's actually no workaround for it, sorry. |
Hi ! Thanks for getting back to me so quick 🙂 I took a very brief moment to look at that code, and here's my take away: Would it be possible to instead accept any date parsing pattern, but legibly? function parseDateTime(str, regex) {
// Default regex
const re = /(?<year>[0-9]{4})(?<month>[0-9]{2})(?<day>[0-9]{2})_(?<hour>[0-9]{2})(?<minute>[0-9]{2})(?<second>[0-9]{2})/;
if(regex) re = regex;
const match = str.match(re);
if(!match) return null;
let year = 2023, month = 1, day = 1;
let hour = 0, minute = 0, second = 0;
if(match.groups.year) year = match.groups.year;
if(match.groups.month) month = match.groups.month;
if(match.groups.day) day = match.groups.day;
if(match.groups.hour) hour = match.groups.hour;
if(match.groups.minute) minute = match.groups.minute;
if(match.groups.second) second = match.groups.second;
return new Date(year, month, day, hour, minute, second);
} (very rough code, but you get the concept hopefully) Then standardize it, for storage in the local db? Of which then you pull to display in the UI anyhow you wish? And yes, you could assume the timezone is the system timezone. I know this is specifically for BCR at the moment, but it would be super nice if it can be a GUI for all call recording programs - one instance being android native call recording that GrapheneOS uses. |
Well, it could... but the sample you've posted won't work with BCR in its default format. A better solution could be to allow additional placeholders (more than the ones defined by BCR), at least for the I mean, leave the Let me check if I could build a POC version 😉
Is that filename format the default one of GrapheneOS call recorder? |
Correct, you would need to have a default regex that matches the BCR Format, and then allow any regex that provides the necessary groups to parse for dates and phone number. But yes, very rough, and I dont know where you would have inserted that.
yes, that seems like it would be a good idea for now.
yes
GrapheneOS, thankfully, forced this feature through. Just FYI, there are only two settings available: Output format (codec) and Audio source. They do not allow filename changes or auto recording.
That's also a good idea. Sorry for the |
I've built a test version (same version code, but it shows The pattern that should work for you is NOTE: if you click on RESET TO DEFAULT in filename pattern page it will actually set to this new one 😉 Please check it out and let me know if it has any issue... |
It's working! Thank you! 🥳 🍾 🥂 🎆 🎇 🎉 one issue though, it brings recordings that it could not parse the phone number from, to the very top of the list of calls. example: my last call recording was yesterday 12/13/2023. it brings a call recording again, thank you so much! P.S. you should update the readme & the F-Droid description to state it can handle Graphene Calls, as I think that would be very helpful to others searching |
This already is the default sorting mode of BCR-GUI, but can be changed in settings.
That behavior is due to the RegExp failing completely, because the I've also changed the "missing date" behavior: instead of mapping to today, it will be mapped to "Unix epoch time" (1970-01-01-00-00-00). |
I've updated the issue title to reflect it 😉 |
Ooops, an extra I'm sorry for that. |
All fixed, Works great! Thank you so much for being receptive to this idea 🙂 |
Just released v0.0.24 with a better filename pattern editor and "official" support to GrapheneOS filename pattern 😉 |
Describe the bug
I am having a hard time with the filename parser recognizing the file name "CallRecord_20230619-121746_+12192826655.m4a"
Here are my attempts
/CallRecord_\{date\}(?:.+)\{phone_number\}/
CallRecord_{date}(?:.+){phone_number}
CallRecord_{date}_{phone_number}
/CallRecord_\{date\}(?:.+)\{phone_number\}\.m4a/
CallRecord_{date}(?:.+){phone_number}\.m4a
CallRecord_{date}(?:.+){phone_number}.m4a
CallRecord_{date}_{phone_number}\.m4a
CallRecord_{date}_{phone_number}.m4a
any thoughts?
Version
The text was updated successfully, but these errors were encountered: