street-lab-tech / street-whisper-app

STREET Lab Whisper App - a tool that transcribes and translates audio files into CSV files.
MIT License
2 stars 0 forks source link

Adding invalid path checking (for both the audio file + destination folder) #33

Closed carmen-chau closed 3 months ago

carmen-chau commented 4 months ago

PR Solution to #31

This PR made 2 main changes

Change #1: The existing audio file format checking (in method validate_audio_file) has been moved from the backend script to streetwhisperapp.py. This would allow for more immediate error catching, and reprompt from the user.

Change #2: Added a method called validate_path that checks whether a path is valid. The check is dependent on whether we are calling it for the purpose of checking for a valid file path, or a valid directory path.

Note: In validate_path, probably no need check whether path has the correct permissions (read, write, execute) for now since this CLI is mainly aimed for non-technical folks (the likelihood of paths having custom permissions would be low). Though this might be an enhancement to consider down the road. This of course, is open for discussion