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

Class: Catalog

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

Class Overview

database_object
   |
   --Catalog

Catalog Class This class handles all actual work in regards to the catalog, it contains functions for creating/listing/updated the catalogs.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
Catalog Class This class handles all actual work in regards to the catalog, it contains functions for creating/listing/updated the catalogs.



[ Top ]


Class Variables

$catalog_type =

[line 35]



Tags:

access:  public

Type:   mixed


[ Top ]

$key =

[line 32]



Tags:

access:  public

Type:   mixed


[ Top ]

$last_add =

[line 31]



Tags:

access:  public

Type:   mixed


[ Top ]

$last_update =

[line 30]



Tags:

access:  public

Type:   mixed


[ Top ]

$name =

[line 29]



Tags:

access:  public

Type:   mixed


[ Top ]

$path =

[line 36]



Tags:

access:  public

Type:   mixed


[ Top ]

$rename_pattern =

[line 33]



Tags:

access:  public

Type:   mixed


[ Top ]

$sort_pattern =

[line 34]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method check_album [line 1985]

static void check_album( $album, [ $album_year = 0], [ $disk = ''], [ $readonly = ''])

check_album

Takes $album and checks if there then return id else insert and return id




Tags:

access:  public


Parameters:

   $album  
   $album_year  
   $disk  
   $readonly  

[ Top ]

static method check_artist [line 1915]

static void check_artist( $artist, [ $readonly = ''])

check_artist

$artist checks if there then return id else insert and return id If readonly is passed then don't create, return false on not found




Tags:

access:  public


Parameters:

   $artist  
   $readonly  

[ Top ]

static method check_tag [line 2069]

static void check_tag( $value, $object_id, [ $object_type = 'song'])

check_tag

This checks the tag we've been passed (name) and sees if it exists, and if so if it's mapped to this object, this is only done for songs for now




Tags:

access:  public


Parameters:

   $value  
   $object_id  
   $object_type  

[ Top ]

static method check_title [line 2083]

static void check_title( $title, [ $file = 0])

check_title

this checks to make sure something is set on the title, if it isn't it looks at the filename and trys to set the title based on that




Tags:

access:  public


Parameters:

   $title  
   $file  

[ Top ]

static method clean [line 1877]

static void clean( )

clean

This is a wrapper function for all of the different cleaning functions, it runs them in the correct order and takes a catalog_id




Tags:

access:  public


[ Top ]

static method clean_albums [line 1663]

static void clean_albums( )

clean_albums

This function cleans out unused albums




Tags:

access:  public


[ Top ]

static method clean_artists [line 1695]

static void clean_artists( )

clean_artists

This function cleans out unused artists




Tags:

access:  public


[ Top ]

static method clean_ext_info [line 1725]

static void clean_ext_info( )

clean_ext_info

This function clears any ext_info that no longer has a parent




Tags:

access:  public


[ Top ]

static method clean_flagged [line 1683]

static void clean_flagged( )

clean_flagged

This functions cleans ou unused flagged items




Tags:

access:  public


[ Top ]

static method clean_playlists [line 1707]

static void clean_playlists( )

clean_playlists

cleans out dead files from playlists




Tags:

access:  public


[ Top ]

static method clean_shoutbox [line 1639]

static void clean_shoutbox( )

clean_shoutbox

This cleans out any shoutbox items that are now orphaned




Tags:

access:  public


[ Top ]

static method clean_stats [line 1737]

static void clean_stats( )

clean_stats

This functions removes stats for songs/albums that no longer exist




Tags:

access:  public


[ Top ]

static method clean_tags [line 1614]

static void clean_tags( )

clean_tags

This cleans out tag_maps that are not assoicated with a 'living' object and then cleans the tags that have no maps




Tags:

access:  public


[ Top ]

static method clear_stats [line 230]

static void clear_stats( )

clear_stats

This clears all stats for _everything_




Tags:

access:  public


[ Top ]

static method count_songs [line 340]

static void count_songs( [ $catalog_id = ''])

count_songs

This returns the current # of songs, albums, artists, genres in this catalog




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

static method count_users [line 375]

static void count_users( [ $catalog_id = ''])

count_users

This returns the total number of users in the ampache instance




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

static method create [line 249]

static void create( $data)

create

This creates a new catalog entry and then returns the insert id it checks to make sure this path is not already used before creating the catalog




Tags:

access:  public


Parameters:

   $data  

[ Top ]

static method delete [line 2398]

static void delete( $catalog_id)

delete

Deletes the catalog and everything assoicated with it it takes the catalog id




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

static method dump_album_art [line 910]

