Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
713c1f2b
Commit
713c1f2b
authored
Feb 27, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/playlist' of
git://github.com/miccoli/MPD
parents
44422b2b
a149bc4c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
15 deletions
+45
-15
NEWS
NEWS
+2
-0
protocol.rst
doc/protocol.rst
+3
-1
PlaylistCommands.cxx
src/command/PlaylistCommands.cxx
+17
-3
PlaylistAny.cxx
src/playlist/PlaylistAny.cxx
+14
-4
PlaylistAny.hxx
src/playlist/PlaylistAny.hxx
+1
-1
PlaylistQueue.cxx
src/playlist/PlaylistQueue.cxx
+3
-2
PlaylistQueue.hxx
src/playlist/PlaylistQueue.hxx
+1
-1
Print.cxx
src/playlist/Print.cxx
+3
-2
Print.hxx
src/playlist/Print.hxx
+1
-1
No files found.
NEWS
View file @
713c1f2b
ver 0.21.6 (not yet released)
* protocol
- allow loading playlists specified as absolute filesystem paths
* input
- cdio_paranoia: fix build failure due to missing #include
* support abstract sockets on Linux
...
...
doc/protocol.rst
View file @
713c1f2b
...
...
@@ -714,7 +714,9 @@ and without the `.m3u` suffix).
Some of the commands described in this section can be used to
run playlist plugins instead of the hard-coded simple
`m3u` parser. They can access playlists in
the music directory (relative path including the suffix) or
the music directory (relative path including the suffix),
playlists in arbitrary location (absolute path including the suffix;
allowed only for clients that are connected via UNIX domain socket), or
remote playlists (absolute URI with a supported scheme).
:command:`listplaylist {NAME}`
...
...
src/command/PlaylistCommands.cxx
View file @
713c1f2b
...
...
@@ -38,6 +38,7 @@
#include "util/UriUtil.hxx"
#include "util/ConstBuffer.hxx"
#include "util/ChronoUtil.hxx"
#include "LocateUri.hxx"
bool
playlist_commands_available
()
noexcept
...
...
@@ -66,12 +67,17 @@ handle_save(Client &client, Request args, gcc_unused Response &r)
CommandResult
handle_load
(
Client
&
client
,
Request
args
,
gcc_unused
Response
&
r
)
{
const
auto
uri
=
LocateUri
(
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
,
nullptr
#endif
);
RangeArg
range
=
args
.
ParseOptional
(
1
,
RangeArg
::
All
());
const
ScopeBulkEdit
bulk_edit
(
client
.
GetPartition
());
const
SongLoader
loader
(
client
);
playlist_open_into_queue
(
args
.
front
()
,
playlist_open_into_queue
(
uri
,
range
.
start
,
range
.
end
,
client
.
GetPlaylist
(),
client
.
GetPlayerControl
(),
loader
);
...
...
@@ -81,7 +87,11 @@ handle_load(Client &client, Request args, gcc_unused Response &r)
CommandResult
handle_listplaylist
(
Client
&
client
,
Request
args
,
Response
&
r
)
{
const
char
*
const
name
=
args
.
front
();
const
auto
name
=
LocateUri
(
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
,
nullptr
#endif
);
if
(
playlist_file_print
(
r
,
client
.
GetPartition
(),
SongLoader
(
client
),
name
,
false
))
...
...
@@ -93,7 +103,11 @@ handle_listplaylist(Client &client, Request args, Response &r)
CommandResult
handle_listplaylistinfo
(
Client
&
client
,
Request
args
,
Response
&
r
)
{
const
char
*
const
name
=
args
.
front
();
const
auto
name
=
LocateUri
(
args
.
front
(),
&
client
#ifdef ENABLE_DATABASE
,
nullptr
#endif
);
if
(
playlist_file_print
(
r
,
client
.
GetPartition
(),
SongLoader
(
client
),
name
,
true
))
...
...
src/playlist/PlaylistAny.cxx
View file @
713c1f2b
...
...
@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "LocateUri.hxx"
#include "PlaylistAny.hxx"
#include "PlaylistStream.hxx"
#include "PlaylistMapper.hxx"
...
...
@@ -25,17 +26,26 @@
#include "config.h"
std
::
unique_ptr
<
SongEnumerator
>
playlist_open_any
(
const
char
*
uri
,
playlist_open_any
(
const
LocatedUri
&
located_
uri
,
#ifdef ENABLE_DATABASE
const
Storage
*
storage
,
#endif
Mutex
&
mutex
)
{
return
uri_has_scheme
(
uri
)
?
playlist_open_remote
(
uri
,
mutex
)
:
playlist_mapper_open
(
uri
,
switch
(
located_uri
.
type
)
{
case
LocatedUri
:
:
Type
::
ABSOLUTE
:
return
playlist_open_remote
(
located_uri
.
canonical_uri
,
mutex
);
case
LocatedUri
:
:
Type
::
PATH
:
return
playlist_open_path
(
located_uri
.
path
,
mutex
);
case
LocatedUri
:
:
Type
::
RELATIVE
:
return
playlist_mapper_open
(
located_uri
.
canonical_uri
,
#ifdef ENABLE_DATABASE
storage
,
#endif
mutex
);
}
gcc_unreachable
();
}
src/playlist/PlaylistAny.hxx
View file @
713c1f2b
...
...
@@ -34,7 +34,7 @@ class Storage;
* music or playlist directory.
*/
std
::
unique_ptr
<
SongEnumerator
>
playlist_open_any
(
const
char
*
uri
,
playlist_open_any
(
const
LocatedUri
&
located_
uri
,
#ifdef ENABLE_DATABASE
const
Storage
*
storage
,
#endif
...
...
src/playlist/PlaylistQueue.cxx
View file @
713c1f2b
...
...
@@ -18,6 +18,7 @@
*/
#include "config.h"
#include "LocateUri.hxx"
#include "PlaylistQueue.hxx"
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
...
...
@@ -63,7 +64,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
}
void
playlist_open_into_queue
(
const
char
*
uri
,
playlist_open_into_queue
(
const
LocatedUri
&
uri
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
PlayerControl
&
pc
,
const
SongLoader
&
loader
)
...
...
@@ -78,7 +79,7 @@ playlist_open_into_queue(const char *uri,
if
(
playlist
==
nullptr
)
throw
PlaylistError
::
NoSuchList
();
playlist_load_into_queue
(
uri
,
*
playlist
,
playlist_load_into_queue
(
uri
.
canonical_uri
,
*
playlist
,
start_index
,
end_index
,
dest
,
pc
,
loader
);
}
src/playlist/PlaylistQueue.hxx
View file @
713c1f2b
...
...
@@ -49,7 +49,7 @@ playlist_load_into_queue(const char *uri, SongEnumerator &e,
* play queue.
*/
void
playlist_open_into_queue
(
const
char
*
uri
,
playlist_open_into_queue
(
const
LocatedUri
&
uri
,
unsigned
start_index
,
unsigned
end_index
,
playlist
&
dest
,
PlayerControl
&
pc
,
const
SongLoader
&
loader
);
...
...
src/playlist/Print.cxx
View file @
713c1f2b
...
...
@@ -18,6 +18,7 @@
*/
#include "config.h"
#include "LocateUri.hxx"
#include "Print.hxx"
#include "PlaylistAny.hxx"
#include "PlaylistSong.hxx"
...
...
@@ -55,7 +56,7 @@ playlist_provider_print(Response &r,
bool
playlist_file_print
(
Response
&
r
,
Partition
&
partition
,
const
SongLoader
&
loader
,
const
char
*
uri
,
bool
detail
)
const
LocatedUri
&
uri
,
bool
detail
)
{
Mutex
mutex
;
...
...
@@ -71,6 +72,6 @@ playlist_file_print(Response &r, Partition &partition,
if
(
playlist
==
nullptr
)
return
false
;
playlist_provider_print
(
r
,
loader
,
uri
,
*
playlist
,
detail
);
playlist_provider_print
(
r
,
loader
,
uri
.
canonical_uri
,
*
playlist
,
detail
);
return
true
;
}
src/playlist/Print.hxx
View file @
713c1f2b
...
...
@@ -34,6 +34,6 @@ struct Partition;
bool
playlist_file_print
(
Response
&
r
,
Partition
&
partition
,
const
SongLoader
&
loader
,
const
char
*
uri
,
bool
detail
);
const
LocatedUri
&
uri
,
bool
detail
);
#endif
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