summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2012-10-12 16:31:27 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-10-15 13:20:27 -0400
commit8c4921f5f388f1f81000b2fbef9da35b0787e4d1 (patch)
tree91e76434642ba226ab44e3872478b67489a6783d
parentd7c0531871e2e67b55fcfc5277a863a35b7f0b6c (diff)
downloadampache-8c4921f5f388f1f81000b2fbef9da35b0787e4d1.tar.gz
ampache-8c4921f5f388f1f81000b2fbef9da35b0787e4d1.tar.bz2
ampache-8c4921f5f388f1f81000b2fbef9da35b0787e4d1.zip
Consistently use 'object_type' in playlist returns
-rw-r--r--lib/class/api.class.php2
-rw-r--r--lib/class/playlist.class.php12
-rw-r--r--lib/class/search.class.php4
-rw-r--r--lib/class/tmpplaylist.class.php6
-rw-r--r--server/ajax.server.php6
5 files changed, 20 insertions, 10 deletions
diff --git a/lib/class/api.class.php b/lib/class/api.class.php
index b204ad7b..75fc2a27 100644
--- a/lib/class/api.class.php
+++ b/lib/class/api.class.php
@@ -568,7 +568,7 @@ class Api {
$items = $playlist->get_items();
foreach ($items as $object) {
- if ($object['type'] == 'song') {
+ if ($object['object_type'] == 'song') {
$songs[] = $object['object_id'];
}
} // end foreach
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 92d28a07..75792f99 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -142,7 +142,12 @@ class Playlist extends playlist_object {
$db_results = Dba::read($sql);
while ($row = Dba::fetch_assoc($db_results)) {
- $results[] = array('type'=>$row['object_type'],'object_id'=>$row['object_id'],'track'=>$row['track'],'track_id'=>$row['id']);
+ $results[] = array(
+ 'object_type' => $row['object_type'],
+ 'object_id' => $row['object_id'],
+ 'track' => $row['track'],
+ 'track_id' => $row['id']
+ );
} // end while
return $results;
@@ -165,7 +170,10 @@ class Playlist extends playlist_object {
while ($row = Dba::fetch_assoc($db_results)) {
- $results[] = array('type'=>$row['object_type'],'object_id'=>$row['object_id']);
+ $results[] = array(
+ 'object_type' => $row['object_type'],
+ 'object_id' => $row['object_id']
+ );
} // end while
return $results;
diff --git a/lib/class/search.class.php b/lib/class/search.class.php
index 82a2654f..cd10fd5d 100644
--- a/lib/class/search.class.php
+++ b/lib/class/search.class.php
@@ -579,7 +579,7 @@ class Search extends playlist_object {
while ($row = Dba::fetch_assoc($db_results)) {
$results[] = array(
'object_id' => $row['id'],
- 'type' => $this->searchtype
+ 'object_type' => $this->searchtype
);
}
@@ -607,7 +607,7 @@ class Search extends playlist_object {
while ($row = Dba::fetch_assoc($db_results)) {
$results[] = array(
'object_id' => $row['id'],
- 'type' => $this->searchtype
+ 'object_type' => $this->searchtype
);
}
diff --git a/lib/class/tmpplaylist.class.php b/lib/class/tmpplaylist.class.php
index ba870a9b..ed557b0d 100644
--- a/lib/class/tmpplaylist.class.php
+++ b/lib/class/tmpplaylist.class.php
@@ -162,8 +162,10 @@ class tmpPlaylist extends database_object {
while ($results = Dba::fetch_assoc($db_results)) {
$key = $results['id'];
- $items[$key] = array($results['object_type'],
- $results['object_id']);
+ $items[$key] = array(
+ 'object_type' => $results['object_type'],
+ 'object_id' => $results['object_id']
+ );
}
return $items;
diff --git a/server/ajax.server.php b/server/ajax.server.php
index 06169eb9..186f35df 100644
--- a/server/ajax.server.php
+++ b/server/ajax.server.php
@@ -297,21 +297,21 @@ switch ($_REQUEST['action']) {
$playlist = new Playlist($_REQUEST['id']);
$items = $playlist->get_items();
foreach ($items as $item) {
- $GLOBALS['user']->playlist->add_object($item['object_id'],$item['type']);
+ $GLOBALS['user']->playlist->add_object($item['object_id'], $item['object_type']);
}
break;
case 'playlist_random':
$playlist = new Playlist($_REQUEST['id']);
$items = $playlist->get_random_items();
foreach ($items as $item) {
- $GLOBALS['user']->playlist->add_object($item['object_id'],$item['type']);
+ $GLOBALS['user']->playlist->add_object($item['object_id'], $item['object_type']);
}
break;
case 'smartplaylist':
$playlist = new Search('song', $_REQUEST['id']);
$items = $playlist->get_items();
foreach ($items as $item) {
- $GLOBALS['user']->playlist->add_object($item['object_id'],$item['type']);
+ $GLOBALS['user']->playlist->add_object($item['object_id'],$item['object_type']);
}
break;
case 'clear_all':