static void dump_album_art( $catalog_id, [ $methods = array()])

dump_album_art (Added by Cucumber 20050216)

This runs through all of the albums and trys to dump the art for them into the 'folder.jpg' file in the appropriate dir




Tags:

access:  public


Parameters:

   $catalog_id  
   $methods  

[ Top ]

static method get_catalogs [line 155]

static void get_catalogs( )

get_catalogs

Pull all the current catalogs and return an array of ids of what you find




Tags:

access:  public


[ Top ]

static method get_catalog_albums [line 701]

static void get_catalog_albums( $catalog_id)

get_catalog_albums()

Returns an array of the albums from a catalog




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

static method get_catalog_ids [line 174]

static void get_catalog_ids( )

get_catalog_ids

This returns an array of all catalog ids




Tags:

access:  public


[ Top ]

static method get_disabled [line 746]

static void get_disabled( [ $count = 0])

get_disabled

Gets an array of the disabled songs for all catalogs and returns full song objects with them




Tags:

access:  public


Parameters:

   $count  

[ Top ]

static method get_duplicate_info [line 878]

static void get_duplicate_info( $item, $search_type)

get_duplicate_info

This takes a song, search type and auto flag and returns the duplicate songs in the correct order, it sorts them by longest, higest bitrate, largest filesize, checking the last one as most likely bad




Tags:

access:  public


Parameters:

   $item  
   $search_type  

[ Top ]

static method get_duplicate_songs [line 834]

static void get_duplicate_songs( $search_method)

get_duplicate_songs This function takes a search type and returns a list of all song_ids that are likely to be duplicates based on teh search method selected.



Tags:

access:  public


Parameters:

   $search_method  

[ Top ]

static method get_from_path [line 106]

static void get_from_path( $path)

get_from_path

Try to figure out which catalog path most closely resembles this one This is useful when creating a new catalog to make sure we're not doubling up here




Tags:

access:  public


Parameters:

   $path  

[ Top ]

static method get_stats [line 193]

static void get_stats( [ $catalog_id = 0])

get_stats

This returns an hash with the #'s for the different objects that are assoicated with this catalog. This is used to build the stats box, it also calculates time




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

static method optimize_tables [line 1896]

static void optimize_tables( )

optimize_tables

This runs an optomize on the tables and updates the stats to improve join speed this can be slow, but is a good idea to do from time to time. This is incase the dba isn't doing it... which we're going to assume they aren't




Tags:

access:  public


[ Top ]

static method update_settings [line 1016]

static void update_settings( $data)

update_settings

This function updates the basic setting of the catalog




Tags:

access:  public


Parameters:

   $data  

[ Top ]

static method update_single_item [line 1037]

static void update_single_item( $type, $id)

update_single_item

updates a single album,artist,song from the tag data this can be done by 75+




Tags:

access:  public


Parameters:

   $type  
   $id  

[ Top ]

static method update_song_from_tags [line 1086]

static void update_song_from_tags( &$song, [ $sort_pattern = ''], [ $rename_pattern = ''])

update_song_from_tags

updates the song info based on tags, this is called from a bunch of different places and passes in a full fledged song object, so it's a static function FIXME: This is an ugly mess, this really needs to be consolidated and cleaned up




Tags:

access:  public


Parameters:

   &$song  
   $sort_pattern  
   $rename_pattern  

[ Top ]

constructor __construct [line 55]

Catalog __construct( [ $catalog_id = ''])

Constructor

Catalog class constructor, pulls catalog information $catalog_id The ID of the catalog you want to build information from




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

method add_files [line 405]

void add_files( $path, $options)

add_files Recurses throught $this->path and pulls out all mp3s and returns the full path in an array. Passes gather_type to determin if we need to check id3 information against the db.



Tags:

access:  public


Parameters:

   $path  
   $options  

[ Top ]

method add_to_catalog [line 1169]

void add_to_catalog( )

add_to_catalog

this function adds new files to an existing catalog




Tags:

access:  public


[ Top ]

method check_local_mp3 [line 2249]

void check_local_mp3( $full_file, [ $gather_type = ''])

check_local_mp3

Checks the song to see if it's there already returns true if found, false if not




Tags:

access:  public


Parameters:

   $full_file  
   $gather_type  

[ Top ]

method check_remote_song [line 2230]

void check_remote_song( $url)

check_remote_song

checks to see if a remote song exists in the database or not if it find a song it returns the UID




Tags:

access:  public


Parameters:

   $url  

[ Top ]

method clean_catalog [line 1491]

void clean_catalog( )

clean_catalog

