Changeset 34367


Ignore:
Timestamp:
2020-09-14T11:29:43+12:00 (4 years ago)
Author:
davidb
Message:

Now supports https URLs as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/mars-src/trunk/perllib/plugins/AMCMetadataJSONPlugin.pm

    r34356 r34367  
    166166
    167167    my $local_audio_file = $audio_url;
    168     $local_audio_file =~ s/^http:\/\/.*\///;
    169    
    170     print STDERR "***** local audio file = $local_audio_file\n";
     168    $local_audio_file =~ s/^http(s?):\/\/.*\///;
     169    my ($amc_id) = ($local_audio_file =~ m/^(.+)(?:\..+?)$/);
     170
     171    ## print STDERR "***** local audio file = $local_audio_file\n";
    171172 
     173    # Set up metadata table based on JSON file read in
    172174    foreach my $k (keys %$json_metadata) {
    173175    $json_metadata->{'amc.'.$k} = [ $json_metadata->{$k} ];
    174176    delete $json_metadata->{$k};
    175177    }
    176 
     178    $json_metadata->{'amc.id'} = [ $amc_id ];
    177179
    178180#    my $json_filename = shift(@$json_trackurl_array);
     
    184186
    185187###  print STDERR "**** setting up mapping for: $json_filename\n";
    186 
     188   
     189    # Set up mapping from local_audio_file to the created JSON metadata table
     190    # so it 'sticks' to the file
    187191    $extrametadata->{$local_audio_file} = $json_metadata;
    188192    push(@$extrametakeys, $local_audio_file);
Note: See TracChangeset for help on using the changeset viewer.