-
Notifications
You must be signed in to change notification settings - Fork 20
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
arg --fix-db won't panic anymore #104
base: master
Are you sure you want to change the base?
Conversation
Thanks a lot for the contribution. I left you some areas for improvements. What would be the use of the -h argument ? |
Second commit is the end of the
Third commit is an example of what i mean by an |
path.file_name() | ||
); | ||
if !cache_folder.is_dir() { | ||
println!("[WARN] No download directory found in Cache",); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In rust, you don't need the comma after the format string if no arguments are given.
println!("[WARN] No download directory found in Cache",); | |
println!("[WARN] The download folder in the cache wasn't found `{cache_folder}`"); |
); | ||
if !cache_folder.is_dir() { | ||
println!("[WARN] No download directory found in Cache",); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use cargo fmt
to format the code
if !cache_folder.is_dir() { | ||
println!("[WARN] No download directory found in Cache",); | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use an else prefer using a return
to end the function there.
src/database/writer.rs
Outdated
} | ||
// TODO : really fix the db (delete bad files and rewrite the db.bin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a good idea indeed!
...due to missing directory or unexpected files.
However --fix-db does not lauch the TUI after being done, nor it removes any of the faulty json or mp4 files, which option seems best?
I quite like this project, as it has all the base features I want for a YTmusic player. So I eventually decided to contribute even if I'm a newcomer to rust.
I will try to work on #93 and/or #88 on my spare time, because I need that the most.