Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: Album

Source Location: /lib/class/album.class.php

Class Overview

database_object
   |
   --Album

Album Class This is the class responsible for handling the Album object it is related to the album table in the database.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
Album Class This is the class responsible for handling the Album object it is related to the album table in the database.



[ Top ]


Class Variables

$art =

[line 38]



Tags:

access:  public

Type:   mixed


[ Top ]

$art_mime =

[line 39]



Tags:

access:  public

Type:   mixed


[ Top ]

$disk =

[line 33]



Tags:

access:  public

Type:   mixed


[ Top ]

$full_name =

[line 32]



Tags:

access:  public

Type:   mixed


[ Top ]

$id =

[line 30]



Tags:

access:  public

Type:   mixed


[ Top ]

$name =

[line 31]



Tags:

access:  public

Type:   mixed


[ Top ]

$prefix =

[line 35]



Tags:

access:  public

Type:   mixed


[ Top ]

$thumb =

[line 40]



Tags:

access:  public

Type:   mixed


[ Top ]

$thumb_mime =

[line 41]



Tags:

access:  public

Type:   mixed


[ Top ]

$year =

[line 34]



Tags:

access:  public

Type:   mixed


[ Top ]

$_songs = array()

[line 44]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method build_cache [line 96]

static void build_cache( $ids, [ $extra = false])

build_cache

This takes an array of object ids and caches all of their information with a single query




Tags:

access:  public


Parameters:

   $ids  
   $extra  

[ Top ]

static method construct_from_array [line 77]

static void construct_from_array( $data)

construct_from_array

This is often used by the metadata class, it fills out an album object from a named array, _fake is set to true




Tags:

access:  public


Parameters:

   $data  

[ Top ]

static method get_image_from_source [line 884]

static void get_image_from_source( $data)

get_image_from_source

This gets an image for the album art from a source as defined in the passed array. Because we don't know where its comming from we are a passed an array that can look like ['url'] = URL *** OPTIONAL *** ['file'] = FILENAME *** OPTIONAL *** ['raw'] = Actual Image data, already captured




Tags:

access:  public


Parameters:

   $data  

[ Top ]

static method get_random_albums [line 843]

static void get_random_albums( [ $count = 6])

get_random_albums

This returns a random number of albums from the catalogs this is used by the index to return some 'potential' albums to play




Tags:

access:  public


Parameters:

   $count  

[ Top ]

static method save_resized_art [line 823]

static void save_resized_art( $data, $mime, $album)

save_resized_art

This takes data from a gd resize operation and saves it back into the database as a thumbnail




Tags:

access:  public


Parameters:

   $data  
   $mime  
   $album  

[ Top ]

constructor __construct [line 53]

Album __construct( [ $id = ''])

__construct

Album constructor it loads everything relating to this album from the database it does not pull the album or thumb art by default or get any of the counts.




Tags:

access:  public


Parameters:

   $id  

[ Top ]

method clear_art [line 774]

void clear_art( )

clear_art

clears the album art from the DB




Tags:

access:  public


[ Top ]

method find_art [line 304]

void find_art( [ $options = array()], [ $limit = ''])

find_art This function searches for album art using all configured methods for the current album. There is an optional 'limit' passed that will gather up to the specified number of possible album covers.

There is also an optional array of options the possible options are ['keyword'] = STRING ['artist'] = STRING ['album_name'] = STRING




Tags:

access:  public


Parameters:

   $options  
   $limit  

[ Top ]

method format [line 230]

void format( )

format

This is the format function for this object. It sets cleaned up albumĀ information with the base required f_link, f_name




Tags:

access:  public


[ Top ]

method get_amazon_art [line 573]

void get_amazon_art( [ $keywords = ''], [ $limit = ''])

get_amazon_art

This takes keywords and performs a search of the Amazon website for album art. It returns an array of found objects with mime/url keys




Tags:

access:  public


Parameters:

   $keywords  
   $limit  

[ Top ]

method get_art [line 279]

void get_art( [ $return_raw = false])

get_art

This function only pulls art from the database, if thumb is passed it trys to pull the resized art instead, if resized art is found then it returns an additional resized=true in the array




Tags:

access:  public


Parameters:

   $return_raw  

[ Top ]

method get_db_art [line 553]

void get_db_art( )

get_db_art

returns the album art from the db along with the mime type




Tags:

access:  public


[ Top ]

method get_folder_art [line 454]

void get_folder_art( [ $limit = ''])

get_folder_art()

returns the album art from the folder of the audio files If a limit is passed or the preferred filename is found the current results set is returned




Parameters:

   $limit  

[ Top ]

method get_id3_art [line 409]

void get_id3_art( [ $limit = ''])



Parameters:

   $limit  

[ Top ]

method get_lastfm_art [line 363]

void get_lastfm_art( $limit, [ $options = ''])

get_lastfm_art This returns the art as pulled from lastFM. This doesn't require a special account, we just parse and run with it.



Tags:

access:  public


Parameters:

   $limit  
   $options  

[ Top ]

method get_random_songs [line 706]

void get_random_songs( )

get_random_songs

gets a random number, and a random assortment of songs from this album




[ Top ]

method get_resized_db_art [line 530]

void get_resized_db_art( )

get_resized_db_art

This looks to see if we have a resized thumbnail that we can load rather then taking the fullsized and resizing that




Tags:

access:  public


[ Top ]

method get_songs [line 168]

void get_songs( [ $limit = 0], [ $artist = ''])

get_songs

gets the songs for this album takes an optional limit and an optional artist, if artist is passed it only gets songs with this album + specified artist




Tags:

access:  public


Parameters:

   $limit  
   $artist  

[ Top ]

method has_art [line 193]

void has_art( )

has_art This returns true or false depending on if we find any art for this album.



Tags:

access:  public


[ Top ]

method has_track [line 211]

void has_track( $title)

has_track

This checks to see if this album has a track of the specified title




Tags:

access:  public


Parameters:

   $title  

[ Top ]

method insert_art [line 786]

void insert_art( $image, $mime)

insert_art

this takes a string representation of an image and inserts it into the database. You must pass the mime type as well




Tags:

access:  public


Parameters:

   $image  
   $mime  

[ Top ]

method update [line 724]

void update( $data)

update

This function takes a key'd array of data and updates this object as needed, and then throws down with a flag




Tags:

access:  public


Parameters:

   $data  

[ Top ]


Documentation generated on Thu, 12 Feb 2009 07:59:48 +0900 by phpDocumentor 1.4.2