Skip to content

Regen title - #66

Open
arwillame wants to merge 3 commits into
devfrom
Regen_title
Open

arwillame wants to merge 3 commits into
devfrom
Regen_title

Conversation

@arwillame

Copy link
Copy Markdown
Collaborator

No description provided.

$asset_metadata = metadata2assoc_array($album_path .'/'.$asset. "/_metadata.xml");
$t++;
$t = 0;
while($asset_metadata['status'] != 'processed' || $t > 10){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boucle infinie quand $t atteint plus de 10 ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectivement...

while($asset_metadata['status'] != 'processed' || $t > 10){
sleep(2);
$asset_metadata = metadata2assoc_array($album_path .'/'.$asset. "/_metadata.xml");
$t++;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finalement comment c'est géré dans le cas normal ces dates hardcodées ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants