diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-01 02:45:39 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-01 02:45:39 +0000 |
commit | 4aefc1fadc228ad5625462574cd1b341775f7125 (patch) | |
tree | 5d8de69efbb3c56638aa91d961e89261e098ef91 /lib/class/vainfo.class.php | |
parent | b9a2603025483deefbf7636de3f6c0786e95d293 (diff) | |
download | ampache-4aefc1fadc228ad5625462574cd1b341775f7125.tar.gz ampache-4aefc1fadc228ad5625462574cd1b341775f7125.tar.bz2 ampache-4aefc1fadc228ad5625462574cd1b341775f7125.zip |
incomplete changes, commiting because I need a coding break
Diffstat (limited to 'lib/class/vainfo.class.php')
-rw-r--r-- | lib/class/vainfo.class.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 80fed827..d892e8e4 100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php @@ -158,6 +158,45 @@ class vainfo { } // get_info /** + * get_tag_type + * This takes the result set, and the the tag_order + * As defined by your config file and trys to figure out + * which tag type it should use, if your tag_order + * doesn't match anything then it just takes the first one + * it finds in the results. + */ + public static function get_tag_type($results) { + + /* Pull In the config option */ + $order = Config::get('tag_order'); + + if (!is_array($order)) { + $order = array($order); + } + + /* Foreach through the defined key order + * the first one we find is the first one we use + */ + foreach($order as $key) { + if ($results[$key]) { + $returned_key = $key; + break; + } + } + + /* If we didn't find anything then default it to the + * first in the results set + */ + if (!isset($returned_key)) { + $keys = array_keys($results); + $returned_key = $keys['0']; + } + + return $returned_key; + + } // get_tag_type + + /** * _get_type * This function takes the raw information and figures out * what type of file we are dealing with for use by the tag |