diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-08 21:37:49 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-08 21:37:49 +0000 |
commit | 7634fe3b04fadd8aa6c17dcd78d4e5f268492ec9 (patch) | |
tree | 9bc2555e461dd6e25df573ccd6b9e99ade500d33 /bin | |
parent | d2d40fdd0f1701bec29a9de2da2b467d74747956 (diff) | |
download | ampache-7634fe3b04fadd8aa6c17dcd78d4e5f268492ec9.tar.gz ampache-7634fe3b04fadd8aa6c17dcd78d4e5f268492ec9.tar.bz2 ampache-7634fe3b04fadd8aa6c17dcd78d4e5f268492ec9.zip |
few more fixes to sort files script
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sort_files.php.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/sort_files.php.inc b/bin/sort_files.php.inc index db259810..8fd2b673 100644 --- a/bin/sort_files.php.inc +++ b/bin/sort_files.php.inc @@ -208,6 +208,8 @@ function sort_clean_name($string) { /* First remove any / or \ chars */ $string = preg_replace("/[\/\\\]/","-",$string); + $string = str_replace(":"," ",$string); + return $string; } // sort_clean_name @@ -237,7 +239,7 @@ function sort_move_file($song,$fullname) { unset($data[0]); foreach ($data as $dir) { - + $path .= "/" . $dir; /* We need to check for the existance of this directory */ @@ -264,6 +266,14 @@ function sort_move_file($song,$fullname) { echo "\tSQL: $sql\n"; } 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); if (conf('debug')) { log_event('commandline','copy','Copied ' . $song->file . ' to ' . $fullname); } |