[clean] manage errors

This commit is contained in:
jscampucci 2024-07-09 13:12:04 +02:00
parent 2dcaf0fa1f
commit 6dd76e0a82
2 changed files with 13 additions and 4 deletions

View File

@ -119,14 +119,22 @@ class DLServices {
await shell.run(''' await shell.run('''
$ytDlpPath $command $ytDlpPath $command
''').then((result) { ''').then((result) {
debugPrint('Analyse error: $result'); result.map((e) {
debugPrint('Analyse result: $e');
FileLogger().d('Analyse result: ${result.toString()}'); FileLogger().d('Analyse result: ${e.toString()}');
FileLogger().d('stdout: ${e.stdout}');
FileLogger().d('stderr: ${e.stderr}');
});
}).catchError(( }).catchError((
error, error,
stackTrace, stackTrace,
) { ) {
FileLogger().e('Analyse error: $error'); error.map((e) {
debugPrint('Analyse result: $e');
FileLogger().d('Analyse result: ${e.toString()}');
FileLogger().d('stdout: ${e.stdout}');
FileLogger().d('stderr: ${e.stderr}');
});
}); });
return shellLinesController.stream; return shellLinesController.stream;

View File

@ -112,6 +112,7 @@ class VideosCubit extends Cubit<VideosState> {
} }
Future moveVideos() async { Future moveVideos() async {
debugPrint('Moving videos to download folder');
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
Directory defaultDownloadDirectory = await getDownloadDirectory(); Directory defaultDownloadDirectory = await getDownloadDirectory();
prefs.get('downloadFolder') ?? prefs.get('downloadFolder') ??