summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 00:40:03 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 00:40:03 -0500
commit31920c88a7b109d789511f45502c6291a2e617a0 (patch)
tree38d0528740bc05aeb8ee4d7c646b1a9d24e89353
parentd86e605fedaf05e280bb027cc2b583406b3490c6 (diff)
downloadampache-31920c88a7b109d789511f45502c6291a2e617a0.tar.gz
ampache-31920c88a7b109d789511f45502c6291a2e617a0.tar.bz2
ampache-31920c88a7b109d789511f45502c6291a2e617a0.zip
Move Catalog::get_disabled() to Song
-rw-r--r--admin/catalog.php2
-rw-r--r--lib/class/catalog.class.php22
-rw-r--r--lib/class/song.class.php21
-rw-r--r--templates/show_admin_info.inc.php2
4 files changed, 23 insertions, 24 deletions
diff --git a/admin/catalog.php b/admin/catalog.php
index bcd69130..1df1b0e7 100644
--- a/admin/catalog.php
+++ b/admin/catalog.php
@@ -273,7 +273,7 @@ switch ($_REQUEST['action']) {
/* Stop the demo hippies */
if (Config::get('demo_mode')) { break; }
- $songs = $catalog->get_disabled();
+ $songs = Song::get_disabled();
if (count($songs)) {
require Config::get('prefix') . '/templates/show_disabled_songs.inc.php';
}
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 86ae20a8..ac83feb2 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -768,28 +768,6 @@ class Catalog extends database_object {
} //get_catalog_files
/**
- * get_disabled
- * Gets an array of the disabled songs for all catalogs
- * and returns full song objects with them
- */
- public static function get_disabled($count=0) {
-
- $results = array();
-
- if ($count) { $limit_clause = " LIMIT $count"; }
-
- $sql = "SELECT `id` FROM `song` WHERE `enabled`='0' $limit_clause";
- $db_results = Dba::read($sql);
-
- while ($r = Dba::fetch_assoc($db_results)) {
- $results[] = new Song($r['id']);
- }
-
- return $results;
-
- } // get_disabled
-
- /**
* dump_album_art
* This runs through all of the albums and tries to dump the
* art for them into the 'folder.jpg' file in the appropriate dir
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 8e48f87c..88c1b270 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -261,6 +261,27 @@ class Song extends database_object implements media {
}
/**
+ * get_disabled
+ *
+ * Gets a list of the disabled songs for and returns an array of Songs
+ */
+ public static function get_disabled($count = 0) {
+
+ $results = array();
+
+ $sql = "SELECT `id` FROM `song` WHERE `enabled`='0'";
+ if ($count) { $sql .= " LIMIT $count"; }
+ $db_results = Dba::read($sql);
+
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = new Song($r['id']);
+ }
+
+ return $results;
+
+ }
+
+ /**
* find_duplicates
*
* This function takes a search type and returns a list of probable
diff --git a/templates/show_admin_info.inc.php b/templates/show_admin_info.inc.php
index 439e281a..9e5f4bfa 100644
--- a/templates/show_admin_info.inc.php
+++ b/templates/show_admin_info.inc.php
@@ -26,7 +26,7 @@ $web_path = Config::get('web_path');
$flagged = Flag::get_recent(10);
/* Disabled Information Gathering */
-$songs = Catalog::get_disabled(10);
+$songs = Song::get_disabled(10);
?>
<?php show_box_top(T_('Last Ten Flagged Records')); ?>