WordPress.org

Plugin Directory

Changeset 626344


Ignore:
Timestamp:
11/17/12 02:35:12 (17 months ago)
Author:
dllh
Message:

Tumblr Importer: Mp3 files weren't importing properly. Turns out that the sideloader doesn't handle missing file extensions gracefully. Maybe there's a better way in core, but this gets around the issue for the importer, at least. Tumblr doesn't seem to mangle extensions for the other file types I've tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tumblr-importer/branches/newapi/tumblr-importer.php

    r626341 r626344  
    832832                    $post['format'] = 'audio'; 
    833833                    $post['media']['filename'] = basename( (string) $tpost->audio_url ); 
     834                    // If no .mp3 extension, add one so that sideloading works. 
     835                    if ( ! preg_match( '/\.mp3$/', $post['media']['filename'] ) ) 
     836                        $post['media']['filename'] .= '.mp3'; 
    834837                    $post['media']['audio'] = (string) $tpost->audio_url .'?plead=please-dont-download-this-or-our-lawyers-wont-let-us-host-audio'; 
    835838                    $post['post_content'] = (string) $tpost->player . "\n" . (string) $tpost->caption; 
Note: See TracChangeset for help on using the changeset viewer.