Skip to content

Commit 60fa6d8

Browse files
committed
Apply patch and a few extras to add a 'no progress' option for nuvexport that disables the encode progress updates, to avoid filling up cron logs with unimportant data. Closes #3839
1 parent 537224a commit 60fa6d8

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

nuvexport/export/ffmpeg.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,11 @@ package export::ffmpeg;
394394
else {
395395
$pct = '~';
396396
}
397-
print "\rprocessed: $frames of $episode->{'total_frames'} frames at $fps fps ($pct\%, eta: ",
398-
$self->build_eta($frames, $episode->{'total_frames'}, $fps),
399-
') ';
397+
unless (arg('noprogress')) {
398+
print "\rprocessed: $frames of $episode->{'total_frames'} frames at $fps fps ($pct\%, eta: ",
399+
$self->build_eta($frames, $episode->{'total_frames'}, $fps),
400+
') ';
401+
}
400402

401403
# Read from the ffmpeg handle
402404
while (has_data($ffmpeg_h) and $l = <$ffmpeg_h>) {

nuvexport/export/mencoder.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ package export::mencoder;
181181
else {
182182
$pct = "0.00";
183183
}
184-
print "\rprocessed: $frames of $total_frames frames ($pct\%), $fps fps ";
184+
unless (arg('noprogress')) {
185+
print "\rprocessed: $frames of $total_frames frames ($pct\%), $fps fps ";
186+
}
185187
# Read from the mencoder handle
186188
while (has_data($mencoder_h) and $l = <$mencoder_h>) {
187189
if ($l =~ /^Pos:.*?(\d+)f.*?\(.*?(\d+(?:\.\d+)?)fps/) {

nuvexport/export/transcode.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,11 @@ package export::transcode;
348348
else {
349349
$pct = '~';
350350
}
351-
print "\rprocessed: $frames of $episode->{'total_frames'} frames at $fps fps ($pct\%, eta: ",
352-
$self->build_eta($frames, $episode->{'total_frames'}, $fps),
353-
') ';
351+
unless (arg('noprogress')) {
352+
print "\rprocessed: $frames of $episode->{'total_frames'} frames at $fps fps ($pct\%, eta: ",
353+
$self->build_eta($frames, $episode->{'total_frames'}, $fps),
354+
') ';
355+
}
354356
# Read from the transcode handle
355357
while (has_data($trans_h) and $l = <$trans_h>) {
356358
if ($l =~ /encoding\s+frames\s+\[(\d+)-(\d+)\],\s*([\d\.]+)\s*fps,\s+EMT:\s*([\d:]+),/) {

nuvexport/mythtv/recordings.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ package mythtv::recordings;
5959
foreach $file (@{$rows{'rows'}}) {
6060
$count++;
6161
# Print the progress indicator
62-
print "\r", sprintf('%.0f', 100 * ($num_shows / @{$rows{'rows'}})), '% ';
62+
print "\r", sprintf('%.0f', 100 * ($num_shows / @{$rows{'rows'}})), '% ' unless (arg('noprogress'));
6363
# Load into an object
6464
$file = $Myth->new_recording(@$file);
6565
# Skip shows without cutlists?

nuvexport/nuv_export/cli.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ package nuv_export::cli;
154154
add_arg('save_info', 'Save text file with program details.');
155155
add_arg('only_save_info', 'ONLY save program details; do not encode.');
156156

157+
add_arg('noprogress', "Don't show export progress status messages.");
158+
157159
# Load the commandline options
158160
add_arg('help:s', 'Show nuvexport help');
159161
add_arg('debug', 'Enable debug mode');

nuvexport/nuvexportrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@
186186
# show_deleted = yes
187187
# show_livetv = yes
188188

189+
#
190+
# Uncomment this setting to disable the encode's progress display. You
191+
# should really only use this on the commandline for cron/user jobs where
192+
# you don't want the progress updates to fill up a log or email.
193+
#
194+
# noprogress = yes
195+
189196
</nuvexport>
190197

191198
#

0 commit comments

Comments
 (0)