Cleans the Catalog of files that no longer exist grabs from $this->id or $id passed Doesn't actually delete anything, disables errored files, and returns them in an array




Tags:

access:  public


[ Top ]

method clean_single_song [line 1581]

void clean_single_song( $song)

clean_single_song

This function takes the elements of a single song object And checks to see if those specific elements are now orphaned this is often used in flagging, and is a faster way then calling the normal clean functions. The assumption is made that this is an old song object whoes information has already been updated in the database




Parameters:

   $song  

[ Top ]

method export [line 2427]

void export( $type)

exports the catalog it exports all songs in the database to the given export type.



Tags:

access:  public


Parameters:

   $type  

[ Top ]

method format [line 140]

void format( )

format

This makes the object human readable




Tags:

access:  public


[ Top ]

method get_albums [line 580]

void get_albums( [ $songs = array()])



Parameters:

   $songs  

[ Top ]

method get_album_art [line 619]

void get_album_art( [ $catalog_id = 0], [ $all = ''])

get_album_art

This runs through all of the needs art albums and trys to find the art for them from the mp3s




Tags:

access:  public


Parameters:

   $catalog_id  
   $all  

[ Top ]

method get_album_ids [line 598]

void get_album_ids( )

get_album_ids

This returns an array of ids of albums that have songs in this catalog




Tags:

access:  public


[ Top ]

method get_catalog_files [line 721]

void get_catalog_files( [ $catalog_id = 0])

get_catalog_files

Returns an array of song objects from a catalog, used by sort_files script




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]

method get_files [line 768]

void get_files( $path)



Parameters:

   $path  

[ Top ]

method get_remote_album_images [line 1362]

void get_remote_album_images( $client, $token)

get_album_images

This function retrieves the album information from the remote server




Tags:

access:  public


Parameters:

   $client  
   $token  

[ Top ]

method get_remote_catalog [line 1239]

void get_remote_catalog( [ $type = 0])

get_remote_catalog

get a remote catalog and runs update if needed this requires the XML RPC stuff and a key to be passed




Tags:

access:  public


Parameters:

   $type  

[ Top ]

method get_remote_song [line 1325]

void get_remote_song( $client, $token, $start, $end)

get_remote_song

This functions takes a start and end point for gathering songs from a remote server. It is broken up in attempt to get around the problem of very large target catalogs




Tags:

access:  public


Parameters:

   $client  
   $token  
   $start  
   $end  

[ Top ]

method import_m3u [line 2276]

void import_m3u( $filename)

import_m3u

this takes m3u filename and then attempts to create a Public Playlist based on the filenames listed in the m3u




Tags:

access:  public


Parameters:

   $filename  

[ Top ]

method insert_local_song [line 2098]

void insert_local_song( $file, $file_info)

insert_local_song

Insert a song that isn't already in the database this function is in here so we don't have to create a song object




Tags:

access:  public


Parameters:

   $file  
   $file_info  

[ Top ]

method insert_local_video [line 2192]

void insert_local_video( $file, $filesize)

insert_local_video

This inserts a video file into the video file table the tag information we can get is super sketchy so it's kind of a crap shoot here




Tags:

access:  public


Parameters:

   $file  
   $filesize  

[ Top ]

method insert_remote_song [line 2167]

void insert_remote_song( $song)

insert_remote_song takes the information gotten from XML-RPC and inserts it into the local database. The filename ends up being the url.



Tags:

access:  public


Parameters:

   $song  

[ Top ]

method merge_stats [line 2347]

void merge_stats( $type, $oldid, $newid)



Parameters:

   $type  
   $oldid  
   $newid  

[ Top ]

method run_add [line 303]

void run_add( $options)

run_add

This runs the add to catalog function it includes the javascript refresh stuff and then starts rolling throught the path for this catalog




Tags:

access:  public


Parameters:

   $options  

[ Top ]

method update_last_add [line 1004]

void update_last_add( )

update_last_add

updates the last_add of the catalog




[ Top ]

method update_remote_album_images [line 1434]

void update_remote_album_images( $data, $remote_server, $auth)



Tags:

access:  public


Parameters:

   $data  
   $remote_server  
   $auth  

[ Top ]

method update_remote_catalog [line 1397]

void update_remote_catalog( $data, $root_path)

update_remote_catalog

actually updates from the remote data, takes an array of songs that are base64 encoded and parses them




Tags:

access:  public


Parameters:

   $data  
   $root_path  

[ Top ]

method verify_catalog [line 1773]

void verify_catalog( $catalog_id)

verify_catalog

This function compares the DB's information with the ID3 tags




Tags:

access:  public


Parameters:

   $catalog_id  

[ Top ]


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