SqueezePHPAPI
[ class tree: SqueezePHPAPI ] [ index: SqueezePHPAPI ] [ all elements ] [ doc index ]

Class: SqueezeDatabase

Source Location: /lib/class.SqueezeDatabase.php

Class Overview

SqueezeDatabase


Author(s):

Copyright:

Methods


 

Class Details

[line 27]
SqueezeDatabase

SqueezeCenter database commands and queries


Tags:

author:  David Broz <db-dev__AT__0r9.org>
copyright:  (c) 2009 by David Broz - Disorganization Zurich, Switzerland
license:  GNU General Public License v2


[ Top ]


Class Methods


constructor __construct [line 46]

SqueezeDatabase __construct( SqueezeConnection $CLI)

SqueezeDatabase (constructor)



Parameters:

SqueezeConnection   $CLI  

[ Top ]

destructor __destruct [line 501]

void __destruct( )

SqueezeDatabase (destructor)



[ Top ]

method abortscan [line 87]

boolean abortscan( )

abortscan

The "abortscan" command causes SqueezeCenter to cancel a running scan.


Tags:

return:  (success)
access:  public


[ Top ]

method albums [line 209]

array albums( [integer $start = 0], [integer $itemsPerResponse = 5], [string $search = ""], [string $genre_id = ""], [string $artist_id = ""], [string $track_id = ""], [string $year = ""], [boolean $compilation = false], [string $sort = "album"], [string $tags = ""])

albums

The "albums" query returns all albums known by the server.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $genre_id   Genre ID, to restrict the results to those albums with songs of that genre.
string   $artist_id   Artist ID, to restrict the results to those albums by "artist_id".
string   $track_id   Track ID, to restrict the results to the album of "track_id". If specified, all other filters are ignored.
string   $year   Year, to restrict the results to those albums of that year.
boolean   $compilation   Compilation, to restrict the results to those albums that are (true) or aren't (false) compilations.
string   $sort   Sort order of the returned list of albums. One of "album", (the default), "new" which replicates the "New Music" browse mode of the web interface, or "artflow" which sorts by artist, year, album for use with artwork-centric interfaces.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is "l".

[ Top ]

method artists [line 186]

array artists( [integer $start = 0], [integer $itemsPerResponse = 5], [string $search = ""], [string $genre_id = ""], [string $album_id = ""], [string $tags = ""])

artists

The "artists" query returns all artists known by the server.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $genre_id   Genre ID, to restrict the results to those artists with songs of that genre.
string   $album_id   Genre ID, to restrict the results to those artists with songs of that genre.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is empty.

[ Top ]

method genres [line 167]

array genres( [integer $start = 0], [integer $itemsPerResponse = 5], [string $search = ""], [string $artist_id = ""], [string $album_id = ""], [string $track_id = ""], [string $year = ""], [string $tags = ""])

genres

The "genres" query returns all genres known by the server.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $search   Search string. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $artist_id   Limit results to those genres proposed by the artist identified by "artist_id".
string   $album_id   Limit results to those genres available on the album identified by "album_id".
string   $track_id   Limit results to the genres of the track identified by "track_id". If present, other filters are ignored.
string   $year   Limit results to the genres of the tracks of the given "year".
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is empty.

[ Top ]

method info_total_albums [line 135]

integer info_total_albums( )

info_total_albums

The "info total albums ?" query returns the number of unique albums in the server music database.


Tags:

access:  public


[ Top ]

method info_total_artists [line 123]

integer info_total_artists( )

info_total_artists

The "info total artists ?" query returns the number of unique artists in the server music database.


Tags:

access:  public


[ Top ]

method info_total_genres [line 111]

integer info_total_genres( )

info_total_genres

The "info total genres ?" query returns the number of unique genres in the server music database.


Tags:

access:  public


[ Top ]

method info_total_songs [line 147]

integer info_total_songs( )

info_total_songs

The "info total songs ?" query returns the number of unique songs in the server music database.


Tags:

access:  public


[ Top ]

