@@ -96,6 +96,7 @@ fn main() {
96
96
}
97
97
98
98
let paths = Arc :: new ( Mutex :: new ( paths) ) ;
99
+ let failed_paths: Arc < Mutex < Vec < String > > > = Arc :: new ( Mutex :: new ( vec ! [ ] ) ) ;
99
100
let progress = Arc :: new ( Progress :: new ( paths. lock ( ) . unwrap ( ) . len ( ) ) ) ;
100
101
let logger = Arc :: new ( Logger :: new ( Arc :: clone ( & progress) ) ) ;
101
102
let mut thread_handles = vec ! [ ] ;
@@ -104,6 +105,7 @@ fn main() {
104
105
105
106
for thread in 0 ..cmd_args. thread_count {
106
107
let paths = Arc :: clone ( & paths) ;
108
+ let failed_paths = Arc :: clone ( & failed_paths) ;
107
109
let progress = Arc :: clone ( & progress) ;
108
110
let logger = Arc :: clone ( & logger) ;
109
111
let verbose = cmd_args. verbose ;
@@ -231,6 +233,8 @@ fn main() {
231
233
thread,
232
234
verbose,
233
235
) ;
236
+
237
+ failed_paths. lock ( ) . unwrap ( ) . push ( path. display ( ) . to_string ( ) ) ;
234
238
}
235
239
} else {
236
240
eprintln ! ( "[THREAD {thread}] -- There was an error running ffmpeg. Please check if it's correctly installed and working as intended." ) ;
@@ -258,4 +262,14 @@ fn main() {
258
262
logger. get_log_path( )
259
263
) ;
260
264
println ! ( "{final_output}" ) ;
265
+
266
+ let failed_paths = failed_paths. lock ( ) . unwrap ( ) ;
267
+
268
+ logger. append_failed_paths_to_log ( & failed_paths) ;
269
+ if cmd_args. verbose && failed_paths. len ( ) > 0 {
270
+ println ! ( "\n The following files were not processed due to the errors above:" ) ;
271
+ for path in failed_paths. iter ( ) {
272
+ println ! ( "{path}" ) ;
273
+ }
274
+ }
261
275
}
0 commit comments