Fix problems with missing time values in display code
This commit is contained in:
parent
83950ff01b
commit
4198b66fc0
@ -73,7 +73,8 @@ sub _build_recipe {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
my $time = ($recipe -> {"preptime"} + $recipe -> {"cooktime"}) * 60;
|
my $time = (($recipe -> {"preptime"} // 0) +
|
||||||
|
($recipe -> {"cooktime"} // 0) ) * 60;
|
||||||
|
|
||||||
return $self -> {"template"} -> load_template("list/recipe.tem",
|
return $self -> {"template"} -> load_template("list/recipe.tem",
|
||||||
{ "%(id)s" => $recipe -> {"id"},
|
{ "%(id)s" => $recipe -> {"id"},
|
||||||
|
@ -71,7 +71,8 @@ sub _build_recipe {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
my $time = ($recipe -> {"preptime"} + $recipe -> {"cooktime"}) * 60;
|
my $time = (($recipe -> {"preptime"} // 0) +
|
||||||
|
($recipe -> {"cooktime"} // 0) ) * 60;
|
||||||
|
|
||||||
return $self -> {"template"} -> load_template("search/recipe.tem",
|
return $self -> {"template"} -> load_template("search/recipe.tem",
|
||||||
{ "%(id)s" => $recipe -> {"id"},
|
{ "%(id)s" => $recipe -> {"id"},
|
||||||
|
@ -159,7 +159,7 @@ sub _generate_view {
|
|||||||
my $cooktime = $recipe -> {"cooktime"} ? $self -> {"template"} -> humanise_seconds($recipe -> {"cooktime"} * 60)
|
my $cooktime = $recipe -> {"cooktime"} ? $self -> {"template"} -> humanise_seconds($recipe -> {"cooktime"} * 60)
|
||||||
: "{L_VIEW_NOTSET}";
|
: "{L_VIEW_NOTSET}";
|
||||||
|
|
||||||
my $totaltime = $recipe -> {"preptime"} + $recipe -> {"cooktime"};
|
my $totaltime = ($recipe -> {"preptime"} // 0) + ($recipe -> {"cooktime"} // 0);
|
||||||
my $timereq = $totaltime ? $self -> {"template"} -> humanise_seconds($totaltime * 60)
|
my $timereq = $totaltime ? $self -> {"template"} -> humanise_seconds($totaltime * 60)
|
||||||
: "{L_VIEW_NOTSET}";
|
: "{L_VIEW_NOTSET}";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user