[multimedia/elisa] /: Prefer m3u8 over m3u as a playlist format
Nate Graham
null at kde.org
Tue Mar 2 21:54:09 GMT 2021
Git commit 085836632556c00bc56219e00a382a7a80680747 by Nate Graham.
Committed on 02/03/2021 at 21:53.
Pushed by ngraham into branch 'master'.
Prefer m3u8 over m3u as a playlist format
m3u files, when loaded by an audio player, will cause it to choke on
entries with non-ASCII characters--even if the file itself is UTF-8
encoded. To make this work, the filename extension itself must be m3u8,
not m3u.
Elisa already transparently supports files with the .m3u8 extension, but
does not save in this file format by default, and does not list them for
opening in its open dialog.
This commit makes Elisa able to open m3u8 files from its file dialog and
save playlists in that format by default.
CCBUG: 389187
M +1 -1 autotests/mediaplaylistproxymodeltest.cpp
M +1 -1 doc/index.docbook
M +2 -2 src/mediaplaylistproxymodel.cpp
M +2 -2 src/qml/MediaPlayListView.qml
https://invent.kde.org/multimedia/elisa/commit/085836632556c00bc56219e00a382a7a80680747
diff --git a/autotests/mediaplaylistproxymodeltest.cpp b/autotests/mediaplaylistproxymodeltest.cpp
index 28be6e48..c7885ef1 100644
--- a/autotests/mediaplaylistproxymodeltest.cpp
+++ b/autotests/mediaplaylistproxymodeltest.cpp
@@ -1149,7 +1149,7 @@ void MediaPlayListProxyModelTest::testSaveLoadPlayList()
QCOMPARE(myPlayListProxyModelSave.currentTrack(), QPersistentModelIndex(myPlayListProxyModelSave.index(0, 0)));
- QTemporaryFile playlistFile(QStringLiteral("./myPlaylistXXXXXX.m3u"));
+ QTemporaryFile playlistFile(QStringLiteral("./myPlaylistXXXXXX.m3u8"));
playlistFile.open();
QCOMPARE(myPlayListProxyModelSave.savePlayList(QUrl::fromLocalFile(playlistFile.fileName())), true);
diff --git a/doc/index.docbook b/doc/index.docbook
index 8f2a5a5c..62cef50a 100644
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@ -156,7 +156,7 @@ A toolbar below the playlist allows to operate on it. The following actions are
</listitem>
<listitem>
<para>
- You can save the playlist to the m3u format.
+ You can save the playlist to the m3u8 format.
</para>
</listitem>
<listitem>
diff --git a/src/mediaplaylistproxymodel.cpp b/src/mediaplaylistproxymodel.cpp
index 70238592..0b7877c0 100644
--- a/src/mediaplaylistproxymodel.cpp
+++ b/src/mediaplaylistproxymodel.cpp
@@ -723,13 +723,13 @@ bool MediaPlayListProxyModel::savePlayList(const QUrl &fileName)
}
}
- return savePlaylist.save(fileName, "m3u");
+ return savePlaylist.save(fileName, "m3u8");
}
void MediaPlayListProxyModel::loadPlayList(const QUrl &fileName)
{
d->mLoadPlaylist.clear();
- d->mLoadPlaylist.load(fileName, "m3u");
+ d->mLoadPlaylist.load(fileName, "m3u8");
}
void MediaPlayListProxyModel::loadPlayListLoaded()
diff --git a/src/qml/MediaPlayListView.qml b/src/qml/MediaPlayListView.qml
index 567bd471..74fb28ff 100644
--- a/src/qml/MediaPlayListView.qml
+++ b/src/qml/MediaPlayListView.qml
@@ -368,9 +368,9 @@ Kirigami.Page {
PlatformDialog.FileDialog {
id: fileDialog
- defaultSuffix: 'm3u'
+ defaultSuffix: 'm3u8'
folder: PlatformDialog.StandardPaths.writableLocation(PlatformDialog.StandardPaths.MusicLocation)
- nameFilters: [i18nc("file type (mime type) for m3u playlist", "Playlist (*.m3u)")]
+ nameFilters: [i18nc("file type (mime type) for m3u and m3u8 playlist file formats", "Playlist (*.m3u*)")]
onAccepted:
{
More information about the kde-doc-english
mailing list