Changeset 27647


Ignore:
Timestamp:
2013-06-18T10:37:02+12:00 (8 years ago)
Author:
jmt12
Message:

Add some more testing to ensure any local copy of a media file is the same size as the remote one (this was an issue in HDThriftFS when an incorrect CLASSPATH meant base91 encoding was only happening on one end of the connection)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video-and-audio/trunk/src/perllib/plugins/SimpleVideoPlugin.pm

    r27552 r27647  
    210210    my $local_ivideo_path = &FileUtils::filenameConcatenate($process_dir, $filename . ".ts");
    211211    &FileUtils::copyFiles($ivideo_path, $local_ivideo_path);
    212     $ivideo_path = $local_ivideo_path;
    213     print " - copied! [IOE:" . time() . "]\n";
     212    my $remote_size = &FileUtils::fileSize($ivideo_path);
     213    my $local_size = &FileUtils::fileSize($local_ivideo_path);
     214    if ($remote_size != $local_size)
     215    {
     216      die('Error! File copied is not of same size as original: ' . $remote_size . 'b != ' . $local_size . "b\n");
     217    }
     218    elsif (&FileUtils::fileExists($local_ivideo_path))
     219    {
     220      $ivideo_path = $local_ivideo_path;
     221      print ' - copied! [IOE:' . time() . "]\n";
     222    }
     223    else
     224    {
     225      die('Error! Failed to copy file: ' . $ivideo_path . ' => ' . $local_ivideo_path . ' [IOE:' . time() . "]\n");
     226    }
    214227  }
    215228
Note: See TracChangeset for help on using the changeset viewer.