summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-19 01:54:26 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-19 01:54:26 +0000
commitf3233e12d81813b2574af831472fb4136066f8ee (patch)
tree73beae1df334b79cb4274fa607311e54046c6cd4
parentd527e50395f3e76bbc6c76fcd4882dfbc88ff152 (diff)
downloadampache-f3233e12d81813b2574af831472fb4136066f8ee.tar.gz
ampache-f3233e12d81813b2574af831472fb4136066f8ee.tar.bz2
ampache-f3233e12d81813b2574af831472fb4136066f8ee.zip
sync to trunk
-rw-r--r--bin/fix_filenames.inc9
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--lib/class/vainfo.class.php15
3 files changed, 16 insertions, 11 deletions
diff --git a/bin/fix_filenames.inc b/bin/fix_filenames.inc
index cff22589..5f46f0e7 100644
--- a/bin/fix_filenames.inc
+++ b/bin/fix_filenames.inc
@@ -117,7 +117,14 @@ function charset_directory_correct($path) {
$verify_filename = iconv(Config::get('site_charset'),Config::get('site_charset') . '//IGNORE',$full_file);
if (strcmp($full_file,$verify_filename) != '0') {
- $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//IGNORE',$full_file);
+ $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//TRANSLIT',$full_file);
+
+ // Make sure the extension stayed the same
+ if (substr($translated_filename,strlen($translated_filename)-3,3) != substr($full_file,strlen($full_file)-3,3)) {
+ echo "Translation failure, stripping non-valid characters\n";
+ $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";
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 04f6a2be..bbef2ea1 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,9 @@
--------------------------------------------------------------------------
v.3.5-Alpha1
+ - Ignore getid3() iconv stuff doesn't seem to work
+ - Improved fix_filenames.inc, tries a translation first then strips
+ invalid characters
- Fixed album art not clearing thumbnail correctly on gather
- Fixed localplay instance not displaying correctly after change
until a page refresh
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php
index bc7f551d..3f87863e 100644
--- a/lib/class/vainfo.class.php
+++ b/lib/class/vainfo.class.php
@@ -68,7 +68,7 @@ class vainfo {
$this->_getID3->option_tags_html = false;
$this->_getID3->option_extra_info = false;
$this->_getID3->option_tag_lyrics3 = false;
- $this->_getID3->encoding = $this->encoding;
+// $this->_getID3->encoding = $this->encoding;
$this->_getID3->option_tags_process = true;
/* Check for ICONV */
@@ -485,19 +485,14 @@ class vainfo {
* in the file
*/
private function _clean_tag($tag,$encoding='') {
-
- /* Guess that it's UTF-8 */
- if (!$encoding) { $encoding = 'UTF-8'; }
- if ($this->_iconv AND strcasecmp($encoding,$this->encoding) != 0) {
+ // If we've got iconv then go ahead and clear her up
+ if ($this->_iconv) {
+ /* Guess that it's UTF-8 */
+ if (!$encoding) { $encoding = $this->_getID3->encoding; }
$charset = $this->encoding . '//TRANSLIT';
$tag = iconv($encoding,$charset,$tag);
}
- elseif ($this->_iconv) {
- // We have to transcode anyway and protect from non-[CHARGET] chars
- $charset = $this->encoding . '//IGNORE';
- $tag = iconv($this->encoding,$charset,$tag);
- }
return $tag;