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
89e7a501
Commit
89e7a501
authored
Nov 12, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc/protocol.rst: explain song positions vs ids
parent
7235b46e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
protocol.rst
doc/protocol.rst
+16
-0
No files found.
doc/protocol.rst
View file @
89e7a501
...
@@ -553,6 +553,22 @@ The Queue
...
@@ -553,6 +553,22 @@ The Queue
naming convention, but for the sake of compatibility, we
naming convention, but for the sake of compatibility, we
cannot rename commands.
cannot rename commands.
There are two ways to address songs within the queue: by their
position and by their id.
The position is a 1-based index. It is unstable by design: if you
move, delete or insert songs, all following indices will change, and a
client can never be sure what song is behind a given index/position.
Song ids on the other hand are stable: an id is assigned to a song
when it is added, and will stay the same, no matter how much it is
moved around. Adding the same song twice will assign different ids to
them, and a deleted-and-readded song will have a new id. This way, a
client can always be sure the correct song is being used.
Many commands come in two flavors, one for each address type.
Whenever possible, ids should be used.
:command:`add {URI}`
:command:`add {URI}`
Adds the file ``URI`` to the playlist
Adds the file ``URI`` to the playlist
(directories add recursively). ``URI``
(directories add recursively). ``URI``
...
...
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