Allow range in listplaylist and listplaylistinfo
This commit is contained in:
@@ -117,8 +117,8 @@ static constexpr struct command commands[] = {
|
||||
{ "listneighbors", PERMISSION_READ, 0, 0, handle_listneighbors },
|
||||
#endif
|
||||
{ "listpartitions", PERMISSION_READ, 0, 0, handle_listpartitions },
|
||||
{ "listplaylist", PERMISSION_READ, 1, 1, handle_listplaylist },
|
||||
{ "listplaylistinfo", PERMISSION_READ, 1, 1, handle_listplaylistinfo },
|
||||
{ "listplaylist", PERMISSION_READ, 1, 2, handle_listplaylist },
|
||||
{ "listplaylistinfo", PERMISSION_READ, 1, 2, handle_listplaylistinfo },
|
||||
{ "listplaylists", PERMISSION_READ, 0, 0, handle_listplaylists },
|
||||
{ "load", PERMISSION_ADD, 1, 3, handle_load },
|
||||
{ "lsinfo", PERMISSION_READ, 0, 1, handle_lsinfo },
|
||||
|
@@ -125,8 +125,10 @@ handle_listplaylist(Client &client, Request args, Response &r)
|
||||
#endif
|
||||
);
|
||||
|
||||
RangeArg range = args.ParseOptional(1, RangeArg::All());
|
||||
|
||||
if (playlist_file_print(r, client.GetPartition(), SongLoader(client),
|
||||
name, false))
|
||||
name, range.start, range.end, false))
|
||||
return CommandResult::OK;
|
||||
|
||||
throw PlaylistError::NoSuchList();
|
||||
@@ -142,8 +144,10 @@ handle_listplaylistinfo(Client &client, Request args, Response &r)
|
||||
#endif
|
||||
);
|
||||
|
||||
RangeArg range = args.ParseOptional(1, RangeArg::All());
|
||||
|
||||
if (playlist_file_print(r, client.GetPartition(), SongLoader(client),
|
||||
name, true))
|
||||
name, range.start, range.end, true))
|
||||
return CommandResult::OK;
|
||||
|
||||
throw PlaylistError::NoSuchList();
|
||||
|
Reference in New Issue
Block a user