Skip to content

Commit

Permalink
init: improved printout messages
Browse files Browse the repository at this point in the history
The current printout messages are quite incomplete. Hence, let's
ensure the output are in good faith.

This patch improves printout messages in init/ directory.

Signed-off-by: (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
  • Loading branch information
hollowaykeanho committed Apr 30, 2023
1 parent 5b82b17 commit 9a478dd
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions init/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,24 +325,30 @@ _exec_upscale_program() {
_exec_program() {
_print_status info """
Upscale Model : $model
Upscale Scale : $scale
Model Max Scale : $model_max_scale (0 = no limits)
Upscale Format : $format
Input File : $input
Is Video Input : $video_mode (0=No ; 1=Yes)
Input Directory : $subject_dir
Input Filename : $subject_name
Input Extension : $subject_ext
Output Suffix : $sujbect_suffix
Upscale Model : $model
Upscale Scale : $scale
Model Max Scale : $model_max_scale (0=No Limit)
Upscale Format : $format
Input File : $input
Is Video Input : $video_mode (0=No ; 1=Yes)
Output Directory : $subject_dir
Output Filename : $subject_name
Output Suffix : $subject_suffix
Output Extension : $subject_ext
"""


if [ $video_mode -eq 0 ]; then
output="${subject_dir}/${subject_name}-${subject_suffix}.${format}"
_exec_upscale_program "$input" "$output"

output=$?
if [ $output -eq 0 ]; then
_print_status success "\n"
fi
return $?
fi

Expand Down Expand Up @@ -427,13 +433,15 @@ Audio Exported : ${audio_exported} (0 = not yet; 1 = done)
"$img" \
&> /dev/null
if [ $? -ne 0 ]; then
_print_status error
exit 1
fi

# upscale the frame
output="${workspace}/frames/0${current_frame}.png"
_exec_upscale_program "$img" "$output"
if [ $? -ne 0 ]; then
_print_status error
exit 1
fi

Expand All @@ -459,6 +467,10 @@ video_codec="${video_codec}"
audio_codec="${audio_codec}"
audio_exported="${audio_exported}"
""" > "$control"
if [ $? -ne 0 ]; then
_print_status error
exit 1
fi
_print_status success "frame ${current_frame}/${total_frames} upscaled.\n\n"

# increase frame count
Expand All @@ -475,7 +487,12 @@ audio_exported="${audio_exported}"
-c:a copy \
-shortest \
"$output"
return 0

output=$?
if [ $output -eq 0 ]; then
_print_status success "\n"
fi
return $?
}

main() {
Expand Down

0 comments on commit 9a478dd

Please sign in to comment.