diff --git a/src/library/parserm3u.cpp b/src/library/parserm3u.cpp index 9bd0333f9d0..e42042081fe 100644 --- a/src/library/parserm3u.cpp +++ b/src/library/parserm3u.cpp @@ -101,7 +101,7 @@ bool ParserM3u::writeM3UFile(const QString &file_str, const QList &item // Important note: // On Windows \n will produce a (=\r\n) // On Linux and OS X \n is (which remains \n) - + bool urlEncodingUsed = false; QDir baseDirectory(QFileInfo(file_str).canonicalPath()); QTextCodec* codec = QTextCodec::codecForName(kStandardM3uTextEncoding); QString fileContents(QStringLiteral("#EXTM3U\n")); @@ -126,6 +126,7 @@ bool ParserM3u::writeM3UFile(const QString &file_str, const QList &item QUrl itemUrl = QUrl::fromLocalFile(item); QString itemUrlEncoded = itemUrl.toEncoded(); fileContents += itemUrlEncoded + QStringLiteral("\n"); + urlEncodingUsed = true; } } } @@ -146,6 +147,13 @@ bool ParserM3u::writeM3UFile(const QString &file_str, const QList &item QObject::tr("Could not create file") + " " + file_str); return false; } + if (urlEncodingUsed) { + QMessageBox::information(nullptr, + QObject::tr("Playlist Export Has Special Characters"), + QObject::tr("Some file paths in the playlist have special characters. " + "These file paths will be encoded as absolute path URLs. " + "Please select the m3u8 format for better and lossless exporting.")); + } file.write(outputByteArray); file.close();