summaryrefslogtreecommitdiffstats
path: root/lib/class/api.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-25 01:52:27 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-02-25 01:52:27 +0000
commit211a0c47a6d9b8d1ae0f45d8db6250a4ade1bfc1 (patch)
treeae65c59be4205443486207eb75d97944da383ce8 /lib/class/api.class.php
parent2a5051b0c1f0c1b95cf2e19a92358c36abc8c852 (diff)
downloadampache-211a0c47a6d9b8d1ae0f45d8db6250a4ade1bfc1.tar.gz
ampache-211a0c47a6d9b8d1ae0f45d8db6250a4ade1bfc1.tar.bz2
ampache-211a0c47a6d9b8d1ae0f45d8db6250a4ade1bfc1.zip
added localplay controls to api in addition to added/updated filters
Diffstat (limited to 'lib/class/api.class.php')
-rw-r--r--lib/class/api.class.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index 28e04ec0..4685351b 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -39,6 +39,40 @@ class Api {
} // constructor
/**
+ * set_filter
+ * This is a play on the browse function, it's different as we expose the filters in a slightly different
+ * and vastly simplier way to the end users so we have to do a little handy work to make them
+ * work internally
+ */
+ public static function set_filter($filter,$value) {
+
+ if (!strlen($value)) { return false; }
+
+ switch ($filter) {
+ case 'add':
+ // Check for a range, if no range default to gt
+ if (strpos('/',$value)) {
+ $elements = explode('/',$value);
+ Browse::set_filter('add_lt',$elements['1']);
+ Browse::set_filter('add_gt',$elements['0']);
+ }
+ else {
+ Browse::set_filter('add',strtotime($value));
+ }
+ break;
+ case 'alpha_match':
+ Browse::set_filter('alpha_match',$value);
+ break;
+ default:
+ // Rien a faire
+ break;
+ } // end filter
+
+ return true;
+
+ } // set_filter
+
+ /**
* handshake
* This is the function that handles the verifying a new handshake
* this takes a timestamp, auth key, and client IP. Optionally it