Todo List
database_object | --Playlist
This class handles playlists in ampache. it references the playlist* tables
[line 34]
[line 33]
[line 29]
[line 37]
[line 30]
[line 32]
[line 31]
static void build_cache( $ids)
This is what builds the cache from the objects
static void create( $name, $type)
This function creates an empty playlist, gives it a name and type Assumes $GLOBALS['user']->id as the user
static void get_users( $user_id)
This returns the specified users playlists as an array of playlist ids
Playlist __construct( $id)
This takes a playlist_id as an optional argument and gathers the information if not playlist_id is passed returns false (or if it isn't found
void add_dyn_song( )
This adds a dynamic song to a specified playlist this is just called as the song its self is stored in the session to keep it away from evil users
void add_songs( [ $song_ids = array()])
This takes an array of song_ids and then adds it to the playlist if you want to add a dyn_song you need to use the one shot function add_dyn_song
void delete( )
This deletes the current playlist and all assoicated data
void delete_track( $id)
this deletes a single track, you specify the playlist_data.id here
void format( )
This takes the current playlist object and gussies it up a little bit so it is presentable to the users
void get_dyn_songs( $dyn_string)
This returns an array of song_ids for a single dynamic playlist entry
void get_items( )
This returns an array of playlist songs that are in this playlist. Because the same song can be on the same playlist twice they are key'd by the uid from playlist_data
void get_random_items( [ $limit = ''])
This is the same as before but we randomize the buggers!
void get_songs( )
This is called by the batch script, because we can't pass in Dynamic objects they pulled once and then their target song.id is pushed into the array
void get_song_count( )
This simply returns a int of how many song elements exist in this playlist For now let's consider a dyn_song a single entry
void get_track( $track_id)
Returns the single item on the playlist and all of it's information, restrict it to this Playlist
void has_access( )
This function returns true or false if the current user has access to this playlist
void normalize_tracks( )
this takes the crazy out of order tracks and numbers them in a liner fashion, not allowing for the same track # twice, this is an optional funcition
void set_items( )
This calles the get_items function and sets it to $this->items which is an array in this object
void update( $data)
This function takes a key'd array of data and runs updates
void update_track_number( $track_id, $track)
This takes a playlist_data.id and a track (int) and updates the track value