1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

fix the update/add filters in the api and add them into artist and album

This commit is contained in:
Karl 'vollmerk' Vollmer 2009-03-09 00:59:44 +00:00
parent 6dbd87e078
commit 242401a915
2 changed files with 20 additions and 3 deletions

View file

@ -53,11 +53,22 @@ class Api {
// 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']);
Browse::set_filter('add_lt',strtotime($elements['1']));
Browse::set_filter('add_gt',strtotime($elements['0']));
}
else {
Browse::set_filter('add',strtotime($value));
Browse::set_filter('add_gt',strtotime($value));
}
break;
case 'update':
// Check for a range, if no range default to gt
if (strpos('/',$value)) {
$elements = explode('/',$value);
Browse::set_filter('update_lt',strtotime($elements['1']));
Browse::set_filter('update_gt',strtotime($elements['0']));
}
else {
Browse::set_filter('update_gt',strtotime($value));
}
break;
case 'alpha_match':

View file

@ -108,6 +108,8 @@ switch ($_REQUEST['action']) {
$method = $_REQUEST['exact'] ? 'exact_match' : 'alpha_match';
Api::set_filter($method,$_REQUEST['filter']);
Api::set_filter('add',$_REQUEST['add']);
Api::set_filter('update',$_REQUEST['update']);
// Set the offset
xmlData::set_offset($_REQUEST['offset']);
@ -150,6 +152,9 @@ switch ($_REQUEST['action']) {
$method = $_REQUEST['exact'] ? 'exact_match' : 'alpha_match';
Api::set_filter($method,$_REQUEST['filter']);
Api::set_filter('add',$_REQUEST['add']);
Api::set_filter('update',$_REQUEST['update']);
$albums = Browse::get_objects();
// Set the offset
@ -232,6 +237,7 @@ switch ($_REQUEST['action']) {
$method = $_REQUEST['exact'] ? 'exact_match' : 'alpha_match';
Api::set_filter($method,$_REQUEST['filter']);
Api::set_filter('add',$_REQUEST['add']);
Api::set_filter('update',$_REQUEST['update']);
$songs = Browse::get_objects();