Ignore:
Timestamp:
2009-01-06T19:03:58+13:00 (15 years ago)
Author:
ak19
Message:

Now plugins provide the option of base64 encoding or url encoding filenames that are to be renamed (when copied into the archives dir). Previously renamed files would always be url-encoded. URL-encoding is the default now for most plugins except MP3Plugin and OggVorbisPlugin, where the default is base64 encoding. Base64 encoding filenames upon renaming them was introduced so that more files that browsers try to open in external applications can open them, since url encoding does not seem to be implemented the same everywhere (for instance, windows media player is unable to handle url-encoded wmv filenames when such files are launched in it through the browser).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/MP3Plugin.pm

    r17026 r18320  
    6060    'desc' => "{MP3Plugin.metadata_fields}",
    6161    'type' => "string",
    62     'deft' => "Title,Artist,Genre" } ];
     62    'deft' => "Title,Artist,Genre" },
     63      { 'name' => "file_rename_method",
     64    'desc' => "{BasePlugin.file_rename_method}",
     65    'type' => "enum",
     66    'deft' => &get_default_file_rename_method(), # by default rename imported files and assoc files using this encoding
     67    'list' => $BasePlugin::file_rename_method_list,
     68    'reqd' => "no"
     69      } ];
    6370
    6471my $options = { 'name'     => "MP3Plugin",
     
    8390sub get_default_process_exp {
    8491    return q^(?i)\.mp3$^;
     92}
     93
     94# rename imported files and assoc files using base64 encoding by default
     95# so that the urls generated will always work with media files even when
     96# opened in external applications (when wmv file names contain spaces in
     97# them and they get url-encoded, wmv player fails to open the doubly url-
     98# encoded url reference to the url-encoded filename).
     99sub get_default_file_rename_method() {
     100    return "base64";
    85101}
    86102
Note: See TracChangeset for help on using the changeset viewer.