Skip to content

Commit

Permalink
Playlist Parser: Clean the path instead of converting it to a canonic…
Browse files Browse the repository at this point in the history
…al path when loading a playlist.
  • Loading branch information
smithjd15 committed Jan 23, 2022
1 parent 70e8fe9 commit ac0e371
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/playlistparsers/parserbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,9 @@ void ParserBase::LoadSong(const QString& filename_or_url, qint64 beginning,
// was created on/for, using replace() lets playlists work on any platform.
filename = filename.replace('\\', '/');

// Make the path absolute
// Make the path absolute and clean it
if (!QDir::isAbsolutePath(filename)) {
filename = dir.absoluteFilePath(filename);
}

// Use the canonical path
if (QFile::exists(filename)) {
filename = QFileInfo(filename).canonicalFilePath();
filename = QDir::cleanPath(dir.absoluteFilePath(filename));
}

const QUrl url = QUrl::fromLocalFile(filename);
Expand Down

0 comments on commit ac0e371

Please sign in to comment.