Changeset 1732
- Timestamp:
- 09/02/08 00:11:43 (3 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
bin/print_tags.inc (modified) (1 diff)
-
docs/CHANGELOG (modified) (1 diff)
-
lib/class/catalog.class.php (modified) (3 diffs)
-
lib/class/vainfo.class.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/print_tags.inc
r1569 r1732 40 40 $catalog = new Catalog($results['id']); 41 41 42 $info = new vainfo($filename,'', $catalog->sort_pattern,$catalog->rename_pattern);42 $info = new vainfo($filename,'','','',$catalog->sort_pattern,$catalog->rename_pattern); 43 43 echo "Using: $catalog->sort_pattern AND $catalog->rename_pattern for file pattern matching\n"; 44 44 $info->get_info(); -
trunk/docs/CHANGELOG
r1722 r1732 5 5 -------------------------------------------------------------------------- 6 6 v.3.5-Alpha1 7 - Updated getid3 for multi-byte characters, but some wrong id3tags 8 have occurred exception error. 7 9 - Fixed use_auth = false not correctly re-creating the session if 8 10 you had just switched from use_auth = true -
trunk/lib/class/catalog.class.php
r1730 r1732 1075 1075 debug_event('tag-read',"Reading Tags from $song->file",'5','ampache-catalog'); 1076 1076 1077 $vainfo = new vainfo($song->file,'', $sort_pattern,$rename_pattern);1077 $vainfo = new vainfo($song->file,'','','',$sort_pattern,$rename_pattern); 1078 1078 $vainfo->get_info(); 1079 1079 … … 1503 1503 1504 1504 // Now nuke the tags themselves 1505 $sql = "DELETE FROM `tag` USING `tag` LEFT JOIN `tag_map` ON `tag`.` id`=`tag_map`.`tag_id` " .1505 $sql = "DELETE FROM `tag` USING `tag` LEFT JOIN `tag_map` ON `tag`.`map_id`=`tag_map`.`tag_id` " . 1506 1506 "WHERE `tag_map`.`id` IS NULL"; 1507 1507 $db_results = Dba::query($sql); … … 2001 2001 2002 2002 /* Create the vainfo object and get info */ 2003 $vainfo = new vainfo($file,'', $this->sort_pattern,$this->rename_pattern);2003 $vainfo = new vainfo($file,'','','',$this->sort_pattern,$this->rename_pattern); 2004 2004 $vainfo->get_info(); 2005 2005 -
trunk/lib/class/vainfo.class.php
r1675 r1732 29 29 /* Default Encoding */ 30 30 var $encoding = ''; 31 var $encoding_id3v1 = ''; 32 var $encoding_id3v2 = ''; 31 33 32 34 /* Loaded Variables */ … … 37 39 /* Internal Information */ 38 40 var $_raw = array(); 41 var $_raw2 = array(); 39 42 var $_getID3 = ''; 40 43 var $_iconv = false; … … 48 51 * actually pull the information 49 52 */ 50 function vainfo($file,$encoding='',$ dir_pattern,$file_pattern) {53 function vainfo($file,$encoding='',$encoding_id3v1='',$encoding_id3v2='',$dir_pattern,$file_pattern) { 51 54 52 55 $this->filename = $file; … … 64 67 // Initialize getID3 engine 65 68 $this->_getID3 = new getID3(); 69 70 // get id3tag encodings 71 $this->_raw2 = $this->_getID3->analyze($file); 72 if(function_exists('mb_detect_encoding')) { 73 $this->encoding_id3v1 = array(); 74 $this->encoding_id3v1[] = mb_detect_encoding($this->_raw2['tags']['id3v1']['artist']['0']); 75 $this->encoding_id3v1[] = mb_detect_encoding($this->_raw2['tags']['id3v1']['album']['0']); 76 $this->encoding_id3v1[] = mb_detect_encoding($this->_raw2['tags']['id3v1']['genre']['0']); 77 $this->encoding_id3v1[] = mb_detect_encoding($this->_raw2['tags']['id3v1']['title']['0']); 78 array_multisort($this->encoding_id3v1); 79 array_splice($this->encoding_id3v1, -4, 3); 80 if($this->encoding_id3v1[0] != "ASCII") { 81 $this->encoding_id3v1 = $this->encoding_id3v1[0]; 82 } else { 83 $this->encoding_id3v1 = "ISO-8859-1"; 84 } 85 86 87 $this->encoding_id3v2 = array(); 88 $this->encoding_id3v2[] = mb_detect_encoding($this->_raw2['tags']['id3v2']['artist']['0']); 89 $this->encoding_id3v2[] = mb_detect_encoding($this->_raw2['tags']['id3v2']['album']['0']); 90 $this->encoding_id3v2[] = mb_detect_encoding($this->_raw2['tags']['id3v2']['genre']['0']); 91 $this->encoding_id3v2[] = mb_detect_encoding($this->_raw2['tags']['id3v2']['title']['0']); 92 array_multisort($this->encoding_id3v2); 93 array_splice($this->encoding_id3v2, -4, 3); 94 if($this->encoding_id3v2[0] != "ASCII"){ 95 $this->encoding_id3v2 = $this->encoding_id3v2[0]; 96 } else { 97 $this->encoding_id3v2 = "ISO-8859-1"; 98 } 99 } 100 else { 101 $this->encoding_id3v1 = $encoding_id3v1; 102 $this->encoding_id3v2 = $encoding_id3v2; 103 } 104 66 105 $this->_getID3->option_md5_data = false; 67 106 $this->_getID3->option_md5_data_source = false; … … 70 109 $this->_getID3->option_tag_lyrics3 = false; 71 110 $this->_getID3->encoding = $this->encoding; 111 $this->_getID3->encoding_id3v1 = $this->encoding_id3v1; 112 $this->_getID3->encoding_id3v2 = $this->encoding_id3v2; 72 113 $this->_getID3->option_tags_process = true; 73 114
