mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: check for custom path in setting engine select dropdown
This commit is contained in:
parent
fc9121b488
commit
b58dec7d1f
@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
@ -17,6 +19,7 @@ import 'package:spotube/modules/settings/youtube_engine_not_installed_dialog.dar
|
||||
import 'package:spotube/provider/audio_player/sources/invidious_instances_provider.dart';
|
||||
import 'package:spotube/provider/audio_player/sources/piped_instances_provider.dart';
|
||||
import 'package:spotube/provider/user_preferences/user_preferences_provider.dart';
|
||||
import 'package:spotube/services/kv_store/kv_store.dart';
|
||||
|
||||
import 'package:spotube/services/sourced_track/enums.dart';
|
||||
import 'package:spotube/services/youtube_engine/yt_dlp_engine.dart';
|
||||
@ -211,8 +214,11 @@ class SettingsPlaybackSection extends HookConsumerWidget {
|
||||
.toList(),
|
||||
onChanged: (value) async {
|
||||
if (value == null) return;
|
||||
if (value == YoutubeClientEngine.ytDlp &&
|
||||
!await YtDlpEngine.isInstalled() &&
|
||||
if (value == YoutubeClientEngine.ytDlp) {
|
||||
final customPath = KVStoreService.getYoutubeEnginePath(value);
|
||||
if (!await YtDlpEngine.isInstalled() &&
|
||||
(customPath == null ||
|
||||
!await File(customPath).exists()) &&
|
||||
context.mounted) {
|
||||
final hasInstalled = await showDialog<bool>(
|
||||
context: context,
|
||||
@ -221,6 +227,7 @@ class SettingsPlaybackSection extends HookConsumerWidget {
|
||||
);
|
||||
if (hasInstalled != true) return;
|
||||
}
|
||||
}
|
||||
preferencesNotifier.setYoutubeClientEngine(value);
|
||||
},
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user