Skip to content
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 ColorOS Call Recorder Support #100

Closed
HuangSmith opened this issue Mar 18, 2024 · 11 comments
Closed

Add ColorOS Call Recorder Support #100

HuangSmith opened this issue Mar 18, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@HuangSmith
Copy link
Contributor

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 HuangSmith added the enhancement New feature or request label Mar 18, 2024
@HuangSmith
Copy link
Contributor Author

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

@nicorac
Copy link
Owner

nicorac commented Mar 18, 2024

(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
Copy link
Contributor Author

HuangSmith commented Mar 19, 2024

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
Copy link
Contributor Author

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
Copy link
Owner

nicorac commented Mar 19, 2024

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
Copy link
Contributor Author

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
Copy link
Owner

nicorac commented Mar 19, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@nicorac
Copy link
Owner

nicorac commented Mar 19, 2024

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
Copy link
Owner

nicorac commented Mar 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants