summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-19 23:06:21 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-19 23:06:21 +0000
commite35405ce69dcb132de2c46876c855b7b02b49a2a (patch)
treedf518b61b5eef60b0627f20567c0c904e7f79770 /lib/class/song.class.php
parentef684b03c2713959fc3eaa04e38b5ba08cafd35c (diff)
downloadampache-e35405ce69dcb132de2c46876c855b7b02b49a2a.tar.gz
ampache-e35405ce69dcb132de2c46876c855b7b02b49a2a.tar.bz2
ampache-e35405ce69dcb132de2c46876c855b7b02b49a2a.zip
allow add or verify on a specified sub directory of an existing catalog
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 5b94ac38..aa3c2f86 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -742,11 +742,32 @@ class Song extends database_object {
} // format_pattern
/**
+ * get_from_path
+ * This returns all of the songs that exist under the specified path
+ */
+ public static function get_from_path($path) {
+
+ $path = Dba::escape($path);
+
+ $sql = "SELECT * FROM `song` WHERE `file` LIKE '$path%'";
+ $db_results = Dba::read($sql);
+
+ $songs = array();
+
+ while ($row = Dba::fetch_assoc($db_results)) {
+ $songs[] = $row['id'];
+ }
+
+ return $songs;
+
+ } // get_from_path
+
+ /**
* @function get_rel_path
* @discussion returns the path of the song file stripped of the catalog path
* used for mpd playback
*/
- function get_rel_path($file_path=0,$catalog_id=0) {
+ public function get_rel_path($file_path=0,$catalog_id=0) {
if (!$file_path) {
$info = $this->_get_info();