Playlist Parser: Clean the file path when loading a playlist.
This commit is contained in:
parent
14ddc88603
commit
004c4cfe78
|
@ -53,11 +53,13 @@ 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);
|
||||
}
|
||||
|
||||
filename = QDir::cleanPath(filename);
|
||||
|
||||
const QUrl url = QUrl::fromLocalFile(filename);
|
||||
|
||||
// Search in the library
|
||||
|
|
|
@ -61,7 +61,7 @@ class ParserBase : public QObject {
|
|||
protected:
|
||||
// Loads a song. If filename_or_url is a URL (with a scheme other than
|
||||
// "file") then it is set on the song and the song marked as a stream.
|
||||
// If it is a filename or a file:// URL then it is made absolute and canonical
|
||||
// If it is a filename or a file:// URL then it is made absolute and cleaned
|
||||
// and set as a file:// url on the song. Also sets the song's metadata by
|
||||
// searching in the Library, or loading from the file as a fallback.
|
||||
// This function should always be used when loading a playlist.
|
||||
|
|
Loading…
Reference in New Issue