nicorac / bcr-gui

BCR-GUI is a companion app for the great BCR (Basic Call Recorder) Android application and other supported ROMs with embedded call recorders.
https://coolsoft.altervista.org
GNU General Public License v3.0
152 stars 7 forks source link

Add ColorOS Call Recorder Support #100

Closed HuangSmith closed 6 months ago

HuangSmith commented 6 months ago

Hi Developer. I've just known the BCR-GUI have supported Huawei Call Recorder's File Pattern. Here's are the ColorOS's one: (MP3 file format) ^{contact_name}-{date:year}{date:month}{date:day}{date:hours}{date:minutes} The only difference is this placeholder {date:year} should be 2 digits instead of 4. (I wonder if that works without correction) Thanks!

HuangSmith commented 6 months ago

Here's is the example: 10987654321-2203021149.mp3

nicorac commented 6 months ago

(I wonder if that works without correction)

No, it doesn't actually work. {date:year} requires 4 digits so it will "consume" month digits as year, but then it doesn't have enough digits to compose a valid date. I've added a new {date:year2} placeholder to parse 2-digits years, like 20xx (I'm deliberately discarding 20° century calls 😉).

One question: the first placeholder in your pattern is {contact_name}, but the sample filename shows a {phone_number}. Is {contact_name} the right field to use? 🤔

HuangSmith commented 6 months ago

No, it doesn't actually work. {date:year} requires 4 digits so it will "consume" month digits as year, but then it doesn't have enough digits to compose a valid date. I've added a new {date:year2} placeholder to parse 2-digits years, like 20xx (I'm deliberately discarding 20° century calls 😉).

Thanks a lot!

One question: the first placeholder in your pattern is {contact_name}, but the sample filename shows a {phone_number}. Is {contact_name} the right field to use? 🤔

It just works. The test result can write the phone number into caller_name and contact_name.

HuangSmith commented 6 months ago

Update. I've changed ^{contact_name}-{date:year}{date:month}{date:day}{date:hours}{date:minutes} to ^{contact_name}-{date:year2}{date:month}{date:day}{date:hours}{date:minutes} the test result can show caller_name and contact_name now, but the call_date is still wrong. It shows 1970-01-01T00:00:00.000Z.

nicorac commented 6 months ago

but the call_date is still wrong

That feature was not released yet, sorry. It will be soon, once I've cleared out my doubts about {contact_name}; if you'd like to build it on your side, please refer to branch coloros-call-recorder-support-#100.

It just works. The test result can write the phone number into caller_name and contact_name.

My question is: is the first placeholder always a phone number? Or it's a phone number only when no contact name is associated with the caller (and, in this case, it's replaced with contact name)?

In the first case, filenames are always like this:

10987654321-2203021149.mp3
17919870141-2401011230.mp3
...

otherwise, when receiving a call from a known contact, they could be like this:

17919870141-2401011230.mp3
john smith (home)-2403011450.mp3

If it's always a phone number, it's better to use {phone_number} placeholder to let BCR-GUI know it should search for a contact name in contacts...

HuangSmith commented 6 months ago

My question is: is the first placeholder always a phone number? Or it's a phone number only when no contact name is associated with the caller (and, in this case, it's replaced with contact name)?

The situation is the latter one.

17919870141-2401011230.mp3 john smith (home)-2403011450.mp3

Now I see it. Sorry for my understanding.

nicorac commented 6 months ago

Nevermind, that was my first thought, but I needed a confirm 😉

So, the final ColorOS pattern will be: ^{contact_name}-{date:year2}{date:month}{date:day}{date:hours}{date:minutes}

HuangSmith commented 6 months ago

Thanks! By the way, I've finished the Chinese (Simplified) translation solely by myself. Since the BCR have had the Chinese interface, I wish my contribution would help more folks around me can use this companion app more fluently.

HuangSmith commented 6 months ago

One more question, why these {caller_name}, {contact_name} and {call_log_name} has a same note: Caller name: any character?

nicorac commented 6 months ago

why these {caller_name}, {contact_name} and {call_log_name} has a same note: Caller name: any character?

Nothing relevant, it's some kind of "hystorical" reason. BCR (the call recorder that started all of this...) has 3 different fields, and stores all of them in a .json metadata file with the same name as the audio recording file. BCR-GUI put all of them in a "fallback chain", showing the first one with a value.

I've finished the Chinese (Simplified) translation solely by myself

Well done, thanks. I'll merge it in next version (together with a mention for you in changelog 😉)

nicorac commented 6 months ago

Just released v.1.7.1 with both this feature and your Chinese (simplified) translation