1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

few more fixes to sort files script

This commit is contained in:
Karl 'vollmerk' Vollmer 2006-01-08 21:37:49 +00:00
parent d2d40fdd0f
commit 7634fe3b04
3 changed files with 21 additions and 3 deletions

View file

@ -208,6 +208,8 @@ function sort_clean_name($string) {
/* First remove any / or \ chars */ /* First remove any / or \ chars */
$string = preg_replace("/[\/\\\]/","-",$string); $string = preg_replace("/[\/\\\]/","-",$string);
$string = str_replace(":"," ",$string);
return $string; return $string;
} // sort_clean_name } // sort_clean_name
@ -237,7 +239,7 @@ function sort_move_file($song,$fullname) {
unset($data[0]); unset($data[0]);
foreach ($data as $dir) { foreach ($data as $dir) {
$path .= "/" . $dir; $path .= "/" . $dir;
/* We need to check for the existance of this directory */ /* We need to check for the existance of this directory */
@ -264,6 +266,14 @@ function sort_move_file($song,$fullname) {
echo "\tSQL: $sql\n"; echo "\tSQL: $sql\n";
} }
else { else {
/* Check for file existance */
if (file_exists($fullname)) {
if (conf('debug')) { log_event('commandline','file exists','Error: $fullname already exists'); }
echo "Error: $fullname already exists\n";
return false;
}
$results = copy($song->file,$fullname); $results = copy($song->file,$fullname);
if (conf('debug')) { log_event('commandline','copy','Copied ' . $song->file . ' to ' . $fullname); } if (conf('debug')) { log_event('commandline','copy','Copied ' . $song->file . ' to ' . $fullname); }

View file

@ -4,6 +4,8 @@
-------------------------------------------------------------------------- --------------------------------------------------------------------------
v.3.3.2-Beta1 v.3.3.2-Beta1
- Fixed counting error when using the /bin/catalog_update.php.inc
script
- Fixed some minor theme issues with the built in themes - Fixed some minor theme issues with the built in themes
- Fixed some RSS problems, and linked it on header (Thx pb1dft) - Fixed some RSS problems, and linked it on header (Thx pb1dft)
- Fixed bug where you couldn't delete admin users because of an - Fixed bug where you couldn't delete admin users because of an

View file

@ -1190,13 +1190,15 @@ class Catalog {
$this->clean_stats(); $this->clean_stats();
$this->clean_playlists(); $this->clean_playlists();
$this->clean_flagged(); $this->clean_flagged();
$this->clean_genres(); ;$this->clean_genres();
/* Return dead files, so they can be listed */ /* Return dead files, so they can be listed */
echo "<b>" . _("Catalog Clean Done") . " [" . count($dead_files) . "] " . _("files removed") . "</b><br />\n"; echo "<b>" . _("Catalog Clean Done") . " [" . count($dead_files) . "] " . _("files removed") . "</b><br />\n";
flush(); flush();
return $dead_files; return $dead_files;
$this->count = 0;
} //clean_catalog } //clean_catalog
/** /**
@ -1571,6 +1573,10 @@ class Catalog {
echo "Update Finished. Checked $this->count. $total_updated songs updated.<br /><br />"; echo "Update Finished. Checked $this->count. $total_updated songs updated.<br /><br />";
$this->count = 0;
return true;
} //verify_catalog } //verify_catalog