Regen title - #66
Regen title#66arwillame wants to merge 3 commits into
Conversation
| $asset_metadata = metadata2assoc_array($album_path .'/'.$asset. "/_metadata.xml"); | ||
| $t++; | ||
| $t = 0; | ||
| while($asset_metadata['status'] != 'processed' || $t > 10){ |
There was a problem hiding this comment.
Boucle infinie quand $t atteint plus de 10 ?
There was a problem hiding this comment.
Quelle est l'intention ici ? Process que si on est pas en processing, mais si ça fait plus de 10 secondes tant pis on avance c'est ça ?
There was a problem hiding this comment.
Le soucis c'est qu'en cas de regen automatique, au moment de la copie d'un asset, le copy se fait en background, donc je ne sais pas quand il se fini.
Du coup si jamais il est en "processing", j'attend qu'il ai fini pour passer à la regen.
Mais pour pas attendre à l'infini si il y a un bug ou quoi, j'ai fixé le temps à une vingtaine de seconde.
J'ai mis du temps à retrouver la logique parce qu'effectivement c'est pas très jolis...
There was a problem hiding this comment.
Ok pour l'intention, mais écrit comme ça si $t atteint 10, ça se transforme en while(true) tout ça :p C'est while($asset_metadata['status'] != 'processed' && $t < 10) { que tu veux ici je crois ?
| while($asset_metadata['status'] != 'processed' || $t > 10){ | ||
| sleep(2); | ||
| $asset_metadata = metadata2assoc_array($album_path .'/'.$asset. "/_metadata.xml"); | ||
| $t++; |
There was a problem hiding this comment.
t est incrémenté de 1 toutes les 2 secondes. J'imagine que l'intention c'était que t est un temps en seconde ?
| // file_put_contents($log_path,'cmd1 : '.$cmd1. PHP_EOL .'cmd2 : '.$cmd2. PHP_EOL .'cmd3 : '.$cmd3. PHP_EOL .'cmd4 : '.$cmd4. PHP_EOL .'cmd5 : '.$cmd5. PHP_EOL .'cmd6 : '.$cmd6. PHP_EOL .'output : '.$cmdoutput. PHP_EOL .'returnval : '.$returncode. PHP_EOL .'return : '.$return,FILE_APPEND); | ||
| // file_put_contents($log_path,'return : '.$assoc_metadata['name'],FILE_APPEND); | ||
| // file_put_contents($log_path,'return : '.$ezrenderer['name'],FILE_APPEND); | ||
| exec($cmd1 , $cmdoutput1, $returncode1 ); |
There was a problem hiding this comment.
Une ligne de logger sur ces lignes ci pour indiquer les erreurs serait vraiment utile.
Si ça fail dans ces 3 lignes ci on a aucun moyen de savoir ce qui se passe.
| if (isset($title_assoc['add_title']) && $title_assoc['add_title'] != 'false' && $title_assoc['add_title'] != ''){ | ||
| if (isset($title_assoc['add_title']) && $title_assoc['add_title'] != 'false' && $title_assoc['add_title'] != '' && isset($title_assoc['intro_time']) && $title_assoc['intro_time'] != '' && isset($title_assoc['title_time']) && $title_assoc['title_time'] != '' && isset($title_assoc['intro']) && $title_assoc['intro'] != ''){ | ||
| print "\n------------------------ Title exists------------------------\n"; | ||
| $months = array("janvier", "février", "mars", "avril", "mai", "juin", |
There was a problem hiding this comment.
Finalement comment c'est géré dans le cas normal ces dates hardcodées ?
No description provided.