mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-16 04:42:57 +00:00
SoundPlayer: Use full path for playlist items
This fixes an issue with not opening tracks if they have been placed in a subfolder.
This commit is contained in:
parent
f572ddd280
commit
8a6f69f2c8
|
@ -288,13 +288,12 @@ void SoundPlayerWidgetAdvancedView::try_fill_missing_info(Vector<M3UEntry>& entr
|
|||
LexicalPath playlist_path(playlist_p);
|
||||
Vector<M3UEntry*> to_delete;
|
||||
for (auto& entry : entries) {
|
||||
LexicalPath entry_path(entry.path);
|
||||
if (!entry_path.is_absolute()) {
|
||||
entry.path = String::formatted("{}/{}", playlist_path.dirname(), entry_path.basename());
|
||||
if (!LexicalPath(entry.path).is_absolute()) {
|
||||
entry.path = String::formatted("{}/{}", playlist_path.dirname(), entry.path);
|
||||
}
|
||||
|
||||
if (!Core::File::exists(entry.path)) {
|
||||
GUI::MessageBox::show(window(), String::formatted("The file \"{}\" present in the playlist does not exist or was not found. This file will be ignored.", entry_path.basename()), "Error reading playlist", GUI::MessageBox::Type::Warning);
|
||||
GUI::MessageBox::show(window(), String::formatted("The file \"{}\" present in the playlist does not exist or was not found. This file will be ignored.", entry.path), "Error reading playlist", GUI::MessageBox::Type::Warning);
|
||||
to_delete.append(&entry);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue