Changeset 4467 for extensions/pLoader
- Timestamp:
- Dec 10, 2009, 3:21:06 PM (15 years ago)
- Location:
- extensions/pLoader/trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pLoader/trunk/locale/fr_FR/pLoader.po
r4422 r4467 41 41 msgstr "Transfert haute définition ( taille originale )" 42 42 43 msgid "Upload high definition :" 44 msgstr "Transfert haute définition :" 45 46 msgid "High definition" 47 msgstr "Haute définition" 48 43 49 msgid "Yes" 44 50 msgstr "Oui" … … 491 497 msgstr "Erreur de communication avec" 492 498 499 msgid "Thumbnail image done for" 500 msgstr "Miniature de l'image terminée pour" 501 502 msgid "HD image done for" 503 msgstr "Image haute définition terminée pour" 504 505 msgid "Resized image done for" 506 msgstr "Image réduite terminée pour" 507 493 508 msgid "Uploaded" 494 509 msgstr "Transféré" … … 532 547 msgid "HD image interlace :" 533 548 msgstr "Entrelacement de l'image HD :" 549 550 msgid "nothing" 551 msgstr "ne rien faire" 552 553 msgid "replace" 554 msgstr "remplacer" 555 556 msgid "fill if empty (only replace properties currently empty in Piwigo)" 557 msgstr "remplir si non renseigné (ne remplacer que les propriétés vides dans Piwigo)" 558 559 msgid "append (keep existing and add new)" 560 msgstr "cumuler (garder l'existant et ajouter)" 561 562 msgid "Do not ask me again" 563 msgstr "Ne plus me demander" 564 565 msgid "A least one photo has already been added in the past." 566 msgstr "Au moins une photo a déjà été ajoutée dans le passé." 567 568 msgid "What shall we do with files? (thumbnail, resized, high resolution)" 569 msgstr "Que faire pour les fichiers ? (miniature, taille web, haute définition)" 570 571 msgid "What shall we do with single value properties?(caption, comment, author, create date)" 572 msgstr "Que faire pour les propriétés simples ? (titre, commentaire, auteur, date de création)" 573 574 msgid "What shall we do with multiple values properties? (categories, tags)" 575 msgstr "Que faire pour les propriétés à valeurs multiples ? (catégories, tags)" 576 577 msgid "Photo update management" 578 msgstr "Gestion de la mise à jour des photos" -
extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm
r4422 r4467 519 519 watermark_x => 10, 520 520 watermark_color => 'White', 521 reupload_action_files => 1, 522 reupload_action_properties => 2, 523 reupload_action_properties_m => 1, 521 524 }; 522 525 -
extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm
r4422 r4467 148 148 use Uploader::GUI::wxImageProcessingProgressDlg; 149 149 use Uploader::GUI::wxChoiceFilteredPanel; 150 use Uploader::GUI::wxImageReuploadDlg; 150 151 use Wx::Html; 151 152 use Uploader::GUI::wxImagePreview; … … 155 156 use Storable; 156 157 use Uploader::GUI::wxPropertyGridPanel; 158 use Uploader::GUI::wxPhotoProperties; 157 159 use utf8; 158 160 $|=1; … … 206 208 sub { $self->UploadImagesViewerRefresh(@_) } 207 209 ); 210 211 $self->imagelist->ReuploadCallback( 212 sub { 213 Uploader::GUI::wxImageReuploadDlg->new( 214 { 215 title => gettext("Photo update management"), 216 properties => { 217 $main::ID_REUPLOAD_ACTION_FILES => { 218 selection=>sub {$self->imagelist->reupload_action_files(@_)}, 219 label=>gettext("What shall we do with files? (thumbnail, resized, high resolution)"), 220 labels=>[ 221 gettext("nothing"), 222 gettext("replace"), 223 ], 224 }, 225 $main::ID_REUPLOAD_ACTION_PROPERTIES => { 226 selection=>sub{$self->imagelist->reupload_action_properties(@_)}, 227 label=>gettext("What shall we do with single value properties?(caption, comment, author, create date)"), 228 labels=>[ 229 gettext("nothing"), 230 gettext("fill if empty (only replace properties currently empty in Piwigo)"), 231 gettext("replace"), 232 ], 233 }, 234 $main::ID_REUPLOAD_ACTION_PROPERTIES_M => { 235 selection=>sub{$self->imagelist->reupload_action_properties_m(@_)}, 236 label=>gettext("What shall we do with multiple values properties? (categories, tags)"), 237 labels=>[ 238 gettext("nothing"), 239 gettext("append (keep existing and add new)"), 240 gettext("replace"), 241 ], 242 }, 243 $main::ID_REUPLOAD_NOT_ASK => { 244 value=>sub{$self->imagelist->reupload_not_ask(@_)}, 245 label=>gettext("Do not ask me again"), 246 }, 247 $main::ID_REUPLOAD_TEXT => { 248 label=>gettext("A least one photo has already been added in the past."), 249 }, 250 }, 251 } 252 )->ShowModal(); 253 } 254 ); 208 255 209 256 … … 277 324 sub _set_setting_properties { 278 325 my ( $self ) = @_; 326 279 327 280 328 $self->piwigo_properties( … … 607 655 } 608 656 ( 609 657 $self->image_prop_piwigo, 610 658 $self->image_prop_exif, 611 659 $self->image_prop_tags, … … 663 711 sub _refresh_settings_panels_properties { 664 712 my ( $self ) = @_; 665 713 666 714 $self->image_prop_piwigo->properties( 667 715 $self->piwigo_properties … … 701 749 sub _init_settings_panels { 702 750 my ( $self ) = @_; 751 703 752 704 753 $self->image_prop_piwigo( … … 868 917 ->CenterPane->Resizable->CloseButton(0) ); 869 918 919 870 920 $self->manager->AddPane( 871 921 $self->create_tree, … … 1079 1129 [ 1080 1130 $self->hd_settings_panel, 1081 gettext("H D"),1131 gettext("High definition"), 1082 1132 ], 1083 1133 [ … … 1745 1795 my ( $self ) = @_; 1746 1796 1797 1747 1798 $self->imageviewer->Refresh; 1799 1800 $self->image_preview->image( 1801 0 1802 ) if !$self->imageviewer->GetItemCount; 1803 1804 1805 $self->image_preview->Refresh; 1748 1806 Wx::Yield(); 1749 1807 } … … 1841 1899 1842 1900 my $wximagelist = $self->imagelist->wx_thumb_imglist; 1843 print Dumper "SetNewFilesViewerRefresh", $self->imagelist->current_image;1901 #print Dumper "SetNewFilesViewerRefresh", $self->imagelist->current_image; 1844 1902 my $indx = $wximagelist->Add( 1845 1903 Wx::Bitmap->new( -
extensions/pLoader/trunk/src/Uploader/ImageList.pm
r4422 r4467 95 95 use_exif_preview 96 96 image_sums 97 upload_image_sums 97 98 sums 98 99 version … … 120 121 upload_file 121 122 upload_name 123 ReuploadCallback 124 reupload_action_files 125 reupload_action_properties 126 reupload_action_properties_m 127 reupload_not_ask 122 128 / 123 129 ); … … 253 259 # ok 254 260 if(!$@){ 255 $self->progress_msg( "Selection thumbnail created for %s");261 $self->progress_msg(gettext("Selection thumbnail created for %s")); 256 262 } 257 263 else { … … 554 560 555 561 my $rval = 1 ; 556 return $rval if( -e $self->current_image->site_resized_file );562 #return $rval if( -e $self->current_image->site_resized_file ); 557 563 558 564 printf( … … 634 640 my ( $self ) = @_; 635 641 636 return 1 if( -e $self->current_image->site_thumb_file );642 #return 1 if( -e $self->current_image->site_thumb_file ); 637 643 638 644 my $rval = 1; … … 765 771 watermark_x 766 772 watermark_color 773 reupload_action_files 774 reupload_action_properties 775 reupload_action_properties_m 767 776 / 768 777 ] … … 797 806 $self->upload_begin_time(time); 798 807 $self->upload_selection_count(scalar @{$self->image_selection}); 808 # for re-upload management 809 $self->upload_image_sums( [ 810 map { $self->GetImage($_)->file_sum } 811 @{$self->image_selection} 812 ] 813 ); 814 815 # check if already exist on server 816 my $uploaded = $self->pwg->IsAlreadyUploaded($self->upload_image_sums); 817 my @already_uploaded = grep { $_ } values %$uploaded ; 818 $self->ReuploadCallback->() if ( scalar @already_uploaded and !$self->reupload_not_ask ); 819 820 799 821 foreach(@{$self->image_selection}) { 800 822 # current image object 801 823 $self->current_image( 802 824 $self->GetImage($_) 803 ); 825 ); 804 826 # prepare resized, high, thumbnail 805 $self->_upload_selection_prepare(); 827 # if not already uploaded 828 $self->_set_site_resized_file(); 829 $self-> _set_site_high_file (); 830 # photo metadata 831 $self->_prepare_upload_properties(); 832 $self->_upload_selection_prepare() if (!$uploaded->{$self->current_image->file_sum} or $self->reupload_action_files); 806 833 807 834 # transfert resized, high, thumbnail to site … … 827 854 $self->progress_thumbnail_refresh->(); 828 855 # PREPARE 829 $self->_set_site_resized_file();830 856 $self->_set_upload_msg(gettext("Preparing resized image for")); 831 857 $self->_upload_progress(); … … 848 874 'Yes, use a copy of the original photo' => 'ORIGINAL', 849 875 }; 850 876 printf("upload HD %s\n", $self->upload_hd); 851 877 $self->upload_high( 852 878 $decode->{$self->upload_hd} … … 866 892 $self->_upload_progress(); 867 893 868 # photo metadata869 $self->_prepare_upload_properties();870 894 871 895 } … … 923 947 highdef_msg=>gettext("Uploading high definition"), 924 948 checksum_msg=>gettext("Checksum for"), 949 original_sum=>$self->current_image->file_sum, 925 950 } 926 951 ); … … 1102 1127 1103 1128 if($bModifyOriginal){ 1104 $self-> _set_site_high_file ();1105 1129 1106 1130 my $image = Image::Magick->new(); … … 1238 1262 sub _prepare_upload_properties { 1239 1263 my ( $self ) = @_; 1264 1265 $self->pwg->reupload_action_files( 1266 $self->reupload_action_files||1 1267 ); 1268 $self->pwg->reupload_action_properties( 1269 $self->reupload_action_properties||2 1270 ); 1271 1272 $self->pwg->reupload_action_properties_m( 1273 $self->reupload_action_properties_m||1 1274 ); 1240 1275 1241 1276 $self->pwg->upload_high( … … 1285 1320 join(',', @{$self->current_image->site_tags}) 1286 1321 ); 1322 1287 1323 1288 1324 } -
extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm
r4422 r4467 61 61 upload_high 62 62 chunk_size 63 sum_high_file 64 sum_resized_file 65 sum_thumb_file 66 sum_original_file 63 sum 64 image_id 65 typecode 66 reupload_action_files 67 reupload_action_properties 68 reupload_action_properties_m 69 single_value_mode 70 multiple_value_mode 67 71 / 68 72 ); … … 72 76 sub Init { 73 77 my ( $self, $version ) = @_ ; 74 78 79 # to transform a type_code into a typename 80 $self->typecode( 81 { 82 file => 'file', 83 thumbnail => 'thumb', 84 high => 'high', 85 } 86 ); 87 88 $self->single_value_mode( 89 { 90 1 => 'fill_if_empty', 91 2 => 'replace', 92 } 93 ); 94 95 $self->multiple_value_mode( 96 { 97 1 => 'append', 98 2 => 'replace', 99 } 100 ); 101 75 102 $self->uagent( 76 103 LWP::UserAgent->new( … … 125 152 }; 126 153 127 $self->uagent_response( 128 $self->uagent->post( 129 $self->urlbase.'/ws.php?format=json', 130 $form 131 ) 132 ); 133 154 $self->_execute_post( 155 $form 156 ); 157 158 $self->login_result( 159 $self->_json_response_content 160 ); 161 162 } 163 164 sub _json_response_content { 165 my ( $self ) = @_; 166 134 167 my $hresult = {} ; 135 168 136 169 if($self->uagent_response->is_success){ 170 # when server response has warnings, the content response is not a valid json string 171 # find the json response 172 #printf("%s\n", $self->uagent_response->content); 173 $self->uagent_response->content =~ /(\{.+\})/; 174 #printf("json response %s\n", $1); 137 175 eval { 138 176 $hresult = from_json( 139 $ self->uagent_response->content177 $1 140 178 ); 141 179 }; 180 142 181 } 143 182 else{ 144 183 $hresult = { 145 184 'message' => $self->uagent_response->message, 146 185 'stat' => 'fail', 147 186 }; 148 187 } 149 150 $self->login_result( 151 $hresult 152 ); 153 154 } 155 156 sub GetCategories { 157 my ( $self ) = @_; 158 159 my $result; 188 189 $hresult; 190 } 191 192 sub _execute_get { 193 my ( $self, $query ) = @_; 194 160 195 eval { 161 $result = $self->uagent->get( 162 $self->qry_list_categories 196 $self->uagent_response( 197 $self->uagent->get( 198 $query 199 ) 163 200 ); 164 201 }; … … 166 203 if($@){ 167 204 printf("An error occured in query execution %s\n%s", 168 $ self->qry_list_categories,205 $query, 169 206 $@, 170 207 ); 171 208 } 172 my $hresult; 173 174 eval { 175 $hresult = from_json( 176 $result->content 177 ); 178 }; 179 180 $hresult ||= {}; 181 182 my $categories = $hresult->{result}{categories}; 183 184 $categories; 185 } 186 187 sub GetTags { 188 my ( $self ) = @_; 209 } 210 211 sub _execute_post { 212 my ( $self, $form ) = @_; 189 213 190 214 my $result; 191 215 eval { 192 $result = $self->uagent->get( 193 $self->qry_list_tags 216 $result = $self->uagent_response( 217 $self->uagent->post( 218 $self->urlbase.'/ws.php?format=json', 219 $form 220 ) 194 221 ); 195 222 }; 196 223 197 224 if($@){ 198 printf("An error occured in queryexecution %s\n%s",199 $ self->qry_list_tags,225 printf("An error occured in post execution %s\n%s", 226 $form->{method}, 200 227 $@, 201 228 ); 202 229 } 203 my $hresult; 204 205 eval { 206 $hresult = from_json( 207 $result->content 208 ); 209 }; 210 211 $hresult ||= {}; 212 213 $hresult->{result}{tags}; 230 231 return ( $result->is_success, $result->status_line ); 232 } 233 sub GetCategories { 234 my ( $self ) = @_; 235 236 237 $self->_execute_get( 238 $self->qry_list_categories 239 ); 240 $self->_json_response_content->{result}{categories}; 241 } 242 243 sub GetTags { 244 my ( $self ) = @_; 245 246 $self->_execute_get( 247 $self->qry_list_tags 248 ); 249 $self->_json_response_content->{result}{tags}; 214 250 } 215 251 … … 223 259 }; 224 260 225 my $result = $self->uagent->post( 226 $self->urlbase.'/ws.php?format=json', 227 $form 228 ); 229 230 my $content = {}; 231 eval { 232 $content = from_json( 233 $result->content 234 ); 235 }; 236 237 return ( $result->is_success, $result->status_line, $content ); 238 261 return ( $self->_execute_post($form), $self->_json_response_content ); 239 262 } 240 263 … … 243 266 my ( $self, $progress ) = @_; 244 267 245 $self->sum_resized_file( 246 $self->_checksum( 247 $self->site_resized_file, 248 $progress 249 ) 250 ); 251 252 $self->sum_thumb_file( 253 $self->_checksum( 254 $self->site_thumb_file, 255 $progress 256 ) 257 ); 258 259 $self->sum_high_file( 260 $self->_checksum( 261 $self->site_high_file, 262 $progress 263 ) 264 ); 265 # is the same in pLoader but may be different 266 $self->sum_original_file( 267 $self->sum_high_file 268 ); 269 270 271 my $site_image_name = $self->site_image_name; 272 273 my $image_id = $self->_exists($self->sum_original_file);; 274 my $status = 0; 275 my $status_line = "An error has occured during upload."; 268 $self->image_id( 269 $self->_exists($progress->{original_sum}) 270 ); 271 272 my $status = 1; 273 my $status_line ="OK"; 276 274 my $content = {}; 277 275 my $doubleCheck; 278 276 my $form; 279 while(1){ 280 if(!defined($image_id)){ 281 282 my $resized_params = $self->_send_chunks('file', $progress); 283 $status_line = $resized_params->{message}; 284 last if !$resized_params->{ok}; 277 UPLOAD: while(1){ 278 # first upload 279 if(!defined($self->image_id)){ 280 $doubleCheck = 1; 281 $self->_checksum_files($progress); 282 my @types = ('file', 'thumb'); 283 push @types, 'high' if $self->upload_high; 284 map{ 285 my $rval = $self->_send_chunks($_, $progress); 286 $status_line = $rval->{message}; 287 last UPLOAD if !$rval->{ok}; 288 } @types; 285 289 286 my $thumb_params = $self->_send_chunks('thumb', $progress);287 $status_line = $thumb_params->{message};288 last if !$thumb_params->{ok};289 290 290 291 $form = { 291 292 method => 'pwg.images.add', 292 original_sum => $self->sum _original_file,293 file_sum => $self->sum _resized_file,294 thumbnail_sum => $self->sum _thumb_file,293 original_sum => $self->sum->{original}, 294 file_sum => $self->sum->{file}, 295 thumbnail_sum => $self->sum->{thumb}, 295 296 categories => $self->categories, 296 name => $site_image_name, 297 rank => $self->rank, 297 name => $self->site_image_name, 298 298 author => $self->site_author, 299 299 comment => $self->site_comment, … … 302 302 303 303 }; 304 305 if($self->upload_high){ 306 my $high_params = $self->_send_chunks('high', $progress); 307 $status_line = $high_params->{message}; 308 last if !$high_params->{ok}; 309 # high is a HD resized copy of original 310 $form->{high_sum} = $self->sum_high_file; 304 305 $form->{high_sum} = $self->sum->{high} if $self->upload_high; 306 307 $progress->{yield}->(); 308 ( $status, $status_line ) = $self->_execute_post($form); 309 } 310 # re-upload 311 else{ 312 #printf("reupload, files %s, properties %s\n", $self->reupload_action_files, $self->reupload_action_properties); 313 # need to check if files have changed 314 # and update image info 315 if($self->reupload_action_files){ 316 $self->_checksum_files($progress); 317 my $files = $self->_check_files(); 318 if(defined($files)){ 319 $self->_add_files($files, $progress); 320 } 311 321 } 312 $doubleCheck = 1; 313 } 314 else { 322 315 323 $form = { 316 method => 'pwg.images.setInfo', 317 image_id => $image_id, 318 categories => $self->categories, 319 name => $site_image_name, 320 rank => $self->rank, 321 author => $self->site_author, 322 comment => $self->site_comment, 323 date_creation => $self->site_img_date_creation, 324 tag_ids => $self->site_tags, 324 method => 'pwg.images.setInfo', 325 image_id => $self->image_id, 326 }; 327 # update metadata info 328 if($self->reupload_action_properties){ 329 #printf("reupload_action_properties %s\n", $self->reupload_action_properties); 330 $form->{name} = $self->site_image_name; 331 $form->{author} = $self->site_author; 332 $form->{comment} = $self->site_comment; 333 $form->{date_creation} = $self->site_img_date_creation; 334 $form->{single_value_mode} = $self->single_value_mode->{$self->reupload_action_properties}; 335 } 336 if($self->reupload_action_properties_m){ 337 #printf("reupload_action_properties_m %s\n", $self->reupload_action_properties_m); 338 $form->{tag_ids} = $self->site_tags if $self->site_tags; 339 $form->{categories} = $self->categories; 340 $form->{multiple_value_mode} = $self->multiple_value_mode->{$self->reupload_action_properties_m}; 325 341 }; 326 342 $progress->{yield}->(); 327 } 343 ( $status, $status_line ) = $self->_execute_post($form); 344 } 328 345 329 346 delete $form->{tag_ids} unless defined $self->site_tags; … … 331 348 332 349 $progress->{yield}->(); 333 my $result = $self->uagent->post( 334 $self->urlbase.'/ws.php?format=json', 335 $form 336 ); 337 eval { 338 $content = from_json( 339 $result->content 340 ); 341 }; 342 343 344 $status = $result->is_success; 345 $status_line = $result->status_line; 346 347 if($doubleCheck){ 348 $content->{stat} = 'fail' if !$self->_exists($self->sum_original_file); 350 #print "form ", Dumper $form; 351 #print "status ", $status, "\n"; 352 #print "status_line ", $status_line, "\n"; 353 # basic check, should perform a checkfile 354 $content->{stat} = !$self->_exists($progress->{original_sum}) ? 'fail' : 'ok'; 355 356 last UPLOAD; 357 }# UPLOAD 358 359 return ( $status, $status_line, $content); 360 } 361 362 sub _checksum_files { 363 my ( $self, $progress ) = @_; 364 365 $self->sum( 366 { 367 file => $self->_checksum( 368 $self->site_resized_file, 369 $progress 370 ), 371 thumb => $self->_checksum( 372 $self->site_thumb_file, 373 $progress 374 ), 375 high => $self->_checksum( 376 $self->site_high_file, 377 $progress 378 ), 379 original => $progress->{original_sum} 349 380 } 350 351 last; 381 ); 382 } 383 384 sub _check_files { 385 my ( $self ) = @_; 386 387 my $form = { 388 method => 'pwg.images.checkFiles', 389 image_id => $self->image_id, 390 }; 391 392 @$form{'thumbnail_sum', 'file_sum' } = ( 393 $self->sum->{thumb}, 394 $self->sum->{file}, 395 ); 396 397 if($self->upload_high){ 398 $form->{high_sum} = $self->sum->{high}; 352 399 } 353 354 return ( $status, $status_line, $content); 400 401 $self->_execute_post($form); 402 my $hresult = $self->_json_response_content; 403 404 my $rval = 'ok' eq $hresult->{stat} ? $hresult->{result} : undef; 405 406 $rval; 407 } 408 409 # $files is returned by _check_files 410 # { 411 # thumbnail => 'equals', 'differs', 'missing' 412 # file => 'equals', 'differs', 'missing' 413 # high => 'equals', 'differs', 'missing' 414 #} 415 416 sub _add_files { 417 my ( $self, $files, $progress ) = @_; 418 419 map{ 420 $self->_add_file($_, $progress); 421 } 422 map{ 423 $self->typecode->{$_}; 424 } grep { 'equals' ne $files->{$_} } keys %$files ; 425 426 } 427 428 sub _add_file { 429 my ( $self, $type_code, $progress ) = @_; 430 431 $self->_send_chunks( 432 $type_code, 433 $progress, 434 ); 435 436 my $form = { 437 method => 'pwg.images.addFile', 438 image_id => $self->image_id, 439 type => $type_code, 440 sum => $self->sum->{$type_code}, 441 }; 442 443 $self->_execute_post($form); 444 my $hresult = $self->_json_response_content; 445 print Dumper $hresult; 446 my $rval = 'ok' eq $hresult->{stat} ? $hresult->{result} : undef; 447 448 $rval; 449 } 450 451 sub IsAlreadyUploaded { 452 my ( $self, $md5_sums ) = @_; 453 454 # md5_sums is an array ref 455 $self->_execute_post({ 456 method => 'pwg.images.exist', 457 md5sum_list => join(',', @$md5_sums) 458 } 459 ); 460 461 my $sums = $self->_json_response_content->{result}; 462 463 $sums; 355 464 } 356 465 … … 363 472 }; 364 473 365 my $result = $self->uagent->post( 366 $self->urlbase.'/ws.php?format=json', 367 $form 368 ); 369 370 my $hresult = {}; 371 eval { 372 $hresult = from_json( 373 $result->{_content} 374 ); 375 }; 376 my $id; 377 $id = $hresult->{result}{$self->sum_original_file} if 'ok' eq $hresult->{stat}; 378 474 $self->_execute_post($form); 475 my $hresult = $self->_json_response_content; 476 477 $hresult->{result} = {} if 'HASH' ne ref $hresult->{result}; 478 my $id = 'ok' eq $hresult->{stat} ? $hresult->{result}{$md5_sum} : undef ; 479 379 480 $id; 380 481 } … … 405 506 406 507 sub _send_chunks { 407 my ( $self, $type , $progress ) = @_;508 my ( $self, $type_code, $progress ) = @_; 408 509 409 510 my $msg = { … … 419 520 }; 420 521 421 $progress->{current_msg} = $progress->{$msg->{$type }};522 $progress->{current_msg} = $progress->{$msg->{$type_code}}; 422 523 $progress->{yield}->(); 423 524 424 525 my $params = { 425 filepath => $filepath->{$type },426 type => $type ,427 original_sum => $self->sum _original_file,428 }; 429 526 filepath => $filepath->{$type_code}, 527 type => $type_code, 528 original_sum => $self->sum->{original}, 529 }; 530 print Dumper $params; 430 531 $self->send_chunks( 431 532 $params, … … 446 547 447 548 }; 448 449 my $result = $self->uagent->post(450 $self->urlbase.'/ws.php?format=json',451 $form452 );453 454 my $content = {};455 eval {456 $content = from_json(457 $result->content458 );459 };460 461 return ( $result->is_success, $result->status_line, $content );462 549 550 return ( $self->_execute_post($form), $self->_json_response_content ); 463 551 } 464 552 … … 474 562 }; 475 563 476 my $result = $self->uagent->post( 477 $self->urlbase.'/ws.php?format=json', 478 $form 479 ); 480 481 my $content = {}; 482 eval { 483 $content = from_json( 484 $result->content 485 ); 486 }; 487 488 return ( $result->is_success, $result->status_line, $content ); 489 564 return ( $self->_execute_post($form), $self->_json_response_content ); 490 565 } 491 566
Note: See TracChangeset
for help on using the changeset viewer.