Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
30f459fb
Commit
30f459fb
authored
Jul 05, 2018
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPlaylist: Re-add some wrappers using a mediaId instead of a full media
parent
91777b7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
include/medialibrary/IPlaylist.h
include/medialibrary/IPlaylist.h
+5
-0
src/Playlist.cpp
src/Playlist.cpp
+16
-0
src/Playlist.h
src/Playlist.h
+2
-0
No files found.
include/medialibrary/IPlaylist.h
View file @
30f459fb
...
...
@@ -58,6 +58,11 @@ public:
/// \return true on success, false on failure
///
virtual
bool
add
(
const
IMedia
&
media
,
unsigned
int
position
)
=
0
;
/// Convenience wrappers
virtual
bool
append
(
int64_t
mediaId
)
=
0
;
virtual
bool
add
(
const
int64_t
mediaId
,
unsigned
int
position
)
=
0
;
///
/// \brief move Change the position of a media
/// \param mediaId The media to move reorder
...
...
src/Playlist.cpp
View file @
30f459fb
...
...
@@ -203,6 +203,22 @@ bool Playlist::add( const IMedia& media, unsigned int position )
}
}
bool
Playlist
::
append
(
int64_t
mediaId
)
{
auto
media
=
m_ml
->
media
(
mediaId
);
if
(
media
==
nullptr
)
return
false
;
return
append
(
*
media
);
}
bool
Playlist
::
add
(
const
int64_t
mediaId
,
unsigned
int
position
)
{
auto
media
=
m_ml
->
media
(
mediaId
);
if
(
media
==
nullptr
)
return
false
;
return
add
(
*
media
,
position
);
}
// Attach file object to Playlist
std
::
shared_ptr
<
File
>
Playlist
::
addFile
(
const
fs
::
IFile
&
fileFs
,
int64_t
parentFolderId
,
bool
isFolderFsRemovable
)
...
...
src/Playlist.h
View file @
30f459fb
...
...
@@ -62,6 +62,8 @@ public:
const
QueryParameters
*
params
)
const
override
;
virtual
bool
append
(
const
IMedia
&
media
)
override
;
virtual
bool
add
(
const
IMedia
&
media
,
unsigned
int
position
)
override
;
virtual
bool
append
(
int64_t
mediaId
)
override
;
virtual
bool
add
(
const
int64_t
mediaId
,
unsigned
int
position
)
override
;
virtual
bool
move
(
int64_t
mediaId
,
unsigned
int
position
)
override
;
virtual
bool
remove
(
int64_t
mediaId
)
override
;
std
::
shared_ptr
<
File
>
addFile
(
const
fs
::
IFile
&
fileFs
,
int64_t
parentFolderId
,
...
...
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