[fix]: Make sure the audio exists before trying to load it

This commit is contained in:
Chris Cochrun 2026-04-29 14:32:53 -05:00
parent 61e0fb8e49
commit f4640d5f72

View file

@ -426,9 +426,12 @@ impl SongEditor {
if let Some(author) = song.author {
self.author = author;
}
if let Some(audio) = song.audio {
self.player.stop();
self.player.clear();
self.player.stop();
self.player.clear();
if let Some(audio) = song.audio
&& audio.exists()
{
let file = BufReader::new(
File::open(&audio).expect("There should be an audio file here"),
);
@ -438,6 +441,7 @@ impl SongEditor {
self.audio_duration = source.total_duration();
self.player.append(source);
self.player.pause();
} else {
}
if let Some(ccli) = song.ccli {