You are here

function media_youtube_update_6014 in Media: YouTube 6

Self-correct for missing thumbnails from a previous mistake.

File

./media_youtube.install, line 217
This is Media: YouTube's installation, configuration, and removal file.

Code

function media_youtube_update_6014() {

  // Only run this function if we ran a bad version of update 6012.
  if (!media_youtube_variable_get('media_youtube_update_6012')) {

    // Ensure we don't go through all this again if we rerun this update...
    media_youtube_variable_set('media_youtube_update_6012', TRUE);
    if (module_exists('emthumb')) {

      // We may have accidentally dropped all stored thumbnails, if using emthumb.
      // In which case, we'll attempt to self-correct. Unfortunately, there will
      // be no way to retrieve custom thumbnails.
      return _media_youtube_fetch_metadata_batch_set('_media_youtube_update_retrieve_missing_thumbs', t('Restoring possibly missing thumbnails from YouTube.'), 'Restored missing YouTube thumbnails for the %field field.');
    }
  }
  return array();
}