fix: default to youtube API by default

This commit is contained in:
Kingkor Roy Tirtho 2023-08-18 13:30:12 +06:00
parent f90e9bee31
commit 5a8a1e41e9
2 changed files with 8 additions and 8 deletions

View File

@ -512,10 +512,10 @@ abstract class LanguageLocals {
// name: "Persian", // name: "Persian",
// nativeName: "فارسی", // nativeName: "فارسی",
// ), // ),
// "pl": const ISOLanguageName( "pl": const ISOLanguageName(
// name: "Polish", name: "Polish",
// nativeName: "polski", nativeName: "polski",
// ), ),
// "ps": const ISOLanguageName( // "ps": const ISOLanguageName(
// name: "Pashto, Pushto", // name: "Pashto, Pushto",
// nativeName: "پښتو", // nativeName: "پښتو",

View File

@ -82,9 +82,9 @@ class UserPreferences extends PersistedChangeNotifier {
this.showSystemTrayIcon = true, this.showSystemTrayIcon = true,
this.locale = const Locale("system", "system"), this.locale = const Locale("system", "system"),
this.pipedInstance = "https://pipedapi.kavin.rocks", this.pipedInstance = "https://pipedapi.kavin.rocks",
this.searchMode = SearchMode.youtubeMusic, this.searchMode = SearchMode.youtube,
this.skipNonMusic = true, this.skipNonMusic = true,
this.youtubeApiType = YoutubeApiType.piped, this.youtubeApiType = YoutubeApiType.youtube,
}) : super() { }) : super() {
if (downloadLocation.isEmpty && !kIsWeb) { if (downloadLocation.isEmpty && !kIsWeb) {
_getDefaultDownloadDirectory().then( _getDefaultDownloadDirectory().then(
@ -248,14 +248,14 @@ class UserPreferences extends PersistedChangeNotifier {
searchMode = SearchMode.values.firstWhere( searchMode = SearchMode.values.firstWhere(
(mode) => mode.name == map["searchMode"], (mode) => mode.name == map["searchMode"],
orElse: () => SearchMode.youtubeMusic, orElse: () => SearchMode.youtube,
); );
skipNonMusic = map["skipNonMusic"] ?? skipNonMusic; skipNonMusic = map["skipNonMusic"] ?? skipNonMusic;
youtubeApiType = YoutubeApiType.values.firstWhere( youtubeApiType = YoutubeApiType.values.firstWhere(
(type) => type.name == map["youtubeApiType"], (type) => type.name == map["youtubeApiType"],
orElse: () => YoutubeApiType.piped, orElse: () => YoutubeApiType.youtube,
); );
} }