summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-17 00:54:55 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-17 00:54:55 +0000
commita5d4acd8469d571c39f004431836f13d0ef1a5b6 (patch)
tree8b2a6f9b71e883333826b6837905a43b1533a234 /lib/class
parent81a854f7ea737ecdb05ebfb5d09209508f34b745 (diff)
downloadampache-a5d4acd8469d571c39f004431836f13d0ef1a5b6.tar.gz
ampache-a5d4acd8469d571c39f004431836f13d0ef1a5b6.tar.bz2
ampache-a5d4acd8469d571c39f004431836f13d0ef1a5b6.zip
fixed delete disabled and sort_files bin scripts
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/catalog.class.php21
-rw-r--r--lib/class/song.class.php6
-rw-r--r--lib/class/stream.class.php2
3 files changed, 14 insertions, 15 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index d5e8535f..ce5c3e0d 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -677,24 +677,23 @@ class Catalog {
} // get_catalog_albums
- /*!
- @function get_catalog_files
- @discussion Returns an array of song objects from a catalog
- @param $catalog_id=0 Specify the catalog ID you want to get the files of
- */
- function get_catalog_files($catalog_id=0) {
+ /**
+ * get_catalog_files
+ * Returns an array of song objects from a catalog, used by sort_files script
+ */
+ public function get_catalog_files($catalog_id=0) {
$results = array();
/* Use $this->id if nothing passed */
- if (!$catalog_id) { $catalog_id = $this->id; }
+ $catalog_id = $catalog_id ? Dba::escape($catalog_id) : Dba::escape($this->id);
- $sql = "SELECT id FROM song WHERE catalog='$catalog_id' AND enabled='1'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT `id` FROM `song` WHERE `catalog`='$catalog_id' AND `enabled`='1'";
+ $db_results = Dba::query($sql);
$results = array(); // return an emty array instead of nothing if no objects
- while ($r = mysql_fetch_object($db_results)) {
- $results[] = new Song($r->id);
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = new Song($r['id']);
} //end while
return $results;
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 8a9a6637..4aa773fd 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -725,13 +725,13 @@ class Song {
$year = $this->year;
/* Start replacing stuff */
- $replace_array = array('%a','%A','%t','%T','%y','%g');
- $content_array = array($artist,$album,$title,$track,$year,$genre);
+ $replace_array = array('%a','%A','%t','%T','%y','%g','/','\\');
+ $content_array = array($artist,$album,$title,$track,$year,$genre,'-','-');
$rename_pattern = str_replace($replace_array,$content_array,$catalog->rename_pattern);
$rename_pattern = preg_replace("[\-\:\!]","_",$rename_pattern);
-
+
$this->f_pattern = $rename_pattern;
$this->f_file = $rename_pattern . "." . $extension;
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 18350a0e..507cee02 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -309,7 +309,7 @@ class Stream {
header("Cache-control: public");
header("Content-Disposition: filename=playlist.asx");
- header("Content-Type: audio/x-ms-wax;");
+ header("Content-Type: audio/x-ms-wmv;");
echo "<ASX version = \"3.0\" BANNERBAR=\"AUTO\">\n";
echo "<TITLE>Ampache ASX Playlist</TITLE>";