Commit af78af82 authored by Tobias Fella's avatar Tobias Fella Committed by Nate Graham
Browse files

Fix loading lines with file://

parent c5774ceb
......@@ -759,9 +759,11 @@ void MediaPlayListProxyModel::loadPlayList(const QUrl &fileName)
const auto data = inputFile.readAll();
clearPlayList();
auto newTracks = DataTypes::EntryDataList{};
for (const auto &line : data.split('\n')) {
for (const auto &l : data.split('\n')) {
const auto &line = QString::fromUtf8(l);
const auto &url = line.startsWith(QStringLiteral("file:/")) ? QUrl(line) : QUrl::fromLocalFile(line);
newTracks.push_back({{{{DataTypes::ElementTypeRole, ElisaUtils::FileName},
{DataTypes::ResourceRole, QUrl::fromLocalFile(QString::fromUtf8(line))}}}, {}, {}});
{DataTypes::ResourceRole, url}}}, {}, {}});
}
enqueue(newTracks, ElisaUtils::ReplacePlayList, ElisaUtils::DoNotTriggerPlay);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment