[Slim-Checkins] r8842 - in /trunk/server: Changelog6.html
HTML/EN/html/docs/cli-api.html
Slim/Control/Queries.pm Slim/Control/Request.pm
fred at svn.slimdevices.com
fred at svn.slimdevices.com
Sun Aug 6 18:12:21 PDT 2006
Author: fred
Date: Sun Aug 6 18:12:15 2006
New Revision: 8842
URL: http://svn.slimdevices.com?rev=8842&view=rev
Log:
Bug: 2827, 2878, 2879, 2877, 1323 (part)
Description:
* Revisit DB queries for correctness and to support VA
* Add new sort to albums to implement "New Music"
* Make sure all genres and contributors for a track can be obtained
* Add lyrics field to songinfo
Modified:
trunk/server/Changelog6.html
trunk/server/HTML/EN/html/docs/cli-api.html
trunk/server/Slim/Control/Queries.pm
trunk/server/Slim/Control/Request.pm
Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=8842&r1=8841&r2=8842&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Sun Aug 6 18:12:15 2006
@@ -259,6 +259,7 @@
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2822">#2822</a> - Search Music results: First line on top of search text box</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2823">#2823</a> - 6.5b1 crash bug, any version, on startup</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2825">#2825</a> - CURRTIME in TitleFormat broken</li>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2827">#2827</a> - Add CLI support for Various Artists</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2830">#2830</a> - MusicMagic Exporting songs takes hours...</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2834">#2834</a> - Multiple device playlists not displaying correctly in Web UI</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2836">#2836</a> - handheld skin--artwork disappears when pressing next or prev on status page</li>
@@ -271,6 +272,9 @@
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2858">#2858</a> - can't access itunes setup page - error in url?</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2865">#2865</a> - server preference pane does not work on new Intel Macs</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2870">#2870</a> - Viewing second page of to-be-saved playlist jumps to edit mode</li>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2877">#2877</a> - CLI support for lyrics</li>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2878">#2878</a> - CLI support for genres</li>
+ <li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2879">#2879</a> - CLI support for contributors</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2889">#2889</a> - Dropouts</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2890">#2890</a> - sleep cuts sound early, but then continues</li>
<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=2891">#2891</a> - "repeat 2" ignored if set late</li>
Modified: trunk/server/HTML/EN/html/docs/cli-api.html
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/html/docs/cli-api.html?rev=8842&r1=8841&r2=8842&view=diff
==============================================================================
--- trunk/server/HTML/EN/html/docs/cli-api.html (original)
+++ trunk/server/HTML/EN/html/docs/cli-api.html Sun Aug 6 18:12:15 2006
@@ -3,7 +3,11 @@
[% techinfo = '1' %]
[% PROCESS helpheader.html %]
-<h4>Introduction</h4>
+<p>
+ <a href="#SC">Experts, jump directly to the command index</a>
+</p>
+
+<h2>Introduction</h2>
<p>
The SlimServer provides a command-line interface to the Slim Devices
@@ -118,18 +122,15 @@
Added the "<a href="#subscribe">subscribe</a>" command.
</li>
<li>
- Added year as a filter criteria for the
- "<a href="#titles">titles</a>" and
- "<a href="#albums">albums</a>" queries.
- </li>
- <li>
- Added the "<a href="#title">remote</a>" and
+ Added the "<a href="#cursonginfo">remote</a>" and
"<a href="#playlistXinfo">playlist remote</a>" queries.
Likewise, added the "remote" field to the
- <a href="#status">status</a>" query.
- </li>
- <li>
- Added the "<a href="#title">current_title</a>" query.
+ <a href="#status">status</a>", <a href="#titles">titles</a>",
+ <a href="#playlists tracks">playlists tracks</a>" and
+ <a href="#status">songinfo</a>" queries.
+ </li>
+ <li>
+ Added the "<a href="#cursonginfo">current_title</a>" query.
Likewise, added the "current_title" field to the
<a href="#status">status</a>" query.
</li>
@@ -162,14 +163,36 @@
to accept a list of comma-separated track_ids as parameter.
</li>
<li>
- Updated command
- "<a href="#albums">albums</a>"
- to return additional information about albums (year, artwork_track, etc).
- </li>
- <li>
- Brought the notion of contributors to the CLI.
- - Query "<a href="#genres">genres</a>" accepts contributor_id
- - Query "<a href="#albums">albums</a>" accepts contributor_id
+ Updated query "<a href="#albums">albums</a>"
+ to return additional information about albums (year, artwork_track,
+ etc), including the ability to sort the list by "new" (to
+ replicate the "New Music" web GUI browse mode). Also added
+ the ability to filter the list by "year" and
+ "track_id".
+ </li>
+ <li>
+ Updated query "<a href="#artists">artists</a>"
+ to return the "Various Artists" pseudo-artist. Also added
+ the ability to filter the list by "year" and
+ "track_id".
+ </li>
+ <li>
+ Updated queries <a href="#status">status</a>",
+ <a href="#titles">titles</a>",
+ <a href="#playlists tracks">playlists tracks</a>" and
+ <a href="#status">songinfo</a>"
+ to return lyrics.
+ </li>
+ <li>
+ Updates queries "<a href="#titles">titles</a>" and
+ "<a href="#genres">genres</a>" to accept a year as a filter
+ criteria.
+ </li>
+ <li>
+ Updated the CLI for the latest player model, Transporter. Queries
+ "<a href="#player model ?">player model ?</a>" and
+ "<a href="#players">players</a>" return
+ "transporter" for Transporters.
</li>
<li>
0x00 is now a valid end of line / command separator. In addition, the
@@ -181,9 +204,9 @@
"<a href="#mixerbass">mixer bass</a>",
"<a href="#mixertreble">mixer treble</a>" and
"<a href="#mixerpitch">mixer pitch</a>". These 3 options are
- not (yet) supported on the most recent players, Squeezebox2 and
- Squeezebox3. Pitch is only supported by Squeezebox1 players; bass and
- treble are supported by SliMP3 and Squeezebox1 players.
+ not (yet) supported on the most recent players. Pitch is only supported
+ by Squeezebox1 players; bass and treble are supported by SliMP3 and
+ Squeezebox1 players.
</li>
<li>
Changed "<a href="#mixermuting">mixer muting</a>" to be
@@ -241,29 +264,51 @@
<hr>
-<h4>General command format</h4>
-
-<p>The format of the commands, queries and server replies is as follows:</p>
-
-<blockquote> <p><strong><code>[<playerid>] <p0> <p1>
- ... <pN> <LF></code></strong></p> </blockquote>
-
-<p>where: </p>
-
-<blockquote>
- <p><code><playerid></code> is the unique identifier for the
+<h3>
+ Command format
+</h3>
+<h4>
+ General command and query format
+</h4>
+
+<p>
+ The format of the commands, queries and server replies is as follows:
+</p>
+<blockquote>
+ <p>
+ <strong>
+ <code>
+ [<playerid>]
+ <p0>
+ <p1>
+ ...
+ <pN>
+ <LF>
+ </code>
+ </strong>
+ </p>
+</blockquote>
+<p>
+ where:
+</p>
+<blockquote>
+ <p>
+ <code><playerid></code> is the unique identifier for the
player, usually (but not guaranteed to be) the MAC address of the
player. Some commands are global to the SlimServer and do not
require a <code><playerid></code>. For commands requiring it,
a random player will be selected by the SlimServer if the
<code><playerid></code> is omitted, and returned in the
server reply. <code><playerid></code> may be obtained by using
- the "player id" or "players" command.</p>
- <p><code><p0></code> through <code><pN></code> are
+ the "player id" or "players" queries.
+ </p>
+ <p>
+ <code><p0></code> through <code><pN></code> are
<em>positional</em> parameters. Pass a "?" to obtain a
value for that parameter in the SlimServer response (i.e. send a
query). Details of the parameters vary for each command as described
below.
+ </p>
</blockquote>
<p>Each parameter needs to be encoded using percent-style escaping, the
@@ -424,7 +469,7 @@
-<h4 id="Notes">Notes</h4>
+<h3 id="Notes">Notes</h3>
<ul>
<li>The Security settings of the SlimServer preferences apply to CLI
connections when they are established. A change in security
@@ -536,7 +581,9 @@
-<h4>Supported Commands</h4>
+<h3 id="SC">
+ Supported Commands
+</h3>
<p>
The supported commands are listed below, grouped by their scope:
</p>
@@ -576,9 +623,47 @@
</li>
</ul>
+
+<!----------------------------------------------------------------------------->
+<!-- GENERAL COMMANDS -->
+<!----------------------------------------------------------------------------->
+
<hr>
-<h4 id="GC">General commands and queries</h4>
-
+<h2 id="GC">
+ General commands and queries
+</h2>
+<ul>
+ <li>
+ <strong><code><a href="#login">login</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#can">can</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#version">version</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#listen">listen</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#subscribe">subscribe</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#pref">pref</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#debug">debug</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#exit">exit</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#shutdown">shutdown</a></code></strong>
+ </li>
+</ul>
+
+
+<br>
<p id="login">
<strong>
<code>
@@ -643,44 +728,24 @@
</blockquote>
<br>
-<p>
- <strong>
- <code>
- debug
- <debugflag>
- <0|1|?|>
- </code>
- </strong>
-</p>
-<p>
- The "debug" command allows the caller to query, clear, set
- or toggle the server's internal debug flags. Use 0 to clear, 1
- to set, ? to query and no parameter to toggle the debug flag
- value.
+<p id="version">
+ <strong>
+ <code>
+ version
+ </code>
+ </strong>
+</p>
+<p>
+ The "version" query returns the server version number.<
</p>
<p>
Examples:
</p>
-<blockquote>
- <p>
- Request: "debug d_files ?<LF>"
- <br>
- Response: "debug d_files 0<LF>"
- </p>
- <p>
- Request: "debug d_itunes 0<LF>"
- <br>
- Response: "debug d_itunes 0<LF>"
- </p>
- <p>
- Request: "debug d_stream 1<LF>"
- <br>
- Response: "debug d_stream 1<LF>"
- </p>
- <p>
- Request: "debug d_stream<LF>"
- <br>
- Response: "debug d_stream 0<LF>"
+<blockquote>
+ <p>
+ Request: "version ?<LF>"
+ <br>
+ Response: "version 6.5<LF>"
</p>
</blockquote>
@@ -717,13 +782,11 @@
<p>
Request: "listen 1<LF>"
<br>
- Response:
- <br>
- listen 1<LF>
- <br>
- 04:20:00:12:23:45 mixer volume 25<LF>
- <br>
- 04:20:00:12:23:45 pause<LF>
+ Response: "listen 1<LF>"
+ <br>
+ "04:20:00:12:23:45 mixer volume 25<LF>"
+ <br>
+ "04:20:00:12:23:45 pause<LF>"
<br>
...
</p>
@@ -757,20 +820,18 @@
<p>
Request: "subscribe mixer,pause<LF>"
<br>
- Response:
- <br>
- subscribe mixer,pause<LF>
- <br>
- 04:20:00:12:23:45 mixer volume 25<LF>
- <br>
- 04:20:00:12:23:45 pause<LF>
+ Response: "subscribe mixer,pause<LF>"
+ <br>
+ "04:20:00:12:23:45 mixer volume 25<LF>"
+ <br>
+ "04:20:00:12:23:45 pause<LF>"
<br>
...
</p>
</blockquote>
<br>
-<p>
+<p id="pref">
<strong>
<code>
pref
@@ -781,7 +842,33 @@
</p>
<p>
The "pref" command allows the caller to set and query the
- SlimServer's internal preferences values.
+ SlimServer's internal preference values. The following affect the
+ behaviour of CLI queries and commands:
+ <ul>
+ <li>
+ <b>authorize</b>: Security enabled or not. If enabled, usage of
+ the "<a href="#login">login</a>" command is required.
+ </li>
+ <li>
+ <b>groupdiscs</b>: handling of multiple disc sets. Affects the
+ "<a href="#albums">albums</a>" query.
+ </li>
+ <li>
+ <b>variousArtistAutoIdentification</b>: compilation artists are
+ listed as "Various Artists". Affects the
+ "<a href="#artists">artists</a>" query.
+ </li>
+ <li>
+ <b>splitList</b>: delimiter for multiple items in tags. Affects the
+ "<a href="#genres">genres</a>" query.
+ </li>
+ <li>
+ <b>composerInArtists</b>, <b>conductorInArtists</b>,
+ <b>bandInArtists</b>: contributors considered artists. Affects the
+ "<a href="#info total artists ?">info total artists ?</a>"
+ query.
+ </li>
+ </ul>
</p>
<p>
Examples:
@@ -802,60 +889,172 @@
</p>
</blockquote>
-<br><p><strong><code>exit</code></strong><br></p>
-<p>The "exit" command closes the TCP connection with the server.</p>
-<p>Examples:</p>
-<blockquote>
- <p>Request: "exit<LF>"<br>
- Response: "exit<LF>"<br>
- (Connection terminated)</p>
-</blockquote>
-
-<br><p id="shutdown"><strong><code>shutdown</code></strong><br></p>
-<p>The "shutdown" command shuts down the server. The CLI connection
- is terminated. Note that obviously, there is no symmetrical command to
- restart the server.</p>
-<p>Examples:</p>
-<blockquote>
- <p>Request: "shutdown<LF>"<br>
- Response: "shutdown<LF>"<br>
- (Connection terminated)</p>
-</blockquote>
-
-<br><p id="version"><strong><code>version</code></strong><br></p>
-<p>The "version" queries the server for its version number.</p>
-<p>Examples:</p>
-<blockquote>
- <p>Request: "version ?<LF>"<br>
- Response: "version 6.0.2<LF>"<br></p>
-</blockquote>
-
+<br>
+<p id="debug">
+ <strong>
+ <code>
+ debug
+ <debugflag>
+ <0|1|?|>
+ </code>
+ </strong>
+</p>
+<p>
+ The "debug" command allows the caller to query, clear, set
+ or toggle the server's internal debug flags. Use 0 to clear, 1
+ to set, ? to query and no parameter to toggle the debug flag
+ value.
+</p>
+<p>
+ Examples:
+</p>
+<blockquote>
+ <p>
+ Request: "debug d_files ?<LF>"
+ <br>
+ Response: "debug d_files 0<LF>"
+ </p>
+ <p>
+ Request: "debug d_itunes 0<LF>"
+ <br>
+ Response: "debug d_itunes 0<LF>"
+ </p>
+ <p>
+ Request: "debug d_stream 1<LF>"
+ <br>
+ Response: "debug d_stream 1<LF>"
+ </p>
+ <p>
+ Request: "debug d_stream<LF>"
+ <br>
+ Response: "debug d_stream 0<LF>"
+ </p>
+</blockquote>
+
+<br>
+<p id="exit">
+ <strong>
+ <code>
+ exit
+ </code>
+ </strong>
+</p>
+<p>
+ The "exit" command closes the TCP connection with the server.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "exit<LF>"
+ <br>
+ Response: "exit<LF>"
+ <br>
+ (Connection terminated)
+ </p>
+</blockquote>
+
+<br>
+<p id="shutdown">
+ <strong>
+ <code>
+ shutdown
+ </code>
+ </strong>
+</p>
+<p>
+ The "shutdown" command shuts down the server. The CLI connection
+ is terminated. Note that, obviously, there is no symmetrical command to
+ restart the server.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "shutdown<LF>"
+ <br>
+ Response: "shutdown<LF>"
+ <br>
+ (Connection terminated)
+ </p>
+</blockquote>
+
+
+<!----------------------------------------------------------------------------->
+<!-- PLAYER COMMANDS -->
+<!----------------------------------------------------------------------------->
<hr>
-<h4 id="PC">Players commands and queries</h4>
-
-<p><strong><code>player count ?</code></strong></p>
-<p>The "player count" command returns the number of players defined in the system.</p>
-<blockquote>
- <p> Request: "player count ?<LF>"<br>
- Response: "player count 2<LF>"</p>
-</blockquote>
-
-<br>
-<p>
+<h2 id="PC">
+ Players commands and queries
+</h2>
+<ul>
+ <li>
+ <strong><code><a href="#player count ?">player count ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#player id ?">player id ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#player name ?">player name ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#player ip ?">player ip ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#player model ?">player model ?</a></code></strong>
+ </li>
+<!-- MISSING COMMANDS HERE ! -->
+ <li>
+ <strong><code><a href="#connected ?">connected ?</a></code></strong>
+ </li>
+</ul>
+
+<p id="player count ?">
+ <strong>
+ <code>
+ player
+ count
+ ?
+ </code>
+ </strong>
+</p>
+<p>
+ The "player count ?" query returns the number of players
+ connected to the server.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "player count ?<LF>"
+ <br>
+ Response: "player count 2<LF>"
+ </p>
+</blockquote>
+
+<br>
+<p id="player id ?">
<strong>
<code>
player
id
- <playerindex|playerid>
+ <playerindex>
?
</code>
</strong>
</p>
<p>
- The "player id" command returns the unique identifier of a player,
+ The "player id ?" query returns the unique identifier of a player,
(<playerid> parameter of many CLI commands). For physical Slim Devices
players this is generally the MAC address. The IP address is used for remote
streams.
+</p>
+<p>
+ Example:
+</p>
<blockquote>
<p>
Request: "player id 0 ?<LF>"
@@ -864,25 +1063,61 @@
</p>
</blockquote>
-<br><p><strong><code>player name <playerindex|playerid> ?</code></strong></p>
-<p>The "player name" command returns the human-readable name for the
- specified player. If the name has not been specified by the user in the Player
- Settings, then a default name will be used, usually the IP address.</p>
-<blockquote>
- <p> Request: "player name 0 ?<LF>"<br>
- Response: "player name 0 Living Room<LF>"</p>
+<br>
+<p id="player name ?">
+ <strong>
+ <code>
+ player
+ name
+ <playerindex|playerid>
+ ?
+ </code>
+ </strong>
+</p>
+<p>
+ The "player name ?" query returns the human-readable name for the
+ specified player. If the name has not been specified by the user in the
+ Player Settings, then a default name will be used, usually the IP address.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "player name 0 ?<LF>"
+ <br>
+ Response: "player name 0 Living Room<LF>"
+ </p>
</blockquote>
-<br><p><strong><code>player ip <playerindex|playerid> ?</code></strong></p>
-<p>The "player ip" command returns the IP address (along with port number) of the specified player.
-Note that the IP address and or port may change if the player reconnects or is rebooted. Use the playerid to uniquely identify the player.</p>
-<blockquote>
- <p> Request: "player ip 0 ?<LF>"<br>
- Response: "player ip 0 192.168.1.22:3483<LF>"</p>
-</blockquote>
-
-<br>
-<p>
+<br>
+<p id="player ip ?">
+ <strong>
+ <code>
+ player
+ ip
+ <playerindex|playerid>
+ ?
+ </code>
+ </strong>
+</p>
+<p>
+ The "player ip ?" query returns the IP address (along with port
+ number) of the specified player.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "player ip 0 ?<LF>"
+ <br>
+ Response: "player ip 0 192.168.1.22:3483<LF>"
+ </p>
+</blockquote>
+
+<br>
+<p id="player model ?">
<strong>
<code>
player
@@ -893,10 +1128,13 @@
</strong>
</p>
<p>
- The "player model" command returns the model of the player,
- currently one of "squeezebox2", "squeezebox",
- "slimp3", "softsqueeze", or "http" (for
- remote streaming connections).
+ The "player model ?" query returns the model of the player,
+ currently one of "transporter", "squeezebox2",
+ "squeezebox", "slimp3", "softsqueeze",
+ or "http" (for remote streaming connections).
+</p>
+<p>
+ Example:
</p>
<blockquote>
<p>
@@ -905,6 +1143,7 @@
Response: "player model squeezebox<LF>"
</p>
</blockquote>
+
<br><p><strong><code>player displaytype <playerindex|playerid> ?</code></strong></p>
<p>The "player displaytype" command returns the display model of the player. Graphical
@@ -1003,7 +1242,7 @@
</blockquote>
<br>
-<p>
+<p id="connected ?">
<strong>
<code>
<playerid>
@@ -1013,9 +1252,9 @@
</strong>
</p>
<p>
- Returns the connected state of the player. HTTP and Squeezebox players
- will indicate 1 or 0 depending on the state of the TCP connection to the
- player. SLIMP3 players, since they use UDP, always return 1.
+ Returns the connected state of the player, 1 or 0 depending on the state of
+ the TCP connection to the player. SLIMP3 players, since they use UDP,
+ always return 1.
</p>
<p>
Examples:
@@ -1072,21 +1311,42 @@
<p>Request: "04:20:00:12:23:45 mixer muting<LF>"<br>Response: "04:20:00:12:23:45 mixer muting<LF>"</p>
</blockquote>
-<br><p id ="mixerbass"><strong>
- <code><playerid> mixer bass <0 .. 100|-100 .. +100|?></code>
-</strong></p>
-<p>The "mixer bass" command returns or sets the current bass setting
- for the player. This is only supported by SliMP3 and SqueezeBox (SB1)
- players. For more information on the 0 to 100 scale, please refer to
- the "<a href="#volume">mixer volume</a>" command. </p>
-<p> Example: </p>
-<blockquote>
- <p>Request: "04:20:00:12:23:45 mixer bass ?<LF>"
- <br>Response: "04:20:00:12:23:45 mixer bass 98<LF>"</p>
- <p>Request: "04:20:00:12:23:45 mixer bass 25<LF>"
- <br>Response: "04:20:00:12:23:45 mixer bass 25<LF>"</p>
- <p>Request: "04:20:00:12:23:45 mixer bass +10<LF>"
- <br>Response: "04:20:00:12:23:45 mixer bass +10<LF>"</p>
+<br>
+<p id ="mixerbass">
+ <strong>
+ <code>
+ <playerid>
+ mixer
+ bass
+ <0 .. 100|-100 .. +100|?>
+ </code>
+ </strong>
+</p>
+<p>
+ The "mixer bass" command returns or sets the current bass setting
+ for the player. This is only supported by SliMP3 and SqueezeBox (SB1)
+ players. For more information on the 0 to 100 scale, please refer to
+ the "<a href="#volume">mixer volume</a>" command.
+</p>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "04:20:00:12:23:45 mixer bass ?<LF>"
+ <br>
+ Response: "04:20:00:12:23:45 mixer bass 98<LF>"
+ </p>
+ <p>
+ Request: "04:20:00:12:23:45 mixer bass 25<LF>"
+ <br>
+ Response: "04:20:00:12:23:45 mixer bass 25<LF>"
+ </p>
+ <p>
+ Request: "04:20:00:12:23:45 mixer bass +10<LF>"
+ <br>
+ Response: "04:20:00:12:23:45 mixer bass +10<LF>"
+ </p>
</blockquote>
<br><p id="mixertreble"><strong>
@@ -1368,7 +1628,7 @@
<p>Request: "04:20:00:12:23:45 playerpref doublesize ?"<br>Response: "04:20:00:12:23:45 playerpref doublesize 1"</p>
<p>Request: "04:20:00:12:23:45 playerpref doublesize 0"<br>Response: "04:20:00:12:23:45 playerpref doublesize 0"</p>
</blockquote>
-
+<!-- doublesize -->
<br><p id="button"><strong><code><playerid> button <buttoncode></code></strong></p>
<p>The "button" command simulates a button press. Valid button codes correspond to the functions defined in the Default.map file.
<p>Example:</p>
@@ -1515,7 +1775,7 @@
</td>
<td>
Player unique identifier. Equivalent to
- "player id <playerindex> ?".
+ "<a href="#player id ?">player id ?</a>".
</td>
</tr>
<tr>
@@ -1524,7 +1784,7 @@
</td>
<td>
Player IP and port. Equivalent to
- "player ip <playerindex> ?".
+ "<a href="#player ip ?">player ip ?</a>".
</td>
</tr>
<tr>
@@ -1533,7 +1793,7 @@
</td>
<td>
Player name. Equivalent to
- "player name <playerindex> ?".
+ "<a href="#player name ?">player name ?</a>".
</td>
</tr>
<tr>
@@ -1542,7 +1802,7 @@
</td>
<td>
Player model. Equivalent to
- "player model <playerindex> ?".
+ "<a href="#player model ?">player model ?</a>".
</td>
</tr>
<tr>
@@ -1761,9 +2021,69 @@
<LF>"</p>
</blockquote>
+<!----------------------------------------------------------------------------->
+<!-- DATABASE COMMANDS -->
+<!----------------------------------------------------------------------------->
<hr>
-<h4 id="DB">Database commands and queries</h4>
-
+<h2 id="DB">
+ Database commands and queries
+</h2>
+<ul>
+ <li>
+ <strong><code><a href="#rescan">rescan</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#wipecache">wipecache</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#info total genres ?">info total genres ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#info total artists ?">info total artists ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#info total albums ?">info total albums ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#info total songs ?">info total songs ?</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#genres">genres</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#artists">artists</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#albums">albums</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlists">playlists</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlists tracks">playlists tracks</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlists rename">playlists rename</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlists delete">playlists delete</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlists edit">playlists edit</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#songinfo">songinfo</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#titles">titles</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#search">search</a></code></strong>
+ </li>
+</ul>
+
+
+<br>
<p id="rescan">
<strong>
<code>
@@ -1824,7 +2144,7 @@
</blockquote>
<br>
-<p id="info total genres">
+<p id="info total genres ?">
<strong>
<code>
info
@@ -1850,7 +2170,7 @@
</blockquote>
<br>
-<p id="info total artists">
+<p id="info total artists ?">
<strong>
<code>
info
@@ -1863,8 +2183,8 @@
<p>
The "info total artists ?" query returns the number of unique
artists in the server music database. The "Composer, band and
- orchestra in artists" setting of the server determines which
- contributors are considered "artists".
+ orchestra in artists" preference (Server Settings, Behavior) determines
+ which contributors are considered artists.
</p>
<p>
Examples:
@@ -1878,7 +2198,7 @@
</blockquote>
<br>
-<p id="info total albums">
+<p id="info total albums ?">
<strong>
<code>
info
@@ -1904,7 +2224,7 @@
</blockquote>
<br>
-<p id="info total songs">
+<p id="info total songs ?">
<strong>
<code>
info
@@ -1944,15 +2264,15 @@
The "genres" query returns all genres known by the server.
<br>
Note that the server supports multiple genres per track, depending
- on the configuration of the "Multiple items in tags" parameter
- in the "Behavior" tab of the server settings.
+ on the "Multiple items in tags" preference (Server Settings,
+ Behavior).
</p>
<p>
Accepted tagged parameters:
</p>
<table border="0" spacing="50">
<tr>
- <td width="150">
+ <td width="100">
<b>Tag</b>
</td>
<td>
@@ -1970,12 +2290,11 @@
</tr>
<tr>
<td>
- contributor_id|artist_id
- </td>
- <td>
- Limit results to those genres proposed by the contributor
- identified by "contributor_id". "artist_id" is
- also accepted.
+ artist_id
+ </td>
+ <td>
+ Limit results to those genres proposed by the artist
+ identified by "artist_id".
</td>
</tr>
<tr>
@@ -1993,8 +2312,16 @@
</td>
<td>
Limit results to the genres of the track identified by
- "track_id". If present, "contributor_id" and
- "album_id" are ignored.
+ "track_id". If present, other filters are ignored.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ year
+ </td>
+ <td>
+ Limit results to the genres of the tracks of the given
+ "year".
</td>
</tr>
<tr>
@@ -2036,7 +2363,7 @@
<td>
Number of results returned by the query. If no filter parameter is
present, this is the same value as returned by
- "<a href="#info total genres">info total genres ?</a>".
+ "<a href="#info total genres ?">info total genres ?</a>".
</td>
</tr>
<tr>
@@ -2086,67 +2413,154 @@
</p>
</blockquote>
-<br><p id="artists"><strong><code>artists <start> <itemsPerResponse> <taggedParameters></code></strong></p>
-<p>The "artists" command returns all artists known by the SlimServer.</p>
-<p>Accepted tagged parameters:</p>
+
+<br>
+<p id="artists">
+ <strong>
+ <code>
+ artists
+ <start>
+ <itemsPerResponse>
+ <taggedParameters>
+ </code>
+ </strong>
+</p>
+<p>
+ The "artists" query returns all artists known by the server.
+ The results of this query depend in part on the "Compilations"
+ preference (Server Settings, Behavior). The "Various Artists"
+ pseudo-artist appears if the server groups compilations.
+</p>
+<p>
+ Accepted tagged parameters:
+</p>
<table border="0" spacing="50">
<tr>
- <td width="100"><b>Tag</b></td>
- <td><b>Description</b></td>
- </tr>
- <tr>
- <td>search</td>
- <td>Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.</td>
- </tr>
- <tr>
- <td>genre_id</td>
- <td>Genre ID, to restrict the results to those artists with songs of that genre.</td>
- </tr>
- <tr>
- <td>album_id</td>
- <td>Album ID, to restrict the results to those artists with songs of that album.</td>
- </tr>
- <tr>
- <td>charset</td>
- <td>Character set to use to return data. See
- <a href="#Notes">charset notes</a> above.</td>
+ <td width="100">
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ search
+ </td>
+ <td>
+ Search substring. The search is case insensitive and obeys the
+ "Search Within Words" server parameter.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ genre_id
+ </td>
+ <td>
+ Genre ID, to restrict the results to those artists with songs of
+ that genre.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ album_id
+ </td>
+ <td>
+ Album ID, to restrict the results to those artists with songs of
+ that album.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ charset
+ </td>
+ <td>
+ Character set to use to return data. See
+ <a href="#Notes">charset notes</a> above.
+ </td>
</tr>
</table>
-<p>Returned tagged parameters:</p>
+<p>
+ Returned tagged parameters:
+</p>
<table border="0" spacing="50">
<tr>
- <td width="100"><b>Tag</b></td>
- <td><b>Description</b></td>
- </tr>
- <tr>
- <td>rescan</td>
- <td>Returned with value 1 if the SlimServer is still scanning the database. The results may therefore be incomplete.
- Not returned if no scan is in progress.</td>
- </tr>
- <tr>
- <td>count</td>
- <td>Number of results returned by the query. If no search string is present, this is the same value as returned by "info total artists ?"</td>
- </tr>
- <tr>
- <td><em>For each artist:</em></td>
- <td></td>
- </tr>
- <tr>
- <td> <b>id</b></td>
- <td>Artist ID. Item delimiter.</td>
- </tr>
- <tr>
- <td> artist</td>
- <td>Artist name.</td>
+ <td width="100">
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ rescan
+ </td>
+ <td>
+ Returned with value 1 if the SlimServer is still scanning the
+ database. The results may therefore be incomplete. Not returned if
+ no scan is in progress.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ count
+ </td>
+ <td>
+ Number of results returned by the query. If no search string is
+ present, this is the same value as returned by
+ "<a href="#info total artists ?">info total artists ?</a>"
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <em>For each artist:</em>
+ </td>
+ <td>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>id</b>
+ </td>
+ <td>
+ Artist ID. Item delimiter.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ artist
+ </td>
+ <td>
+ Artist name.
+ </td>
</tr>
</table>
-<p>Example:</p>
-<blockquote>
- <p> Request: "artists 0 5<LF>"<br>
- Response: artists 0 5 count:7 id:2 artist:Anastacia id:3 artist:Calogero id:4 artist:Evanescence id:5 artist:Leftfield%20%26%20Lydon id:18 artist:Llorca<LF>"</p>
- <p> Request: "artists 0 5 genre_id:7<LF>"<br>
- Response: artists 0 5 genre_id:7 count:2 id:2 artist:Anastacia id:19 artist:Sarah%20Connor<LF>"</p>
-</blockquote>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "artists 0 5<LF>"
+ <br>
+ Response: "artists 0 5 count:7
+ id:2 artist:Anastacia
+ id:3 artist:Calogero
+ id:4 artist:Evanescence
+ id:5 artist:Leftfield%20%26%20Lydon
+ id:18 artist:Llorca
+ <LF>"
+ </p>
+ <p>
+ Request: "artists 0 5 genre_id:7<LF>"
+ <br>
+ Response: "artists 0 5 genre_id:7 count:2
+ id:2 artist:Anastacia
+ id:19 artist:Sarah%20Connor
+ <LF>"
+ </p>
+</blockquote>
+
<br>
<p id="albums">
@@ -2160,9 +2574,9 @@
</strong>
</p>
<p>
- The "albums" command returns all albums known by SlimServer.
+ The "albums" query returns all albums known by the server.
The results of this query depend in part on the "Group discs"
- setting of SlimServer (Server settings, Behavior "tab").
+ preference (Server Settings, Behavior).
</p>
<p>
Accepted tagged parameters:
@@ -2196,12 +2610,21 @@
</tr>
<tr>
<td>
- contributor_id|artist_id
- </td>
- <td>
- Contributor ID, to restrict the results to those albums having
- "contributor_id" as primary contributor.
- "artist_id" is also accepted.
+ artist_id
+ </td>
+ <td>
+ Artist ID, to restrict the results to those albums by
+ "artist_id".
+ </td>
+ </tr>
+ <tr>
+ <td>
+ track_id
+ </td>
+ <td>
+ Track ID, to restrict the results to the album of
+ "track_id". If specified, all other filters are
+ ignored.
</td>
</tr>
<tr>
@@ -2210,6 +2633,25 @@
</td>
<td>
Year, to restrict the results to those albums of that year.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ compilation
+ </td>
+ <td>
+ Compilation, to restrict the results to those albums that are (1)
+ or aren't (0) compilations.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ sort
+ </td>
+ <td>
+ Sort order of the returned list of albums. One of "album",
+ (the default) or "new" (which enables to replicate the
+ "New Music" browse mode of the web interface).
</td>
</tr>
<tr>
@@ -2236,8 +2678,8 @@
</p>
<table border="0" spacing="50">
<tr>
- <td></td>
- <td width="100">
+ <td width="15"></td>
+ <td width="135">
<b>Tag</b>
</td>
<td>
@@ -2263,7 +2705,7 @@
<td>
Number of results returned by the query. If no filter
is present, this is the same value as returned by
- "info total albums ?"
+ "<a href="#info total albums ?">info total albums ?</a>"
</td>
</tr>
<tr>
@@ -2292,18 +2734,6 @@
Album name, including SlimServer's added "(N of M)" if
the server is set to group multi disc albums together.
See tag "title" for the unmodified value.
- </td>
- </tr>
- <tr>
- <td>
- a
- </td>
- <td>
- contributor_id
- </td>
- <td>
- The album "primary" contributor, as determined by
- the server (f.e. "Various Artists").
</td>
</tr>
<tr>
@@ -2379,15 +2809,34 @@
</td>
</tr>
</table>
-<p>Example:</p>
-<blockquote>
- <p> Request: "albums 0 4<LF>"<br>
- Response: "albums 0 4 count:14 id:1 album:Amadeus%20(Disc%201%20of%202) id:4 album:Anastacia id:5 album:Bounce%20[Single] id:6 album:Fallen<LF>"</p>
- <p> Request: "albums 0 5 genre_id:7<LF>"<br>
- Response: "albums 0 5 genre_id:7 count:2 id:4 album:Anastacia id:5 album:Bounce%20[Single]<LF>"</p>
- <p> Request: "albums 0 5 artist_id:19<LF>"<br>
- Response: "albums 0 5 artist_id:19 count:1 id:5 album:Bounce%20[Single]<LF>"</p>
-</blockquote>
+<p>
+ Examples:
+</p>
+<blockquote>
+ <p>
+ Request: "albums 0 4<LF>"
+ <br>
+ Response: "albums 0 4 count:14
+ id:1 album:Amadeus%20(Disc%201%20of%202)
+ id:4 album:Anastacia
+ id:5 album:Bounce%20[Single]
+ id:6 album:Fallen<LF>"
+ </p>
+ <p>
+ Request: "albums 0 5 genre_id:7<LF>"
+ <br>
+ Response: "albums 0 5 genre_id:7 count:2
+ id:4 album:Anastacia
+ id:5 album:Bounce%20[Single]<LF>"
+ </p>
+ <p>
+ Request: "albums 0 5 artist_id:19<LF>"
+ <br>
+ Response: "albums 0 5 artist_id:19 count:1
+ id:5 album:Bounce%20[Single]<LF>"
+ </p>
+</blockquote>
+
<br>
<p id="playlists">
@@ -2408,7 +2857,7 @@
</p>
<table border="0" spacing="50">
<tr>
- <td width="150">
+ <td width="100">
<b>Tag</b>
</td>
<td>
@@ -2448,8 +2897,8 @@
</p>
<table border="0" spacing="50">
<tr>
- <td></td>
- <td width="150">
+ <td width="10"></td>
+ <td width="90">
<b>Tag</b>
</td>
<td>
@@ -2553,7 +3002,7 @@
</p>
<table border="0" spacing="50">
<tr>
- <td width="150"><b>Tag</b></td>
+ <td width="100"><b>Tag</b></td>
<td><b>Description</b></td>
</tr>
<tr>
@@ -2622,7 +3071,7 @@
</p>
<table border="0" spacing="50">
<tr>
- <td width="150">
+ <td width="100">
<b>Tag</b>
</td>
<td>
@@ -2722,7 +3171,7 @@
</p>
<table border="0" spacing="50">
<tr>
- <td width="150">
+ <td width="100">
<b>Tag</b>
</td>
<td>
@@ -2767,7 +3216,7 @@
</p>
<table border="0" spacing="50">
<tr>
- <td width="150">
+ <td width="100">
<b>Tag</b>
</td>
<td>
@@ -2838,126 +3287,240 @@
</blockquote>
<br>
- <p id="songinfo">
- <strong>
- <code>songinfo <start> <itemsPerResponse>
- <taggedParameters>
- </code>
- </strong>
- </p>
- <p>The "songinfo" command returns all the information on a song
- known by the SlimServer. Please note that the <start> and
- <itemsPerResponse> parameters apply to the individual data fields
- below and not, as they do in other extended CLI queries, to the number
- or songs (or artists, genres, etc.) returned; the
- "songinfo" only ever returns information about a single song.</p>
- <p>Accepted tagged parameters:</p>
+<p id="songinfo">
+ <strong>
+ <code>
+ songinfo
+ <start>
+ <itemsPerResponse>
+ <taggedParameters>
+ </code>
+ </strong>
+</p>
+<p>
+ The "songinfo" command returns all the information on a song
+ known by the server. Please note that the <start> and
+ <itemsPerResponse> parameters apply to the individual data fields
+ below and not, as they do in other extended CLI queries, to the number
+ or songs (or artists, genres, etc.) returned; the
+ "songinfo" only ever returns information about a single song.
+</p>
+<p>
+ Accepted tagged parameters:
+</p>
<table border="0" spacing="50">
<tr>
- <td width="100"><b>Tag</b></td>
- <td><b>Description</b></td>
- </tr>
- <tr>
- <td>url</td>
- <td>Song path as returned by other CLI commands. This is a mandatory
- parameter, except if "track_id" is provided.</td>
- </tr>
- <tr>
- <td>track_id</td>
- <td>Track ID as returned by other CLI commands. This is a mandatory
- parameter, except if "url" is provided.</td>
- </tr>
- <tr>
- <td>tags</td>
- <td>Determines which tags are returned. Each returned tag is identified
+ <td width="100">
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ url
+ </td>
+ <td>
+ Song path as returned by other CLI commands. This is a mandatory
+ parameter, except if "track_id" is provided.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ track_id
+ </td>
+ <td>
+ Track ID as returned by other CLI commands. This is a mandatory
+ parameter, except if "url" is provided.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ tags
+ </td>
+ <td>
+ Determines which tags are returned. Each returned tag is identified
by a letter (see below). The default value is all info except the
- url, depending on the given parameter.</td>
- </tr>
- <tr>
- <td>charset</td>
- <td>Character set to use to return data. See
- <a href="#Notes">charset notes</a> above.</td>
+ url, depending on the given parameter.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ charset
+ </td>
+ <td>
+ Character set to use to return data. See
+ <a href="#Notes">charset notes</a> above.
+ </td>
</tr>
</table>
-<p>Returned tagged parameters:</p>
+<p>
+ Returned tagged parameters:
+</p>
<table border="0" spacing="50">
<tr>
- <td></td>
- <td width="100"><b>Tag</b></td>
- <td><b>Description</b></td>
- </tr>
- <tr>
- <td></td>
- <td>rescan</td>
- <td>Returned with value 1 if the SlimServer is still scanning the
+ <td width="10">
+ </td>
+ <td width="90">
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ rescan
+ </td>
+ <td>
+ Returned with value 1 if the SlimServer is still scanning the
database. The results may therefore be incomplete.
- Not returned if no scan is in progress.</td>
- </tr>
- <tr>
- <td></td>
- <td>count</td>
- <td>Number of results returned by the query, that is, total number of
- elements to return for this song.</td>
- </tr>
- <tr>
- <td></td>
- <td>id</td>
- <td>Track ID.</td>
- </tr>
- <tr>
- <td></td>
- <td>title</td>
- <td>Song title</td>
- </tr>
- <tr>
- <td><b>g</b></td>
- <td>genre</td>
- <td>Genre name. Only if known.</td>
- </tr>
- <tr>
- <td><b>p</b></td>
- <td>genre_id</td>
- <td>Genre ID. Only if known.</td>
- </tr>
- <tr>
- <td><b>a</b></td>
- <td>artist</td>
- <td>Artist name. Only if known.</td>
- </tr>
- <tr>
- <td><b>s</b></td>
- <td>artist_id</td>
- <td>Artist ID. Only if known.</td>
- </tr>
- <tr>
- <td><b>c</b></td>
- <td>composer</td>
- <td>Composer name. Only if known.</td>
- </tr>
- <tr>
- <td><b>b</b></td>
- <td>band</td>
- <td>Band name. Only if known.</td>
- </tr>
- <tr>
- <td><b>h</b></td>
- <td>conductor</td>
- <td>Conductor name. Only if known.</td>
- </tr>
- <tr>
- <td><b>l</b></td>
- <td>album</td>
- <td>Album name. Only if known.</td>
- </tr>
- <tr>
- <td><b>e</b></td>
- <td>album_id</td>
- <td>Album ID. Only if known.</td>
- </tr>
- <tr>
- <td><b>d</b></td>
- <td>duration</td>
- <td>Song duration in seconds.</td>
+ Not returned if no scan is in progress.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ count
+ </td>
+ <td>
+ Number of results returned by the query, that is, total number of
+ elements to return for this song.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ id
+ </td>
+ <td>
+ Track ID.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td>
+ title
+ </td>
+ <td>
+ Song title
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>g</b>
+ </td>
+ <td>
+ genre
+ </td>
+ <td>
+ Genre name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>p</b>
+ </td>
+ <td>
+ genre_id
+ </td>
+ <td>
+ Genre ID. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>a</b>
+ </td>
+ <td>
+ artist
+ </td>
+ <td>
+ Artist name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>s</b>
+ </td>
+ <td>
+ artist_id
+ </td>
+ <td>
+ Artist ID. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>c</b>
+ </td>
+ <td>
+ composer
+ </td>
+ <td>
+ Composer name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>b</b>
+ </td>
+ <td>
+ band
+ </td>
+ <td>
+ Band name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>h</b>
+ </td>
+ <td>
+ conductor
+ </td>
+ <td>
+ Conductor name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>l</b>
+ </td>
+ <td>
+ album
+ </td>
+ <td>
+ Album name. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>e</b>
+ </td>
+ <td>
+ album_id
+ </td>
+ <td>
+ Album ID. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>d</b>
+ </td>
+ <td>
+ duration
+ </td>
+ <td>
+ Song duration in seconds.
+ </td>
</tr>
<tr>
<td>
@@ -2982,73 +3545,172 @@
</td>
</tr>
<tr>
- <td><b>t</b></td>
- <td>tracknum</td>
- <td>Track number. Only if known.</td>
- </tr>
- <tr>
- <td><b>y</b></td>
- <td>year</td>
- <td>Song year. Only if known.</td>
- </tr>
- <tr>
- <td><b>m</b></td>
- <td>bpm</td>
- <td>Beats per minute. Only if known.</td>
- </tr>
- <tr>
- <td><b>k</b></td>
- <td>comment</td>
- <td>Song comments, if any.</td>
- </tr>
- <tr>
- <td><b>o</b></td>
- <td>type</td>
- <td>Content type. Only if known.</td>
- </tr>
- <tr>
- <td><b>v</b></td>
- <td>tagversion</td>
- <td>Version of tag information in song file. Only if known.</td>
- </tr>
- <tr>
- <td><b>r</b></td>
- <td>bitrate</td>
- <td>Song bitrate. Only if known.</td>
- </tr>
- <tr>
- <td><b>f</b></td>
- <td>filesize</td>
- <td>Song file length in bytes. Only if known.</td>
- </tr>
- <tr>
- <td><b>z</b></td>
- <td>drm</td>
- <td>Digital rights information. Only if known.</td>
- </tr>
- <tr>
- <td><b>j</b></td>
- <td>coverart</td>
- <td>1 if coverart is available for this song. Not listed otherwise.</td>
- </tr>
- <tr>
- <td><b>n</b></td>
- <td>modificationTime</td>
- <td>Date and time song file was last changed.</td>
- </tr>
- <tr>
- <td>u</td>
- <td>url</td>
- <td>Song file url. Used as <item> parameter for the "playlist
- add" command, for example.</td>
+ <td>
+ <b>t</b>
+ </td>
+ <td>
+ tracknum
+ </td>
+ <td>
+ Track number. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>y</b>
+ </td>
+ <td>
+ year
+ </td>
+ <td>
+ Song year. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>m</b>
+ </td>
+ <td>
+ bpm
+ </td>
+ <td>
+ Beats per minute. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>k</b>
+ </td>
+ <td>
+ comment
+ </td>
+ <td>
+ Song comments, if any.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>o</b>
+ </td>
+ <td>
+ type
+ </td>
+ <td>
+ Content type. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>v</b>
+ </td>
+ <td>
+ tagversion
+ </td>
+ <td>
+ Version of tag information in song file. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>r</b>
+ </td>
+ <td>
+ bitrate
+ </td>
+ <td>
+ Song bitrate. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>f</b>
+ </td>
+ <td>
+ filesize
+ </td>
+ <td>
+ Song file length in bytes. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>z</b>
+ </td>
+ <td>
+ drm
+ </td>
+ <td>
+ Digital rights information. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>j</b>
+ </td>
+ <td>
+ coverart
+ </td>
+ <td>
+ 1 if coverart is available for this song. Not listed otherwise.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>n</b>
+ </td>
+ <td>
+ modificationTime
+ </td>
+ <td>
+ Date and time song file was last changed.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>u</b>
+ </td>
+ <td>
+ url
+ </td>
+ <td>
+ Song file url.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>w</b>
+ </td>
+ <td>
+ lyrics
+ </td>
+ <td>
+ Lyrics. Only if known.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>x</b>
+ </td>
+ <td>
+ remote
+ </td>
+ <td>
+ Remote track.
+ </td>
</tr>
</table>
-<p>Example:</p>
-<blockquote>
- <p> Request: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3<LF>"<br>
- Response: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3 count:6
- id:483 title:Left%20Outside%20Alone genre:Pop artist:Anastacia composer:D.%20Austin/G.%20Ballard album:Anastacia<LF>"</p>
-</blockquote>
+<p>
+ Example:
+</p>
+<blockquote>
+ <p>
+ Request: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3<LF>"
+ <br>
+ Response: "songinfo 0 6 url:file:///Users/dean/slimp3/Music/Anastacia/Anastacia/Left%2520Outside%2520Alone.mp3 count:6
+ id:483 title:Left%20Outside%20Alone genre:Pop artist:Anastacia composer:D.%20Austin/G.%20Ballard album:Anastacia<LF>"
+ </p>
+</blockquote>
+
<br>
<p id="titles">
@@ -3070,14 +3732,10 @@
<table border="0" spacing="50">
<tr>
<td width="100">
- <b>
- Tag
- </b>
- </td>
- <td>
- <b>
- Description
- </b>
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
</td>
</tr>
<tr>
@@ -3160,14 +3818,10 @@
<table border="0" spacing="50">
<tr>
<td width="100">
- <b>
- Tag
- </b>
- </td>
- <td>
- <b>
- Description
- </b>
+ <b>Tag</b>
+ </td>
+ <td>
+ <b>Description</b>
</td>
</tr>
<tr>
@@ -3187,14 +3841,13 @@
<td>
Number of results returned by the query. If no search string or
album/artist/genre filter is present, this is the same value as
- returned by "info total songs ?".
- </td>
- </tr>
- <tr>
- <td>
- <em>
- For each title:
- </em>
+ returned by
+ "<a href="#info total songs ?">info total songs ?</a>".
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <em>For each title:</em>
</td>
<td>
</td>
@@ -3236,6 +3889,7 @@
url:...<LF>"
</p>
</blockquote>
+
<br>
<p id="search">
@@ -3462,8 +4116,14 @@
</blockquote>
+<!----------------------------------------------------------------------------->
+<!-- PLAYLIST COMMANDS -->
+<!----------------------------------------------------------------------------->
+
<hr>
-<h4 id="PL">Playlist commands and queries</h4>
+<h2 id="PL">
+ Playlist commands and queries
+</h2>
<p id="play">
<strong>
@@ -3590,7 +4250,7 @@
</blockquote>
<br>
-<p id="title">
+<p id="cursonginfo">
<strong>
<code>
<playerid> genre ?
@@ -4365,7 +5025,7 @@
signalstrength
</td>
<td>
- Signal strength (only for Squeezeboxen).
+ Signal strength (only for Squeezeboxen and Transporters).
</td>
</tr>
<tr>
@@ -4638,8 +5298,14 @@
</blockquote>
+<!----------------------------------------------------------------------------->
+<!-- NOTIFICATIONS -->
+<!----------------------------------------------------------------------------->
+
<hr>
-<h4 id="NC">Notifications</h4>
+<h2 id="NC">
+ Notifications
+</h2>
<p>
All commands listed in this document are notifications as well as being
commands and can be received when using "listen 1" (if they do not
@@ -4653,6 +5319,7 @@
with strange text representations.
</p>
+<br>
<p>
<strong>
<code>
@@ -4720,10 +5387,15 @@
" information is provided for convenience).
</p>
+
+<!----------------------------------------------------------------------------->
+<!-- PLUGIN COMMANDS -->
+<!----------------------------------------------------------------------------->
+
<hr>
-<h4 id="PG">
+<h2 id="PG">
Plugins commands and queries
-</h4>
+</h2>
<p>
The following command and queries are proposed by SlimServer plugins. The
plugin must be enabled in the SlimServer configuration for the commands
@@ -4731,11 +5403,25 @@
"<a href="#can">can</a>" to determine if the given command or
query is available.
<p>
-
-
-<h5>
+<ul>
+ <li>
+ <strong><a href="#XMLBrowser">Slimdevices Picks, Shoutcast, Podcast, Live Music Archive, RadioIO & RSS</a></strong>
+ </li>
+ <li>
+ <strong><a href="#Live365">Live365</a></strong>
+ </li>
+ <li>
+ <strong><a href="#Favorites">Favorites</a></strong>
+ </li>
+ <li>
+ <strong><a href="#RandomPlay">RandomPlay</a></strong>
+ </li>
+</ul>
+
+<br>
+<h3 id="XMLBrowser">
Slimdevices Picks, Shoutcast, Podcast, Live Music Archive, RadioIO & RSS
-</h5>
+</h3>
<p>
<strong>
<code>
@@ -4983,9 +5669,9 @@
</blockquote>
-<h5>
+<h3 id="Live365">
Live365
-</h5>
+</h3>
<p id="live365 genres">
<strong>
@@ -5154,7 +5840,8 @@
sort
</td>
<td>
- Sort order of the returned list of stations. One of "name", "bitrate", "rating" or
+ Sort order of the returned list of stations. One of
+ "name", "bitrate", "rating" or
"listeners". If no parameter is given, the default set
in the web interface applies.
</td>
@@ -5399,7 +6086,9 @@
-<h5>Favorites</h5>
+<h3 id="Favorites">
+ Favorites
+</h3>
<p>
<strong>
@@ -5540,8 +6229,11 @@
</blockquote>
-<h5>RandomPlay</h5>
-<p>
+<h3 id="RandomPlay">
+ RandomPlay
+</h3>
+
+<p id="randomplay">
<strong>
<code>
<playerid>
@@ -5566,15 +6258,29 @@
</blockquote>
+<!----------------------------------------------------------------------------->
+<!-- DEPRECATED COMMANDS -->
+<!----------------------------------------------------------------------------->
<hr>
-<h4 id="DC">Deprecated commands and queries</h4>
+<h2 id="DC">
+ Deprecated commands and queries
+</h2>
<p>
The following commands are still supported but their usage is not
- recommended.
-</p>
-
-<p id="dc_mode">
+ recommended:
+</p>
+<ul>
+ <li>
+ <strong><code><a href="#mode">mode</a></code></strong>
+ </li>
+ <li>
+ <strong><code><a href="#playlisttracks">playlisttracks</a></code></strong>
+ </li>
+</ul>
+
+<br>
+<p id="mode">
<strong>
<code>
<playerid>
@@ -5585,12 +6291,13 @@
</p>
<p>
The "mode" command allows to set the player playlist
- mode directly. <b>It is deprecated</b>. "mode play" has been replaced
- by "<a href="#play">play</a>" "mode stop"
+ mode directly. <b>It is deprecated</b>. "mode play" has been
+ replaced by "<a href="#play">play</a>" "mode stop"
by "<a href="#stop">stop</a>" and "mode pause"
by "<a href="#pause">pause 1</a>".
</p>
+<br>
<p id="playlisttracks">
<strong>
<code>
Modified: trunk/server/Slim/Control/Queries.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Queries.pm?rev=8842&r1=8841&r2=8842&view=diff
==============================================================================
--- trunk/server/Slim/Control/Queries.pm (original)
+++ trunk/server/Slim/Control/Queries.pm Sun Aug 6 18:12:15 2006
@@ -1,6 +1,6 @@
package Slim::Control::Queries;
-# $Id: Command.pm 5121 2005-11-09 17:07:36Z dsully $
+# $Id: $
#
# SlimServer Copyright (c) 2001-2004 Sean Adams, Slim Devices Inc.
# This program is free software; you can redistribute it and/or
@@ -20,8 +20,6 @@
# There are no important differences between the code for a query and one for
# a command. Please check the commented command in Commands.pm.
-
-
use strict;
use Scalar::Util qw(blessed);
@@ -32,24 +30,6 @@
use Slim::Utils::Unicode;
my $d_queries = 0; # local debug flag
-
-our %searchMap = (
-
- 'artist' => 'contributor.namesearch',
- 'genre' => 'me.namesearch',
- 'album' => 'album.titlesearch',
- 'track' => 'track.titlesearch',
-);
-
-our %searchMap2 = (
-
- 'artist' => 'contributor.namesearch',
- 'contributor' => ['me.namesearch', 'me.namesort'],
- 'genre' => ['me.namesearch', 'me.namesort'],
- 'album' => ['me.titlesearch', 'me.titlesort'],
- 'track' => 'track.titlesearch',
-);
-
sub alarmsQuery {
my $request = shift;
@@ -124,6 +104,130 @@
}
+sub albumsQuery {
+ my $request = shift;
+
+ $d_queries && msg("albumsQuery()\n");
+
+ # check this is the correct query.
+ if ($request->isNotQuery([['albums']])) {
+ $request->setStatusBadDispatch();
+ return;
+ }
+
+ # get our parameters
+ my $index = $request->getParam('_index');
+ my $quantity = $request->getParam('_quantity');
+ my $tags = $request->getParam('tags');
+ my $search = $request->getParam('search');
+ my $compilation = $request->getParam('compilation');
+ my $contributorID = $request->getParam('artist_id');
+ my $genreID = $request->getParam('genre_id');
+ my $trackID = $request->getParam('track_id');
+ my $year = $request->getParam('year');
+ my $sort = $request->getParam('sort');
+
+ if ($request->paramNotOneOfIfDefined($sort, ['new', 'album'])) {
+ $request->setStatusBadParams();
+ return;
+ }
+
+ if (!defined $tags) {
+ $tags = 'l';
+ }
+
+ # get them all by default
+ my $where = {};
+ my $attr = {};
+
+ # Normalize and add any search parameters
+ if (defined $trackID) {
+ $where->{'tracks.id'} = $trackID;
+ push @{$attr->{'join'}}, 'tracks';
+ }
+
+ # ignore everything if $track_id was specified
+ else {
+
+ if ($sort eq 'new') {
+ $attr->{'order_by'} = 'tracks.timestamp desc, tracks.disc, tracks.tracknum, tracks.titlesort';
+ push @{$attr->{'join'}}, 'tracks';
+ }
+
+ if (specified($search)) {
+ $where->{'me.titlesearch'} = {'like', Slim::Utils::Text::searchStringSplit($search)};
+ }
+
+ if (defined $year) {
+ $where->{'me.year'} = $year;
+ }
+
+ # Manage joins
+ if (defined $contributorID){
+
+ # handle the case where we're asked for the VA id => return compilations
+ if ($contributorID == Slim::Schema->variousArtistsObject->id) {
+ $compilation = 1;
+ }
+ else {
+ $where->{'contributorAlbums.contributor'} = $contributorID;
+ push @{$attr->{'join'}}, 'contributorAlbums';
+ $attr->{'distinct'} = 1;
+ }
+ }
+
+ if (defined $genreID){
+ $where->{'genreTracks.genre'} = $genreID;
+ push @{$attr->{'join'}}, {'tracks' => 'genreTracks'};
+ $attr->{'distinct'} = 1;
+ }
+
+ if (defined $compilation) {
+ if ($compilation == 1) {
+ $where->{'me.compilation'} = 1;
+ }
+ if ($compilation == 0) {
+ $where->{'me.compilation'} = [ { 'is' => undef }, { '=' => 0 } ];
+ }
+ }
+ }
+
+ # use the browse standard additions, sort and filters, and complete with
+ # our stuff
+ my $rs = Slim::Schema->rs('Album')->browse->search($where, $attr);
+
+ my $count = $rs->count;
+
+ if (Slim::Music::Import->stillScanning()) {
+ $request->addResult('rescan', 1);
+ }
+
+ $request->addResult('count', $count);
+
+ my ($valid, $start, $end) = $request->normalize(scalar($index), scalar($quantity), $count);
+
+ if ($valid) {
+
+ my $loopname = '@albums';
+ my $cnt = 0;
+
+ for my $eachitem ($rs->slice($start, $end)) {
+ $request->addResultLoop($loopname, $cnt, 'id', $eachitem->id);
+ $tags =~ /l/ && $request->addResultLoop($loopname, $cnt, 'album', $eachitem->title);
+ $tags =~ /y/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'year', $eachitem->year);
+ $tags =~ /j/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'artwork_track_id', $eachitem->artwork);
+ $tags =~ /t/ && $request->addResultLoop($loopname, $cnt, 'title', $eachitem->rawtitle);
+ $tags =~ /i/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'disc', $eachitem->disc);
+ $tags =~ /q/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'disccount', $eachitem->discc);
+ $tags =~ /w/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'compilation', $eachitem->compilation);
+ $cnt++;
+ }
+ }
+
+ $request->setStatusDone();
+}
+
+
sub artistsQuery {
my $request = shift;
@@ -152,11 +256,15 @@
'order_by' => 'me.namesort',
'distinct' => 'me.id'
};
+
+ # same for the VA search
+ my $where_va = {'me.compilation' => 1};
+ my $attr_va = {};
# Normalize any search parameters
if (specified($search)) {
- $where->{'me.namesearch'} = {'like', Slim::Web::Pages::Search::searchStringSplit($search)};
+ $where->{'me.namesearch'} = {'like', Slim::Utils::Text::searchStringSplit($search)};
}
# Manage joins
@@ -168,38 +276,75 @@
if (defined $genreID) {
$where->{'genreTracks.genre'} = $genreID;
push @{$attr->{'join'}}, {'contributorTracks' => {'track' => 'genreTracks'}};
+
+ $where_va->{'genreTracks.genre'} = $genreID;
+ push @{$attr_va->{'join'}}, {'tracks' => 'genreTracks'};
}
if (defined $albumID || defined $year) {
+
if (defined $albumID) {
$where->{'track.album'} = $albumID;
- }
+
+ $where_va->{'me.id'} = $albumID;
+ }
+
if (defined $year) {
$where->{'track.year'} = $year;
- }
+
+ $where_va->{'track.year'} = $year;
+ }
+
if (!defined $genreID) {
# don't need to add track again if we have a genre search
push @{$attr->{'join'}}, {'contributorTracks' => 'track'};
- }
- }
- }
-
+
+ # same logic for VA search
+ if (defined $year) {
+ push @{$attr->{'join'}}, 'track';
+ }
+ }
+ }
+ }
+
if (Slim::Music::Import->stillScanning()) {
$request->addResult('rescan', 1);
}
my $rs = Slim::Schema->rs('Contributor')->browse->search($where, $attr);
- my $count = $rs->count;
+
+ # Various artist handling. Don't do if pref is off, or if we're
+ # searching, or if we have a track
+ my $count_va = 0;
+
+ if (Slim::Utils::Prefs::get('variousArtistAutoIdentification') &&
+ !defined $search && !defined $trackID) {
+
+ # Only show VA item if there are any
+ $count_va = Slim::Schema->rs('Album')->search($where_va, $attr_va)->count;
+ }
+
+ my $count = $rs->count + ($count_va?1:0);
$request->addResult('count', $count);
my ($valid, $start, $end) = $request->normalize(scalar($index), scalar($quantity), $count);
- if ($valid) {
+ if ($valid || $count) {
my $loopname = '@artists';
my $cnt = 0;
+
+ # Various artist handling. Don't do if pref is off, or if we're
+ # searching, or if we have a track
+ if ($count_va) {
+ my $vaObj = Slim::Schema->variousArtistsObject;
+
+ $request->addResultLoop($loopname, $cnt, 'id', $vaObj->id);
+ $request->addResultLoop($loopname, $cnt, 'artist', $vaObj->name);
+ $cnt++;
+ }
for my $eachitem ($rs->slice($start, $end)) {
$request->addResultLoop($loopname, $cnt, 'id', $eachitem->id);
@@ -212,214 +357,6 @@
}
-sub albumsQuery {
- my $request = shift;
-
- $d_queries && msg("albumsQuery()\n");
-
- # check this is the correct query.
- if ($request->isNotQuery([['albums']])) {
- $request->setStatusBadDispatch();
- return;
- }
-
- # get our parameters
- my $index = $request->getParam('_index');
- my $quantity = $request->getParam('_quantity');
- my $tags = $request->getParam('tags');
- my $search = $request->getParam('search');
- my $artistID = $request->getParam('artist_id');
- my $contributorID = $request->getParam('contributor_id');
- my $genreID = $request->getParam('genre_id');
- my $year = $request->getParam('year');
-
- # we prefer to get contributor_id but accept artist_id
- if (defined $artistID && !defined $contributorID) {
- $contributorID = $artistID;
- }
-
- if (!defined $tags) {
- $tags = 'l';
- }
-
- # get them all by default
- my $where = {};
-
- # sort them
- my $attr = {
- order_by => 'me.titlesort, me.disc',
- };
-
- # Normalize and add any search parameters
- if (specified($search)) {
- $where->{'me.titlesearch'} = {'like', Slim::Web::Pages::Search::searchStringSplit($search)};
- }
-
- if (defined $year) {
- $where->{'me.year'} = $year;
- }
-
- if (defined $contributorID){
- $where->{'me.contributor'} = $contributorID;
- }
-
- # Manage joins
-# if (defined $contributorID){
-# $where->{'contributor.id'} = $contributorID;
-# $attr->{'join'} = {'genreTracks' => {'track' => {'contributorTracks' => 'contributor'}}};
-# $attr->{'distinct'} = 1;
-# }
-
- if (defined $genreID){
- $where->{'genre.id'} = $genreID;
- $attr->{'join'} = {'tracks' => {'genreTracks' => 'genre'}};
- $attr->{'distinct'} = 1;
- }
-
- if (Slim::Music::Import->stillScanning()) {
- $request->addResult('rescan', 1);
- }
-
-# my $rs = Slim::Schema->resultset('Album')->search($where, $attr);
- my $rs = Slim::Schema->resultset('Album')->browse($where);
-
- my $count = $rs->count;
-
- $request->addResult('count', $count);
-
- my ($valid, $start, $end) = $request->normalize(scalar($index), scalar($quantity), $count);
-
- if ($valid) {
-
- my $loopname = '@albums';
- my $cnt = 0;
-
- for my $eachitem ($rs->slice($start, $end)) {
- $request->addResultLoop($loopname, $cnt, 'id', $eachitem->id);
- $tags =~ /l/ && $request->addResultLoop($loopname, $cnt, 'album', $eachitem->title);
- $tags =~ /a/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'contributor_id', $eachitem->contributorid);
- $tags =~ /y/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'year', $eachitem->year);
- $tags =~ /j/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'artwork_track_id', $eachitem->artwork);
- $tags =~ /t/ && $request->addResultLoop($loopname, $cnt, 'title', $eachitem->rawtitle);
- $tags =~ /i/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'disc', $eachitem->disc);
- $tags =~ /q/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'disccount', $eachitem->discc);
- $tags =~ /w/ && $request->addResultLoopIfValueDefined($loopname, $cnt, 'compilation', $eachitem->compilation);
- $cnt++;
- }
- }
-
- $request->setStatusDone();
-}
-
-
-sub contributorsQuery {
- my $request = shift;
-
- $d_queries && msg("contributorsQuery()\n");
-
- # check this is the correct query.
- if ($request->isNotQuery([['contributors']])) {
- $request->setStatusBadDispatch();
- return;
- }
-
- # get our parameters
-# my $label = $request->getRequest(0);
- my $index = $request->getParam('_index');
- my $quantity = $request->getParam('_quantity');
- my $search = $request->getParam('search');
-# my $genreID = $request->getParam('genre_id');
- my $artistID = $request->getParam('artist_id');
- my $albumID = $request->getParam('album_id');
- my $role = $request->getParam('role');
-
- # get them all by default
- my $where = {};
-
- # sort them
- my $attr = {
- group_by => ['contributor.id', 'me.role'],
- order_by => 'contributor.namesort',
- join => 'contributor',
- prefetch => 'contributor',
-# distinct => 1,
- };
-
-# chop($label);
-
-# if ($label eq 'artist') {
-# $label = 'contributor';
-# }
-
- # Normalize any search parameters
- if (specified($search)) {
-
-# $find->{$searchMap2{$label}->[0]} = Slim::Web::Pages::Search::searchStringSplit($search);
- $where->{'contributor.namesearch'} = { 'like' => Slim::Web::Pages::Search::searchStringSplit($search) };
- }
-
- if (defined($role)) {
- $where->{'me.role'} = $role;
-# $attr->{'join'} = {'contributorTracks'};
- }
-
-# if (defined $genreID){
-
-# $find->{'genre'} = $genreID;
-# }
-
- if (defined $artistID){
- $where->{'contributor.id'} = $artistID;
- $attr->{'join'} = {'genreTracks' => {'track' => {'contributorTracks' => 'contributor'}}};
- $attr->{'distinct'} = 1;
- }
-
- if (defined $albumID){
- $where->{'album.id'} = $albumID;
- $attr->{'join'} = {'genreTracks' => {'track' => 'album'}};
- $attr->{'distinct'} = 1;
- }
-
-# if ($label eq 'artist') {
-
- # The user may not want to include all the composers/conductors
-# if (my $roles = Slim::Schema->artistOnlyRoles) {
-
-# $find->{'contributor_track.role'} = $roles;
-# }
-# }
-
- if (Slim::Music::Import->stillScanning()) {
- $request->addResult('rescan', 1);
- }
-
- my $rs = Slim::Schema->resultset('ContributorTrack')->search($where, $attr);
-
- my $count = $rs->count;
-
- $request->addResult('count', $count);
-
- my ($valid, $start, $end) = $request->normalize(scalar($index), scalar($quantity), $count);
-
- if ($valid) {
-
-# my $loopname = '@' . $label . 's';
- my $loopname = '@contributors';
- my $cnt = 0;
-
- for my $eachitem ($rs->slice($start, $end)) {
-# print Data::Dumper::Dumper($eachitem);
- $request->addResultLoop($loopname, $cnt, 'id', $eachitem->contributor->id);
- $request->addResultLoop($loopname, $cnt, 'contributor', $eachitem->contributor->name);
- $request->addResultLoop($loopname, $cnt, 'role', $eachitem->role);
- $cnt++;
- }
- }
-
- $request->setStatusDone();
-}
-
-
sub cursonginfoQuery {
my $request = shift;
@@ -442,7 +379,6 @@
if ($method eq 'path') {
- $url = Slim::Utils::Unicode::utf8decode_locale(URI::Escape::uri_unescape($url));
$request->addResult("_$method", $url);
} elsif ($method eq 'remote') {
@@ -593,16 +529,11 @@
my $quantity = $request->getParam('_quantity');
my $search = $request->getParam('search');
my $year = $request->getParam('year');
- my $artistID = $request->getParam('artist_id');
- my $contributorID = $request->getParam('contributor_id');
+ my $contributorID = $request->getParam('artist_id');
my $albumID = $request->getParam('album_id');
my $trackID = $request->getParam('track_id');
- # we prefer to get contributor_id but accept artist_id
- if (defined $artistID && !defined $contributorID) {
- $contributorID = $artistID;
- }
-
+
# get them all by default
my $where = {};
@@ -614,7 +545,7 @@
# Normalize and add any search parameters
if (specified($search)) {
- $where->{'me.namesearch'} = {'like', Slim::Web::Pages::Search::searchStringSplit($search)};
+ $where->{'me.namesearch'} = {'like', Slim::Utils::Text::searchStringSplit($search)};
}
# Manage joins
@@ -626,8 +557,16 @@
# ignore those if we have a track.
if (defined $contributorID){
- $where->{'contributorTracks.contributor'} = $contributorID;
- push @{$attr->{'join'}}, {'genreTracks' => {'track' => 'contributorTracks'}};
+
+ # handle the case where we're asked for the VA id => return compilations
+ if ($contributorID == Slim::Schema->variousArtistsObject->id) {
+ $where->{'album.compilation'} = 1;
+ push @{$attr->{'join'}}, {'genreTracks' => {'track' => 'album'}};
+ }
+ else {
+ $where->{'contributorTracks.contributor'} = $contributorID;
+ push @{$attr->{'join'}}, {'genreTracks' => {'track' => 'contributorTracks'}};
+ }
}
if (defined $albumID || defined $year){
@@ -696,7 +635,7 @@
}
if ($entity eq 'songs') {
- $request->addResult("_$entity", Slim::Schema->count('Track', { 'me.audio' => 1 }));
+ $request->addResult("_$entity", Slim::Schema->rs('Track')->browse->count);
}
$request->setStatusDone();
@@ -942,8 +881,7 @@
$request->addResult("_$entity", Slim::Music::Info::standardTitle($client, $playlistObj));
} elsif ($entity eq 'url') {
- my $result = Slim::Utils::Unicode::utf8decode_locale(
- URI::Escape::uri_unescape($client->currentPlaylist()));
+ my $result = $client->currentPlaylist();
$request->addResult("_$entity", $result);
} elsif ($entity eq 'modified') {
@@ -953,8 +891,7 @@
$request->addResult("_$entity", Slim::Player::Playlist::count($client));
} elsif ($entity eq 'path') {
- my $result = Slim::Utils::Unicode::utf8decode_locale(
- URI::Escape::uri_unescape(Slim::Player::Playlist::url($client, $index)));
+ my $result = Slim::Player::Playlist::url($client, $index);
$request->addResult("_$entity", $result || 0);
} elsif ($entity eq 'remote') {
@@ -1078,7 +1015,7 @@
# Normalize any search parameters
if (defined $search) {
- $search = Slim::Web::Pages::Search::searchStringSplit($search);
+ $search = Slim::Utils::Text::searchStringSplit($search);
}
if (Slim::Music::Import->stillScanning()) {
@@ -1248,7 +1185,7 @@
}
my $totalCount = 0;
- my $search = Slim::Web::Pages::Search::searchStringSplit($query);
+ my $search = Slim::Utils::Text::searchStringSplit($query);
my %results = ();
my @types = Slim::Schema->searchTypes;
@@ -1352,6 +1289,7 @@
my $SQ = ($client->model() eq 'softsqueeze');
my $SB = ($client->model() eq 'squeezebox');
my $SB2 = ($client->model() eq 'squeezebox2');
+ my $TS = ($client->model() eq 'transporter');
my $RSC = ($client->model() eq 'http');
my $connected = $client->connected() || 0;
@@ -1373,7 +1311,7 @@
$request->addResult("power", $power);
}
- if ($SB || $SB2) {
+ if ($SB || $SB2 || $TS) {
$request->addResult("signalstrength", ($client->signalStrength() || 0));
}
@@ -1552,7 +1490,7 @@
return;
}
- my $tags = 'abcdefghijklmnopqrstvwyz'; # all letter EXCEPT u AND x
+ my $tags = 'abcdefghijklmnopqrstvwxyz'; # all letter EXCEPT u
my $track;
if (Slim::Music::Import->stillScanning()) {
@@ -1587,10 +1525,6 @@
if (defined $url && Slim::Music::Info::isSong($url)){
- if ($tags !~ /x/) {
- $tags .= 'x';
- }
-
$track = Slim::Schema->rs('Track')->objectForUrl($url)
}
}
@@ -1680,66 +1614,82 @@
return;
}
- my $find = {};
-
- my $sort = 'me.titlesort';
- my $tags = 'gald';
+ my $where = {};
+ my $attr = {};
+
+ my $tags = 'gald';
# get our parameters
- my $index = $request->getParam('_index');
- my $quantity = $request->getParam('_quantity');
- my $tagsprm = $request->getParam('tags');
- my $sortprm = $request->getParam('sort');
- my $search = $request->getParam('search');
- my $genreID = $request->getParam('genre_id');
- my $artistID = $request->getParam('artist_id');
- my $albumID = $request->getParam('album_id');
- my $year = $request->getParam('year');
+ my $index = $request->getParam('_index');
+ my $quantity = $request->getParam('_quantity');
+ my $tagsprm = $request->getParam('tags');
+ my $sort = $request->getParam('sort');
+ my $search = $request->getParam('search');
+ my $genreID = $request->getParam('genre_id');
+ my $contributorID = $request->getParam('artist_id');
+ my $albumID = $request->getParam('album_id');
+ my $year = $request->getParam('year');
+
+ if ($request->paramNotOneOfIfDefined($sort, ['title', 'tracknum'])) {
+ $request->setStatusBadParams();
+ return;
+ }
# did we have override on the defaults?
# note that this is not equivalent to
# $val = $param || $default;
# since when $default eq '' -> $val eq $param
-# $sort = $sortprm if defined $sortprm;
$tags = $tagsprm if defined $tagsprm;
# Normalize any search parameters
-# if (defined $searchMap{$label} && specified($search)) {
-# $find->{ $searchMap{$label} } = Slim::Web::Pages::Search::searchStringSplit($search);
-# }
-
-# if (defined $genreID){
-# $find->{'genre'} = $genreID;
-# }
-
-# if (defined $artistID){
-# $find->{'artist'} = $artistID;
-# }
+ if (specified($search)) {
+ $where->{'me.titlesearch'} = {'like' => Slim::Utils::Text::searchStringSplit($search)};
+ }
if (defined $albumID){
- $find->{'me.album'} = $albumID;
+ $where->{'me.album'} = $albumID;
}
if (defined $year) {
- $find->{'me.year'} = $year;
- }
-
-# if ($sort eq "tracknum" && !($tags =~ /t/)) {
-# $tags = $tags . "t";
-# }
+ $where->{'me.year'} = $year;
+ }
+
+ # Manage joins
+
+ if (defined $genreID){
+ $where->{'genreTracks.genre'} = $genreID;
+ push @{$attr->{'join'}}, 'genreTracks';
+# $attr->{'distinct'} = 1;
+ }
+
+ if (defined $contributorID){
+
+ # handle the case where we're asked for the VA id => return compilations
+ if ($contributorID == Slim::Schema->variousArtistsObject->id) {
+ $where->{'album.compilation'} = 1;
+ push @{$attr->{'join'}}, 'album';
+ }
+ else {
+ $where->{'contributorTracks.contributor'} = $contributorID;
+ push @{$attr->{'join'}}, 'contributorTracks';
+ }
+ }
+
+ if ($sort eq "tracknum") {
+ if (!($tags =~ /t/)) {
+ $tags = $tags . "t";
+ }
+ $attr->{'order_by'} = "me.disc, me.tracknum, concat('0', me.titlesort)";
+ }
+ else {
+ $attr->{'order_by'} = "me.titlesort";
+ }
if (Slim::Music::Import->stillScanning()) {
$request->addResult("rescan", 1);
}
- # add this to get rid of playlists
- $find->{'me.audio'} = 1;
-
- my $rs = Slim::Schema->search('Track', $find, {
- 'order_by' => $sort,
- #'distinct' => 'me.id',
- 'prefetch' => 'album',
- });
+ my $rs = Slim::Schema->rs('Track')->search($where, $attr)->distinct;
my $count = $rs->count;
@@ -1855,7 +1805,7 @@
# #tag
'i' => ['disc', 'disc'], #disc
'j' => ['coverart', 'coverArtExists'], #thumb, cover
- # #remote
+ 'x' => ['remote', 'remote'], #remote
# #audio
# #audio_size
# #audio_offset
@@ -1878,7 +1828,7 @@
# #playcount
# #lastplayed
# #lossless
- # #lyrics
+ 'w' => ['lyrics', 'lyrics'], #lyrics
# #rating
# #replay_gain
# #replay_peak
@@ -1901,8 +1851,7 @@
# Tag Tag name Track method Track relationship
#--------------------------------------------------------------------
- 'w' => ['undefined', ''],
- 'x' => ['undefined', ''],
+
);
@@ -1934,157 +1883,6 @@
}
}
}
-
-# a artist(s)
- # if ($tags =~ /a/ && defined(my $arti = $track->genres)) {
- # }
-
-# b band
-# if ($tag eq 'b' && (my @bands = $track->band)) {
-# $returnHash{'band'} = $bands[0];
-# next;
-# }
-
-# c composer
-# if ($tag eq 'c' && (my @composers = $track->composer)) {
-# $returnHash{'composer'} = $composers[0];
-# next;
-# }
-
-# d duration
-# if ($tag eq 'd' && defined(my $value = $track->secs)) {
-# $returnHash{'duration'} = $value;
-# next;
-# }
-
-# e album_id
-# if (defined(my $album = $track->album)) {
-# if ($tag eq 'e') {
-# $returnHash{'album_id'} = $album->id;
-# next;
-# }
-# }
-
-# f filesize
-# if ($tag eq 'f' && defined(my $value = $track->filesize)) {
-# $returnHash{'filesize'} = $value;
-# next;
-# }
-
-# g genre
-# if ($tag eq 'g' && defined(my $genres = $track->genres)) {
-# while (my $genre = $genres->next) {
-# $returnHash{'genre'} = $genre->name;
-# }
-#
-# next;
-# }
-
-# h conductor
-# if ($tag eq 'h' && (my @conductors = $track->conductor)) {
-# $returnHash{'conductor'} = $conductors[0];
-# next;
-# }
-
-# i disc
-# if ($tag eq 'i' && defined(my $disc = $track->disc)) {
-# $returnHash{'disc'} = $disc;
-# next;
-# }
-
-# j coverart
-# if ($tag eq 'j' && $track->coverArt) {
-# $returnHash{'coverart'} = 1;
-# next;
-# }
-
-# k comment
-# if ($tag eq 'k' && defined(my $value = $track->comment)) {
-# $returnHash{'comment'} = $value;
-# next;
-# }
-
-# l album
-
-# m bpm
-# if ($tag eq 'm' && defined(my $value = $track->bpm)) {
-# $returnHash{'bpm'} = $value;
-# next;
-# }
-
-# n modificationTime
-# if ($tag eq 'n' && defined(my $value = $track->modificationTime)) {
-# $returnHash{'modificationTime'} = $value;
-# next;
-# }
-
-# o type
-# if ($tag eq 'o' && defined(my $value = $track->content_type)) {
-# $returnHash{'type'} = Slim::Utils::Strings::string(uc($value));
-# next;
-# }
-
-# p genre_id
-# if ($tag eq 'p' && defined(my $genre = $track->genre)) {
-# if (defined(my $id = $genre->id)) {
-# $returnHash{'genre_id'} = $id;
-# next;
-# }
-# }
-
-# q disccount
-# if (defined(my $album = $track->album)) {
-# if ($tag eq 'q' && defined(my $discc = $album->discc)) {
-# $returnHash{'disccount'} = $discc unless $discc eq '';
-# next;
-# }
-# }
-
-# r bitrate
-# if ($tag eq 'r' && defined(my $value = $track->bitrate)) {
-# $returnHash{'bitrate'} = $value;
-# next;
-# }
-
-# s artist_id
-# if ($tag eq 's' && defined(my $artist = $track->artist)) {
-#
-# $returnHash{'artist_id'} = $artist->id;
-# next;
-# }
-
-# t tracknum
-# if ($tag eq 'r' && defined(my $value = $track->tracknum)) {
-# $returnHash{'tracknum'} = $value;
-# next;
-# }
-
-# u url
-# if ($tag eq 'u' && defined(my $url = $track->url())) {
-# $returnHash{'url'} = $url;
-# next;
-# }
-
-# v tagversion
-# if ($tag eq 'v' && defined(my $value = $track->tagversion)) {
-# $returnHash{'tagversion'} = $value;
-# next;
-# }
-
-# y year
-# if ($tag eq 'y' && defined(my $value = $track->year)) {
-# $returnHash{'year'} = $value;
-# next;
-# }
-
-# z drm
-# if ($tag eq 'z' && defined(my $value = $track->drm)) {
-# $returnHash{'drm'} = $value;
-# next;
-# }
-
-
-
}
return \%returnHash;
Modified: trunk/server/Slim/Control/Request.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Control/Request.pm?rev=8842&r1=8841&r2=8842&view=diff
==============================================================================
--- trunk/server/Slim/Control/Request.pm (original)
+++ trunk/server/Slim/Control/Request.pm Sun Aug 6 18:12:15 2006
@@ -422,7 +422,6 @@
addDispatch(['button', '_buttoncode', '_time', '_orFunction'], [1, 0, 0, \&Slim::Control::Commands::buttonCommand]);
addDispatch(['client', 'forget'], [1, 0, 0, \&Slim::Control::Commands::clientForgetCommand]);
addDispatch(['connected', '?'], [1, 1, 0, \&Slim::Control::Queries::connectedQuery]);
- addDispatch(['contributors', '_index', '_quantity'], [0, 1, 1, \&Slim::Control::Queries::contributorsQuery]);
addDispatch(['current_title', '?'], [1, 1, 0, \&Slim::Control::Queries::cursonginfoQuery]);
addDispatch(['debug', '_debugflag', '?'], [0, 1, 0, \&Slim::Control::Queries::debugQuery]);
addDispatch(['debug', '_debugflag', '_newvalue'], [0, 0, 0, \&Slim::Control::Commands::debugCommand]);
More information about the checkins
mailing list