diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-04-20 22:35:21 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-04-20 22:35:21 +0000 |
commit | 2801dae0767b84d0e6b842e55dbef5b656eb65f7 (patch) | |
tree | 19ae248e442ef12c7912430810eaf003711b1c50 /bin | |
parent | 6952af791f180929bb0e31c5f2e0942fe25df86d (diff) | |
download | ampache-2801dae0767b84d0e6b842e55dbef5b656eb65f7.tar.gz ampache-2801dae0767b84d0e6b842e55dbef5b656eb65f7.tar.bz2 ampache-2801dae0767b84d0e6b842e55dbef5b656eb65f7.zip |
fixed show album art, added input for source charset on fix_filenames, added "add" to shoutbox display, updated links
Diffstat (limited to 'bin')
-rw-r--r-- | bin/fix_filenames.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/fix_filenames.inc b/bin/fix_filenames.inc index 32ceedf2..cff22589 100644 --- a/bin/fix_filenames.inc +++ b/bin/fix_filenames.inc @@ -42,12 +42,20 @@ if (!function_exists('iconv')) { exit; } +// Attempt to figure out what the System Charset is +$source_encoding = iconv_get_encoding('output_encoding'); + // Attempt a simple translation $string = iconv(Config::get('site_charset'),Config::get('site_charset'),'For the Love of Music'); echo "Testing Basic Translation, the two strings below should look the same\n"; echo "Original: For the Love of Music\n"; echo "Translated: $string\n"; echo "---------------------------------------------------------------------\n"; +echo "Input Charset ($source_encoding):"; +$input = trim(fgets(STDIN)); + +if (strlen($input) > 0) { $source_encoding = trim($input); } +echo "Using $source_encoding as source character set\n"; $sql = "SELECT * FROM `catalog` WHERE `catalog_type`='local'"; @@ -55,10 +63,13 @@ $db_results = Dba::query($sql); while ($row = Dba::fetch_assoc($db_results)) { + echo "Checking " . $row['name'] . " (" . $row['path'] . ")\n"; charset_directory_correct($row['path']); } // end of the catalogs +echo "Finished checking filenames for valid chacters\n"; + /************************************************** ****************** FUNCTIONS ********************* @@ -103,9 +114,10 @@ function charset_directory_correct($path) { continue; } - $translated_filename = iconv(Config::get('site_charset'),Config::get('site_charset') . '//IGNORE',$full_file); + $verify_filename = iconv(Config::get('site_charset'),Config::get('site_charset') . '//IGNORE',$full_file); - if (strcmp($full_file,$translated_filename) != '0') { + if (strcmp($full_file,$verify_filename) != '0') { + $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//IGNORE',$full_file); echo "Attempting to Transcode to " . Config::get('site_charset') . "\n"; echo "--------------------------------------------------------------------------------------------\n"; echo "OLD:$full_file has invalid chars\nNEW:$translated_filename\n"; |