oliexdev / openWorkout

Simple workout trainer that puts your privacy first
GNU General Public License v3.0
133 stars 17 forks source link

Can't export training program with '/' character in title #32

Open jm355 opened 3 years ago

jm355 commented 3 years ago

Describe the bug A training program with a '/' character in the title can be created, however when it's exported it simply fails with no explanation as to why

To Reproduce Steps to reproduce the behavior:

  1. Create a new training program
  2. Rename it to anything, as long as it has a '/' character. In my case it was "r/bodyweightfitness Recommended Routine"
  3. Save new training program
  4. Export training program anywhere

Expected behavior I expect it to be able to export any training program I'm able to create. A couple ideas for how to do that would be blocking me from creating a training program with a '/' in the title or changing the way it stores/exports files so that file names may be slightly different from the program title

Additional context Add any other context about the problem here.

Debug log openWorkout_2020-12-03_07-09.txt

oliexdev commented 3 years ago

Currently this is not possible because I create a path with the workout name and on linux the char '/' is interpreted as a subfolder.

jm355 commented 3 years ago

Yep, I figured the best solution would be to just have an error if the string contains certain characters. Or make a function that cleans the string before using it to access the file system