diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-05-22 02:29:05 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-05-22 02:29:05 +0000 |
commit | d4b700e2fe1eeb47fbea7b61c295eba16f30c41c (patch) | |
tree | e4c7f478d0b20d0cf7823953c67ba238a08b7527 /bin | |
parent | cebb21facc2e2219f1d498def8ee19bbb4b72f7e (diff) | |
download | ampache-d4b700e2fe1eeb47fbea7b61c295eba16f30c41c.tar.gz ampache-d4b700e2fe1eeb47fbea7b61c295eba16f30c41c.tar.bz2 ampache-d4b700e2fe1eeb47fbea7b61c295eba16f30c41c.zip |
added ability to prune empty playlists
Diffstat (limited to 'bin')
-rw-r--r-- | bin/catalog_update.php.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/catalog_update.php.inc b/bin/catalog_update.php.inc index d03270b9..4ad80076 100644 --- a/bin/catalog_update.php.inc +++ b/bin/catalog_update.php.inc @@ -20,13 +20,21 @@ */ - $no_session='1'; require ("../modules/init.php"); echo "[catalog_update.php.inc]\nStarting Catalog Clean/Update And Add\n\n"; -$sql = "SELECT id FROM catalog WHERE catalog_type='local'"; +if (count($_SERVER['argv']) > 1) { + for ($x = 1; $x < count($_SERVER['argv']); $x++) { + if ($where) $where .= " OR "; + $where .= "name LIKE '%" . preg_replace("/[^a-z0-9\. -]/i", "", $_SERVER['argv'][$x]) . "%'"; + } +} +if ($where) $where = "($where) AND catalog_type='local'"; +else $where = "catalog_type='local'"; +$sql = "SELECT id FROM catalog"; +if ($where) $sql .= " WHERE $where"; $db_results = mysql_query($sql, dbh()); while ($r = mysql_fetch_row($db_results)) { |