TianyiShi2001 / audiotags

Unified IO for different types of audio metadata
https://tianyishi2001.github.io/audiotags
MIT License
41 stars 29 forks source link

`read_from_path` should not panic without extension #7

Closed woelper closed 2 years ago

woelper commented 2 years ago

currently, extensions are handled like this:

path.as_ref()
    .extension()
    .unwrap()
    .to_string_lossy()
    .to_string()
    .to_lowercase()
    .as_str(),

Which could panic due to the unwrap(). as try_from_ext already handles extensions, maybe we could unwrap_or into an empty OsStr or use ??

pinkforest commented 2 years ago

Hm. We just re-merged audiotags2 into audiotags and there were a lot of changes.

I think these unwraps may be still there - I have to check

Please feel free to send a PR to fix and put some erroring if you find panic'y unwraps