[clean] manage errors

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

View File

@ -119,14 +119,22 @@ class DLServices {
await shell.run('''
$ytDlpPath $command
''').then((result) {
debugPrint('Analyse error: $result');
FileLogger().d('Analyse result: ${result.toString()}');
result.map((e) {
debugPrint('Analyse result: $e');
FileLogger().d('Analyse result: ${e.toString()}');
FileLogger().d('stdout: ${e.stdout}');
FileLogger().d('stderr: ${e.stderr}');
});
}).catchError((
error,
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;

View File

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