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

fix file name of voice recording #4281

Merged
merged 3 commits into from
Sep 27, 2024
Merged

Conversation

sowjanyakch
Copy link
Contributor

Fix #1564

  • Filter out special chars which are not allowed on the filesystem, e.g. /, \ and : and replace them with a space
  • Replace multiple spaces with 1 space
  • Make sure the full filename is not exceeding 150 chars, so trim the name to 146 chars before ammending the filesuffix

🚧 TODO

  • ...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@sowjanyakch sowjanyakch self-assigned this Sep 26, 2024
@sowjanyakch sowjanyakch added the 3. to review Waiting for reviews label Sep 26, 2024
Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings8696
Errors131131

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code7979
Internationalization33
Malicious code vulnerability33
Performance66
Security11
Total109109

Lint increased!

@@ -27,6 +27,7 @@ object FileUtils {
private val TAG = FileUtils::class.java.simpleName
private const val RADIX: Int = 16
private const val MD5_LENGTH: Int = 32
const val FILE_MAX_LENGTH = 146
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the max length is set to 146 instead 150 because of the suffix ".mp3". This is not obvious in the FileUtils class and may lead to confusion. So i suggest to define the max length inside MediaRecorderManager and call it "VOICE_MESSAGE_PREFIX_MAX_LENGTH"

Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4281-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@sowjanyakch sowjanyakch merged commit b0f0ef5 into master Sep 27, 2024
15 of 18 checks passed
@sowjanyakch sowjanyakch deleted the file_name_audio_recordings branch September 27, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check file name of audio recordings
2 participants