method musicfolder [line 241]

array musicfolder( [integer $start = 0], [integer $itemsPerResponse = 5], [string $folder_id = ""], [string $url = ""], [string $tags = ""])

musicfolder

The "musicfolder" query returns the content of a given music folder, starting from the top level directory configured in SqueezeCenter.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $folder_id   Browses the folder identified by "folder_id".
string   $url   Browses the folder identified by "url". If the content of "url" did not happen to be in the SqueezeCenter database, it is added to it. "url" has precedence over "folder_id" if both are provided.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is empty.

[ Top ]

method playlists [line 258]

array playlists( [integer $start = 0], [integer $itemsPerResponse = 5], [string $search = ""], [string $tags = ""])

playlists

The "playlists" query returns all playlists known by the server.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is empty.

[ Top ]

method playlists_delete [line 319]

boolean playlists_delete( [string $playlist_id = ""])

playlists_delete

This command deletes a saved playlist.


Tags:

return:  (success)
access:  public


Parameters:

string   $playlist_id   The id of the playlist to delete.

[ Top ]

method playlists_edit [line 338]

boolean playlists_edit( [string $playlist_id = ""], [string $cmd = ""], [string $index = ""], [string $toindex = ""], [string $title = ""], [string $url = ""])

playlists_edit

This command manipulates the track content of a saved playlist.


Tags:

return:  (success)
access:  public


Parameters:

string   $playlist_id   The id of the playlist to manipulate.
string   $cmd   One of "up", "down", "move", "delete" or "add", in order to move up, down, delete or add a track.
string   $index   For "cmd:up", "cmd:down", "cmd:move" and "cmd:delete" the index of the track to edit.
string   $toindex   For "cmd:move" the new index of the track to be moved.
string   $title   For "cmd:add", the title of the track to add.
string   $url   For "cmd:add", the url of the track to add.

[ Top ]

method playlists_new [line 305]

array playlists_new( [string $name = ""])

playlists_new

This command creates an empty saved playlist, to be further manipulated by other commands.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

string   $name   The name of the playlist (without .m3u).

[ Top ]

method playlists_rename [line 291]

array playlists_rename( [string $playlist_id = ""], [string $newname = ""], [string $dry_run = ""])

playlists_rename

This command renames a saved playlist.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

string   $playlist_id   The id of the playlist to rename.
string   $newname   The new name of the playlist (without .m3u).
string   $dry_run   Used to check if the new name is already used by another playlist. The command performs the name check but does not overwrite the existing playlist. If a name conflict occurs, the command will return a "overwritten_playlist_id" parameter.

[ Top ]

method playlists_tracks [line 275]

array playlists_tracks( [integer $start = 0], [integer $itemsPerResponse = 5], [string $playlist_id = ""], [string $tags = ""])

playlists_tracks

The "playlists tracks" query returns the tracks of a given playlist.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $playlist_id   Playlist ID as returned by the "playlists" query. This is a mandatory parameter.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".

[ Top ]

method rescan [line 59]

boolean rescan( [string $query = "?"])

rescan

The "rescan" command causes SqueezeCenter to rescan the entire music library, reloading the music file information. If "playlists" is indicated ("rescan playlists"), only the playlist directory is rescanned.


Tags:

return:  (success)
access:  public


Parameters:

string   $query   <|playlists|?>

[ Top ]

method rescanprogress [line 75]

array rescanprogress( )

rescanprogress

The "rescanprogress" query returns details on the scanning progress.


Tags:

return:  <taggedParameters> <taggedParameters>
access:  public


[ Top ]

method search [line 491]

array search( [integer $start = 0], [integer $itemsPerResponse = 5], [string $term = ""])

search

The "search" command returns artists, albums and tracks matching a search string.
Please note that "start" and "itemsPerResponse" are calculated per category. If you eg. have genres and tracks with the search term in them, you'll get "itemsPerResponse" number of each of them. The total number of items returned therefore can be a multiple of "itemsPerResponse".


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $term   Search string

