Changeset 24432

Show
Ignore:
Timestamp:
19.08.2011 17:58:42 (8 years ago)
Author:
davidb
Message:

Fix to parsing of returned metadata stored. Bracketed terms could include newline character. Need regexp that uses '/s'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/music-ir-src/trunk/perllib/plugins/jSongMinerExtractor.pm

    r22468 r24432  
    8888    # ARG 1: $to_decode is the string to URL decode 
    8989    my ($to_decode) = @_; 
    90     return uri_unescape($to_decode); 
     90    my $decoded= uri_unescape($to_decode); 
     91 
     92    return $decoded; 
    9193} 
    9294 
     
    108110 
    109111        $md_name =~ s/\+//g; 
    110         $md_value =~ s/\+//g; 
     112        $md_value =~ s/\+/ /g; 
    111113         
    112114        $md_name = urlDecode($md_name); 
    113115        $md_value = urlDecode($md_value); 
    114116 
    115         # $md_name =~ s/\s+//g; 
    116         $md_name =~ s/\(.*?\)$//; 
     117        # $md_name =~ s/\s+/ /sg; 
     118        $md_name =~ s/\(.*?\)$//s; # can stretch over multiple lines 
    117119        $md_name =~ s/Last\.FM/LastFM/g; 
    118120        $md_name =~ s/:/^/g; 
    119121        $md_name =~ s/(API)?\^/./; 
    120122 
    121         $doc_obj->add_metadata($top_section,$md_name,$md_value); 
     123        $doc_obj->add_utf8_metadata($top_section,$md_name,$md_value); 
    122124    } 
    123125 
     
    179181    $jsongminer_cmd .= " -artist \"$id3_artist\""; 
    180182    $jsongminer_cmd .= " -audio \"$source_file_path\""; 
    181     $jsongminer_cmd .= " -savefile \"$target_txt_file_path\""; 
    182 ##  $jsongminer_cmd .= " -saveacefile \"$target_acexml_file_path\""; 
     183    $jsongminer_cmd .= " -savetxtfile \"$target_txt_file_path\""; 
     184    $jsongminer_cmd .= " -saveacexmlfile \"$target_acexml_file_path\""; 
    183185     
    184186    if ($verbosity>2) {