Skip to content

Fix: cutting long file names to avoid errors when saving #981

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

Merged
merged 2 commits into from
Jul 13, 2022
Merged

Fix: cutting long file names to avoid errors when saving #981

merged 2 commits into from
Jul 13, 2022

Conversation

Napuh
Copy link
Contributor

@Napuh Napuh commented Jul 13, 2022

Description

I've added a limit into the mp4 file name to avoid errors when saving files with very long filenames due to a long reddit post title.

Issue Fixes

This does not fix any issue I've seen in the repo but fixes a problem I've encountered when testing the code.

None

Checklist:

  • [ x] I am pushing changes to the develop branch
  • [ x] I am using the recommended development environment
  • [ x] I have performed a self-review of my own code
  • [ x] I have commented my code, particularly in hard-to-understand areas
  • [ x] I have formatted and linted my code using python-black and pylint
  • [ x] I have cleaned up unnecessary files
  • [ x] My changes generate no new warnings
  • [ x] My changes follow the existing code-style
  • [ x] My changes are relevant to the project

Any other information (e.g how to test the changes)

In this particular post (https://www.reddit.com/r/explainlikeimfive/comments/vxwol7/eli5_in_light_of_everyone_losing_their_minds_over/) the filename generated is too long and throws an error when saving.
This modification to the name_normalize() method solves this.

@CordlessCoder
Copy link
Collaborator

CordlessCoder commented Jul 13, 2022

One question: but why 70?
Almost all filesystems allow filenames with 255 characters, while some only allow 31

@Napuh
Copy link
Contributor Author

Napuh commented Jul 13, 2022

Well, that´s an arbitrary number ngl. I figured out that 70 its enough to distinguish files.
If you think is better to change it to another number let me know.

@JasonLovesDoggo JasonLovesDoggo merged commit 38fcb83 into elebumm:develop Jul 13, 2022
@Darkatek7
Copy link

Darkatek7 commented Nov 27, 2023

CHange it to 200 Please, doesn't work with 70. Always getting a filename to long error

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

Successfully merging this pull request may close these issues.

4 participants