[ Top ]

method songinfo [line 385]

array songinfo( [integer $start = 0], [integer $itemsPerResponse = 5], [string $url = ""], [string $track_id = ""], [string $tags = ""])

songinfo

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.


Tags:

return:  <taggedParameters> (bool false on failure)
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $url   Song path as returned by other CLI commands. This is a mandatory parameter, except if "track_id" is provided.
string   $track_id   Track ID as returned by other CLI commands. This is a mandatory parameter, except if "url" is provided.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter. The default value is all info except the url (u) and the multi-valued tags for genre(s) (G & P) and artists (A & S)

[ Top ]

method songs [line 433]

array songs( [integer $start = 0], [integer $itemsPerResponse = 5], [string $genre_id = ""], [string $artist_id = ""], [string $album_id = ""], [string $year = ""], [string $search = ""], [string $tags = ""], [string $sort = ""])

songs

The "songs" command returns all titles known by the SqueezeCenter.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $genre_id   Genre ID, to restrict the results to the titles of that genre.
string   $artist_id   Artist ID, to restrict the results to the titles of that artist.
string   $album_id   Album ID, to restrict the results to the titles of that album.
string   $year   Year, to restrict the results to the titles of that year.
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".
string   $sort   Sorting, one of "title" (the default) or "tracknum" (in which case the track field ("t") is added automatically to the response). Sorting by tracks is possible only if tracks are defined and for a single album.

[ Top ]

method titles [line 412]

array titles( [integer $start = 0], [integer $itemsPerResponse = 5], [string $genre_id = ""], [string $artist_id = ""], [string $album_id = ""], [string $year = ""], [string $search = ""], [string $tags = ""], [string $sort = ""])

titles

The "titles" command returns all titles known by the SqueezeCenter.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $genre_id   Genre ID, to restrict the results to the titles of that genre.
string   $artist_id   Artist ID, to restrict the results to the titles of that artist.
string   $album_id   Album ID, to restrict the results to the titles of that album.
string   $year   Year, to restrict the results to the titles of that year.
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".
string   $sort   Sorting, one of "title" (the default) or "tracknum" (in which case the track field ("t") is added automatically to the response). Sorting by tracks is possible only if tracks are defined and for a single album.

[ Top ]

method tracks [line 454]

array tracks( [integer $start = 0], [integer $itemsPerResponse = 5], [string $genre_id = ""], [string $artist_id = ""], [string $album_id = ""], [string $year = ""], [string $search = ""], [string $tags = ""], [string $sort = ""])

tracks

The "tracks" command returns all titles known by the SqueezeCenter.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>
string   $genre_id   Genre ID, to restrict the results to the titles of that genre.
string   $artist_id   Artist ID, to restrict the results to the titles of that artist.
string   $album_id   Album ID, to restrict the results to the titles of that album.
string   $year   Year, to restrict the results to the titles of that year.
string   $search   Search substring. The search is case insensitive and obeys the "Search Within Words" server parameter.
string   $tags   Determines which tags are returned. Each returned tag is identified by a letter (see command "songinfo" for a list of possible fields and their identifying letter). The default tags value for this command is "gald".
string   $sort   Sorting, one of "title" (the default) or "tracknum" (in which case the track field ("t") is added automatically to the response). Sorting by tracks is possible only if tracks are defined and for a single album.

[ Top ]

method wipecache [line 99]

boolean wipecache( )

wipecache

The "wipecache" command allows the caller to have the SqueezeCenter rescan its music library, reloading the music file information.


Tags:

return:  (success)
access:  public


[ Top ]

method years [line 224]

array years( [integer $start = 0], [integer $itemsPerResponse = 5])

years

The "years" query returns all years known by the server.


Tags:

return:  <taggedParameters>
access:  public


Parameters:

integer   $start   <start>
integer   $itemsPerResponse   <itemsPerResponse>

[ Top ]


Documentation generated on Wed, 16 Sep 2009 18:08:27 +0200 by phpDocumentor 1.4.2