Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
4dfbbccb
Commit
4dfbbccb
authored
Dec 12, 2021
by
Matthieu Gallien
🎵
Browse files
always restore local files that still exists in playlist
ensure we do not loose tracks in playlist that have a local file as URL
parent
28588557
Pipeline
#109445
passed with stage
in 17 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/mediaplaylist.cpp
View file @
4dfbbccb
...
...
@@ -336,15 +336,23 @@ void MediaPlayList::enqueueRestoredEntries(const QVariantList &newEntries)
if
(
newEntry
.
mEntryType
==
ElisaUtils
::
Radio
)
{
Q_EMIT
newEntryInList
(
newEntry
.
mId
,
{},
ElisaUtils
::
Radio
);
}
else
if
(
newEntry
.
mTitle
.
toString
().
isEmpty
()
&&
newEntry
.
mTrackUrl
.
isValid
())
{
}
else
if
(
newEntry
.
mTrackUrl
.
isValid
())
{
auto
entryURL
=
newEntry
.
mTrackUrl
.
toUrl
();
if
(
entryURL
.
isLocalFile
())
{
auto
entryString
=
entryURL
.
toLocalFile
();
QFileInfo
newTrackFile
(
entryString
);
if
(
newTrackFile
.
exists
())
{
d
->
mData
.
last
().
mIsValid
=
true
;
Q_EMIT
newEntryInList
(
0
,
entryString
,
ElisaUtils
::
FileName
);
}
else
if
(
newEntry
.
mTitle
.
toString
().
isEmpty
())
{
Q_EMIT
newEntryInList
(
0
,
entryString
,
ElisaUtils
::
FileName
);
}
else
{
Q_EMIT
newTrackByNameInList
(
newEntry
.
mTitle
,
newEntry
.
mArtist
,
newEntry
.
mAlbum
,
newEntry
.
mTrackNumber
,
newEntry
.
mDiscNumber
);
}
Q_EMIT
newEntryInList
(
0
,
entryString
,
ElisaUtils
::
FileName
);
}
else
{
d
->
mData
.
last
().
mIsValid
=
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment