diff --git a/assets/spotube-logo-foreground.jpg b/assets/spotube-logo-foreground.jpg
deleted file mode 100644
index 0af774c9..00000000
Binary files a/assets/spotube-logo-foreground.jpg and /dev/null differ
diff --git a/assets/spotube-logo-foreground.png b/assets/spotube-logo-foreground.png
new file mode 100644
index 00000000..c41baabf
Binary files /dev/null and b/assets/spotube-logo-foreground.png differ
diff --git a/assets/spotube-logo-item.png b/assets/spotube-logo-item.png
new file mode 100644
index 00000000..476dda29
Binary files /dev/null and b/assets/spotube-logo-item.png differ
diff --git a/assets/spotube-logo-macos.png b/assets/spotube-logo-macos.png
index b14a7691..2694b530 100644
Binary files a/assets/spotube-logo-macos.png and b/assets/spotube-logo-macos.png differ
diff --git a/assets/spotube-logo.bmp b/assets/spotube-logo.bmp
deleted file mode 100644
index c3503e85..00000000
Binary files a/assets/spotube-logo.bmp and /dev/null differ
diff --git a/assets/spotube-logo.ico b/assets/spotube-logo.ico
deleted file mode 100644
index 84906308..00000000
Binary files a/assets/spotube-logo.ico and /dev/null differ
diff --git a/assets/spotube-logo.png b/assets/spotube-logo.png
index b24a8c23..adcbaa5e 100644
Binary files a/assets/spotube-logo.png and b/assets/spotube-logo.png differ
diff --git a/assets/spotube-logo.svg b/assets/spotube-logo.svg
deleted file mode 100644
index 5cd88f8e..00000000
--- a/assets/spotube-logo.svg
+++ /dev/null
@@ -1,349 +0,0 @@
-
-
diff --git a/assets/spotube-logo_android12.png b/assets/spotube-logo_android12.png
index f04e25b0..4af89de4 100644
Binary files a/assets/spotube-logo_android12.png and b/assets/spotube-logo_android12.png differ
diff --git a/assets/spotube-nightly-item.png b/assets/spotube-nightly-item.png
new file mode 100644
index 00000000..61ef1c5d
Binary files /dev/null and b/assets/spotube-nightly-item.png differ
diff --git a/assets/spotube-nightly-logo-foreground.jpg b/assets/spotube-nightly-logo-foreground.jpg
deleted file mode 100644
index a0c849b6..00000000
Binary files a/assets/spotube-nightly-logo-foreground.jpg and /dev/null differ
diff --git a/assets/spotube-nightly-logo-foreground.png b/assets/spotube-nightly-logo-foreground.png
new file mode 100644
index 00000000..2aca0632
Binary files /dev/null and b/assets/spotube-nightly-logo-foreground.png differ
diff --git a/assets/spotube-nightly-logo-foreground.svg b/assets/spotube-nightly-logo-foreground.svg
new file mode 100644
index 00000000..de2bf370
--- /dev/null
+++ b/assets/spotube-nightly-logo-foreground.svg
@@ -0,0 +1,190 @@
+
+
+
diff --git a/assets/spotube-nightly-logo.png b/assets/spotube-nightly-logo.png
deleted file mode 100644
index ea7a8b20..00000000
Binary files a/assets/spotube-nightly-logo.png and /dev/null differ
diff --git a/assets/spotube-nightly-logo.svg b/assets/spotube-nightly-logo.svg
deleted file mode 100644
index 7601108e..00000000
--- a/assets/spotube-nightly-logo.svg
+++ /dev/null
@@ -1,359 +0,0 @@
-
-
diff --git a/assets/spotube-nightly-logo_android12.png b/assets/spotube-nightly-logo_android12.png
deleted file mode 100644
index 1a5bf4f1..00000000
Binary files a/assets/spotube-nightly-logo_android12.png and /dev/null differ
diff --git a/assets/spotube-tall-capsule.png b/assets/spotube-tall-capsule.png
deleted file mode 100644
index 43fb8229..00000000
Binary files a/assets/spotube-tall-capsule.png and /dev/null differ
diff --git a/assets/spotube-wide-capsule-large.png b/assets/spotube-wide-capsule-large.png
deleted file mode 100644
index 09a93d83..00000000
Binary files a/assets/spotube-wide-capsule-large.png and /dev/null differ
diff --git a/assets/spotube-wide-capsule-small.png b/assets/spotube-wide-capsule-small.png
deleted file mode 100644
index 17566550..00000000
Binary files a/assets/spotube-wide-capsule-small.png and /dev/null differ
diff --git a/assets/spotube_banner.png b/assets/spotube_banner.png
deleted file mode 100644
index b2be4539..00000000
Binary files a/assets/spotube_banner.png and /dev/null differ
diff --git a/drift_schemas/app_db/drift_schema_v5.json b/drift_schemas/app_db/drift_schema_v5.json
new file mode 100644
index 00000000..eefe0205
--- /dev/null
+++ b/drift_schemas/app_db/drift_schema_v5.json
@@ -0,0 +1 @@
+{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"authentication_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"cookie","getter_name":"cookie","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"EncryptedTextConverter()","dart_type_name":"DecryptedText"}},{"name":"access_token","getter_name":"accessToken","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"EncryptedTextConverter()","dart_type_name":"DecryptedText"}},{"name":"expiration","getter_name":"expiration","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":1,"references":[],"type":"table","data":{"name":"blacklist_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"element_type","getter_name":"elementType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(BlacklistedType.values)","dart_type_name":"BlacklistedType"}},{"name":"element_id","getter_name":"elementId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":2,"references":[],"type":"table","data":{"name":"preferences_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"audio_quality","getter_name":"audioQuality","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(SourceQualities.high.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SourceQualities.values)","dart_type_name":"SourceQualities"}},{"name":"album_color_sync","getter_name":"albumColorSync","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"album_color_sync\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"album_color_sync\" IN (0, 1))"},"default_dart":"const Constant(true)","default_client_dart":null,"dsl_features":[]},{"name":"amoled_dark_theme","getter_name":"amoledDarkTheme","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"amoled_dark_theme\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"amoled_dark_theme\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"check_update","getter_name":"checkUpdate","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"check_update\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"check_update\" IN (0, 1))"},"default_dart":"const Constant(true)","default_client_dart":null,"dsl_features":[]},{"name":"normalize_audio","getter_name":"normalizeAudio","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"normalize_audio\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"normalize_audio\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"show_system_tray_icon","getter_name":"showSystemTrayIcon","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"show_system_tray_icon\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"show_system_tray_icon\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"system_title_bar","getter_name":"systemTitleBar","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"system_title_bar\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"system_title_bar\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"skip_non_music","getter_name":"skipNonMusic","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"skip_non_music\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"skip_non_music\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"close_behavior","getter_name":"closeBehavior","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(CloseBehavior.close.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(CloseBehavior.values)","dart_type_name":"CloseBehavior"}},{"name":"accent_color_scheme","getter_name":"accentColorScheme","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant(\"Orange:0xFFf97315\")","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const SpotubeColorConverter()","dart_type_name":"SpotubeColor"}},{"name":"layout_mode","getter_name":"layoutMode","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(LayoutMode.adaptive.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(LayoutMode.values)","dart_type_name":"LayoutMode"}},{"name":"locale","getter_name":"locale","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant('{\"languageCode\":\"system\",\"countryCode\":\"system\"}')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const LocaleConverter()","dart_type_name":"Locale"}},{"name":"market","getter_name":"market","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(Market.US.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(Market.values)","dart_type_name":"Market"}},{"name":"search_mode","getter_name":"searchMode","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(SearchMode.youtube.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SearchMode.values)","dart_type_name":"SearchMode"}},{"name":"download_location","getter_name":"downloadLocation","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant(\"\")","default_client_dart":null,"dsl_features":[]},{"name":"local_library_location","getter_name":"localLibraryLocation","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant(\"\")","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const StringListConverter()","dart_type_name":"List"}},{"name":"piped_instance","getter_name":"pipedInstance","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant(\"https://pipedapi.kavin.rocks\")","default_client_dart":null,"dsl_features":[]},{"name":"invidious_instance","getter_name":"invidiousInstance","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant(\"https://inv.nadeko.net\")","default_client_dart":null,"dsl_features":[]},{"name":"theme_mode","getter_name":"themeMode","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(ThemeMode.system.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(ThemeMode.values)","dart_type_name":"ThemeMode"}},{"name":"audio_source","getter_name":"audioSource","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(AudioSource.youtube.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(AudioSource.values)","dart_type_name":"AudioSource"}},{"name":"youtube_client_engine","getter_name":"youtubeClientEngine","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(YoutubeClientEngine.youtubeExplode.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(YoutubeClientEngine.values)","dart_type_name":"YoutubeClientEngine"}},{"name":"stream_music_codec","getter_name":"streamMusicCodec","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(SourceCodecs.weba.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SourceCodecs.values)","dart_type_name":"SourceCodecs"}},{"name":"download_music_codec","getter_name":"downloadMusicCodec","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(SourceCodecs.m4a.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SourceCodecs.values)","dart_type_name":"SourceCodecs"}},{"name":"discord_presence","getter_name":"discordPresence","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"discord_presence\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"discord_presence\" IN (0, 1))"},"default_dart":"const Constant(true)","default_client_dart":null,"dsl_features":[]},{"name":"endless_playback","getter_name":"endlessPlayback","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"endless_playback\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"endless_playback\" IN (0, 1))"},"default_dart":"const Constant(true)","default_client_dart":null,"dsl_features":[]},{"name":"enable_connect","getter_name":"enableConnect","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"enable_connect\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"enable_connect\" IN (0, 1))"},"default_dart":"const Constant(false)","default_client_dart":null,"dsl_features":[]},{"name":"cache_music","getter_name":"cacheMusic","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"cache_music\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"cache_music\" IN (0, 1))"},"default_dart":"const Constant(true)","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":3,"references":[],"type":"table","data":{"name":"scrobbler_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"currentDateAndTime","default_client_dart":null,"dsl_features":[]},{"name":"username","getter_name":"username","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"password_hash","getter_name":"passwordHash","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"EncryptedTextConverter()","dart_type_name":"DecryptedText"}}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":4,"references":[],"type":"table","data":{"name":"skip_segment_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"start","getter_name":"start","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"end","getter_name":"end","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"track_id","getter_name":"trackId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"currentDateAndTime","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":5,"references":[],"type":"table","data":{"name":"source_match_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"track_id","getter_name":"trackId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"source_id","getter_name":"sourceId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"source_type","getter_name":"sourceType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"Constant(SourceType.youtube.name)","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(SourceType.values)","dart_type_name":"SourceType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"currentDateAndTime","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":6,"references":[],"type":"table","data":{"name":"audio_player_state_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"playing","getter_name":"playing","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"playing\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"playing\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"loop_mode","getter_name":"loopMode","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(PlaylistMode.values)","dart_type_name":"PlaylistMode"}},{"name":"shuffled","getter_name":"shuffled","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"shuffled\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"shuffled\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"collections","getter_name":"collections","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const StringListConverter()","dart_type_name":"List"}}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":7,"references":[6],"type":"table","data":{"name":"playlist_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"audio_player_state_id","getter_name":"audioPlayerStateId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES audio_player_state_table (id)","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES audio_player_state_table (id)"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"index","getter_name":"index","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":8,"references":[7],"type":"table","data":{"name":"playlist_media_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"playlist_id","getter_name":"playlistId","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES playlist_table (id)","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES playlist_table (id)"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"uri","getter_name":"uri","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"extras","getter_name":"extras","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const MapTypeConverter()","dart_type_name":"Map"}},{"name":"http_headers","getter_name":"httpHeaders","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const MapTypeConverter()","dart_type_name":"Map"}}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":9,"references":[],"type":"table","data":{"name":"history_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"currentDateAndTime","default_client_dart":null,"dsl_features":[]},{"name":"type","getter_name":"type","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(HistoryEntryType.values)","dart_type_name":"HistoryEntryType"}},{"name":"item_id","getter_name":"itemId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"data","getter_name":"data","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const MapTypeConverter()","dart_type_name":"Map"}}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":10,"references":[],"type":"table","data":{"name":"lyrics_table","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"int","nullable":false,"customConstraints":null,"defaultConstraints":"PRIMARY KEY AUTOINCREMENT","dialectAwareDefaultConstraints":{"sqlite":"PRIMARY KEY AUTOINCREMENT"},"default_dart":null,"default_client_dart":null,"dsl_features":["auto-increment"]},{"name":"track_id","getter_name":"trackId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"data","getter_name":"data","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"SubtitleTypeConverter()","dart_type_name":"SubtitleSimple"}}],"is_virtual":false,"without_rowid":false,"constraints":[]}},{"id":11,"references":[1],"type":"index","data":{"on":1,"name":"unique_blacklist","sql":null,"unique":true,"columns":["element_type","element_id"]}},{"id":12,"references":[5],"type":"index","data":{"on":5,"name":"uniq_track_match","sql":null,"unique":true,"columns":["track_id","source_id","source_type"]}}]}
\ No newline at end of file
diff --git a/lib/models/database/database.dart b/lib/models/database/database.dart
index 199e7147..fb19a8d6 100644
--- a/lib/models/database/database.dart
+++ b/lib/models/database/database.dart
@@ -62,7 +62,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
@override
- int get schemaVersion => 4;
+ int get schemaVersion => 5;
@override
MigrationStrategy get migration {
@@ -87,6 +87,33 @@ class AppDatabase extends _$AppDatabase {
schema.preferencesTable.youtubeClientEngine,
);
},
+ from4To5: (m, schema) async {
+ final columnName = schema.preferencesTable.accentColorScheme
+ .escapedNameFor(SqlDialect.sqlite);
+ final columnNameOld =
+ '"${schema.preferencesTable.accentColorScheme.name}_old"';
+ final tableName = schema.preferencesTable.actualTableName;
+ await customStatement(
+ "ALTER TABLE $tableName "
+ "RENAME COLUMN $columnName to $columnNameOld",
+ );
+ await customStatement(
+ "ALTER TABLE $tableName "
+ "ADD COLUMN $columnName TEXT NOT NULL DEFAULT 'Orange:0xFFf97315'",
+ );
+ await customStatement(
+ "UPDATE $tableName "
+ "SET $columnName = $columnNameOld",
+ );
+ await customStatement(
+ "ALTER TABLE $tableName "
+ "DROP COLUMN $columnNameOld",
+ );
+ await customStatement(
+ "UPDATE $tableName "
+ "SET $columnName = 'Orange:0xFFf97315' WHERE $columnName = 'Blue:0xFF2196F3'",
+ );
+ },
),
);
}
diff --git a/lib/models/database/database.g.dart b/lib/models/database/database.g.dart
index cd004d69..e0c91648 100644
--- a/lib/models/database/database.g.dart
+++ b/lib/models/database/database.g.dart
@@ -666,7 +666,7 @@ class $PreferencesTableTable extends PreferencesTable
'accent_color_scheme', aliasedName, false,
type: DriftSqlType.string,
requiredDuringInsert: false,
- defaultValue: const Constant("Blue:0xFF2196F3"))
+ defaultValue: const Constant("Orange:0xFFf97315"))
.withConverter(
$PreferencesTableTable.$converteraccentColorScheme);
static const VerificationMeta _layoutModeMeta =
diff --git a/lib/models/database/database.steps.dart b/lib/models/database/database.steps.dart
index 8e0f8e3f..086e5122 100644
--- a/lib/models/database/database.steps.dart
+++ b/lib/models/database/database.steps.dart
@@ -2,7 +2,7 @@
import 'package:drift/internal/versioned_schema.dart' as i0;
import 'package:drift/drift.dart' as i1;
import 'package:drift/drift.dart';
-import 'package:shadcn_flutter/shadcn_flutter.dart';
+import 'package:flutter/material.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/models/database/database.dart';
import 'package:spotube/services/sourced_track/enums.dart'; // ignore_for_file: type=lint,unused_import
@@ -1188,10 +1188,232 @@ i1.GeneratedColumn _column_54(String aliasedName) =>
i1.GeneratedColumn('youtube_client_engine', aliasedName, false,
type: i1.DriftSqlType.string,
defaultValue: Constant(YoutubeClientEngine.youtubeExplode.name));
+
+final class Schema5 extends i0.VersionedSchema {
+ Schema5({required super.database}) : super(version: 5);
+ @override
+ late final List entities = [
+ authenticationTable,
+ blacklistTable,
+ preferencesTable,
+ scrobblerTable,
+ skipSegmentTable,
+ sourceMatchTable,
+ audioPlayerStateTable,
+ playlistTable,
+ playlistMediaTable,
+ historyTable,
+ lyricsTable,
+ uniqueBlacklist,
+ uniqTrackMatch,
+ ];
+ late final Shape0 authenticationTable = Shape0(
+ source: i0.VersionedTable(
+ entityName: 'authentication_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_1,
+ _column_2,
+ _column_3,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape1 blacklistTable = Shape1(
+ source: i0.VersionedTable(
+ entityName: 'blacklist_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_4,
+ _column_5,
+ _column_6,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape12 preferencesTable = Shape12(
+ source: i0.VersionedTable(
+ entityName: 'preferences_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_7,
+ _column_8,
+ _column_9,
+ _column_10,
+ _column_11,
+ _column_12,
+ _column_13,
+ _column_14,
+ _column_15,
+ _column_55,
+ _column_17,
+ _column_18,
+ _column_19,
+ _column_20,
+ _column_21,
+ _column_22,
+ _column_23,
+ _column_24,
+ _column_25,
+ _column_26,
+ _column_54,
+ _column_27,
+ _column_28,
+ _column_29,
+ _column_30,
+ _column_31,
+ _column_53,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape3 scrobblerTable = Shape3(
+ source: i0.VersionedTable(
+ entityName: 'scrobbler_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_32,
+ _column_33,
+ _column_34,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape4 skipSegmentTable = Shape4(
+ source: i0.VersionedTable(
+ entityName: 'skip_segment_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_35,
+ _column_36,
+ _column_37,
+ _column_32,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape5 sourceMatchTable = Shape5(
+ source: i0.VersionedTable(
+ entityName: 'source_match_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_37,
+ _column_38,
+ _column_39,
+ _column_32,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape6 audioPlayerStateTable = Shape6(
+ source: i0.VersionedTable(
+ entityName: 'audio_player_state_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_40,
+ _column_41,
+ _column_42,
+ _column_43,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape7 playlistTable = Shape7(
+ source: i0.VersionedTable(
+ entityName: 'playlist_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_44,
+ _column_45,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape8 playlistMediaTable = Shape8(
+ source: i0.VersionedTable(
+ entityName: 'playlist_media_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_46,
+ _column_47,
+ _column_48,
+ _column_49,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape9 historyTable = Shape9(
+ source: i0.VersionedTable(
+ entityName: 'history_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_32,
+ _column_50,
+ _column_51,
+ _column_52,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ late final Shape10 lyricsTable = Shape10(
+ source: i0.VersionedTable(
+ entityName: 'lyrics_table',
+ withoutRowId: false,
+ isStrict: false,
+ tableConstraints: [],
+ columns: [
+ _column_0,
+ _column_37,
+ _column_52,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null);
+ final i1.Index uniqueBlacklist = i1.Index('unique_blacklist',
+ 'CREATE UNIQUE INDEX unique_blacklist ON blacklist_table (element_type, element_id)');
+ final i1.Index uniqTrackMatch = i1.Index('uniq_track_match',
+ 'CREATE UNIQUE INDEX uniq_track_match ON source_match_table (track_id, source_id, source_type)');
+}
+
+i1.GeneratedColumn _column_55(String aliasedName) =>
+ i1.GeneratedColumn('accent_color_scheme', aliasedName, false,
+ type: i1.DriftSqlType.string,
+ defaultValue: const Constant("Orange:0xFFf97315"));
i0.MigrationStepWithVersion migrationSteps({
required Future Function(i1.Migrator m, Schema2 schema) from1To2,
required Future Function(i1.Migrator m, Schema3 schema) from2To3,
required Future Function(i1.Migrator m, Schema4 schema) from3To4,
+ required Future Function(i1.Migrator m, Schema5 schema) from4To5,
}) {
return (currentVersion, database) async {
switch (currentVersion) {
@@ -1210,6 +1432,11 @@ i0.MigrationStepWithVersion migrationSteps({
final migrator = i1.Migrator(database, schema);
await from3To4(migrator, schema);
return 4;
+ case 4:
+ final schema = Schema5(database: database);
+ final migrator = i1.Migrator(database, schema);
+ await from4To5(migrator, schema);
+ return 5;
default:
throw ArgumentError.value('Unknown migration from $currentVersion');
}
@@ -1220,10 +1447,12 @@ i1.OnUpgrade stepByStep({
required Future Function(i1.Migrator m, Schema2 schema) from1To2,
required Future Function(i1.Migrator m, Schema3 schema) from2To3,
required Future Function(i1.Migrator m, Schema4 schema) from3To4,
+ required Future Function(i1.Migrator m, Schema5 schema) from4To5,
}) =>
i0.VersionedSchema.stepByStepHelper(
step: migrationSteps(
from1To2: from1To2,
from2To3: from2To3,
from3To4: from3To4,
+ from4To5: from4To5,
));
diff --git a/lib/models/database/tables/preferences.dart b/lib/models/database/tables/preferences.dart
index 492ac1f9..dd24bd81 100644
--- a/lib/models/database/tables/preferences.dart
+++ b/lib/models/database/tables/preferences.dart
@@ -79,7 +79,7 @@ class PreferencesTable extends Table {
TextColumn get closeBehavior => textEnum()
.withDefault(Constant(CloseBehavior.close.name))();
TextColumn get accentColorScheme => text()
- .withDefault(const Constant("Blue:0xFF2196F3"))
+ .withDefault(const Constant("Orange:0xFFf97315"))
.map(const SpotubeColorConverter())();
TextColumn get layoutMode =>
textEnum().withDefault(Constant(LayoutMode.adaptive.name))();
@@ -130,7 +130,7 @@ class PreferencesTable extends Table {
systemTitleBar: false,
skipNonMusic: false,
closeBehavior: CloseBehavior.close,
- accentColorScheme: SpotubeColor(Colors.blue.value, name: "Blue"),
+ accentColorScheme: SpotubeColor(Colors.orange.value, name: "Orange"),
layoutMode: LayoutMode.adaptive,
locale: const Locale("system", "system"),
market: Market.US,
diff --git a/lib/provider/user_preferences/user_preferences_provider.dart b/lib/provider/user_preferences/user_preferences_provider.dart
index 75234241..1422430f 100644
--- a/lib/provider/user_preferences/user_preferences_provider.dart
+++ b/lib/provider/user_preferences/user_preferences_provider.dart
@@ -90,9 +90,9 @@ class UserPreferencesNotifier extends Notifier {
Future reset() async {
final db = ref.read(databaseProvider);
- final query = db.update(db.preferencesTable)..where((t) => t.id.equals(0));
+ final query = db.update(db.preferencesTable);
- await query.replace(PreferencesTableCompanion.insert());
+ await query.replace(PreferencesTableCompanion.insert(id: const Value(0)));
}
static Future getMusicCacheDir() async {
diff --git a/test/drift/app_db/generated/schema.dart b/test/drift/app_db/generated/schema.dart
index bdaebe8f..67c7d69e 100644
--- a/test/drift/app_db/generated/schema.dart
+++ b/test/drift/app_db/generated/schema.dart
@@ -3,27 +3,30 @@
// ignore_for_file: type=lint
import 'package:drift/drift.dart';
import 'package:drift/internal/migrations.dart';
-import 'schema_v4.dart' as v4;
import 'schema_v3.dart' as v3;
-import 'schema_v2.dart' as v2;
+import 'schema_v5.dart' as v5;
import 'schema_v1.dart' as v1;
+import 'schema_v2.dart' as v2;
+import 'schema_v4.dart' as v4;
class GeneratedHelper implements SchemaInstantiationHelper {
@override
GeneratedDatabase databaseForVersion(QueryExecutor db, int version) {
switch (version) {
- case 4:
- return v4.DatabaseAtV4(db);
case 3:
return v3.DatabaseAtV3(db);
- case 2:
- return v2.DatabaseAtV2(db);
+ case 5:
+ return v5.DatabaseAtV5(db);
case 1:
return v1.DatabaseAtV1(db);
+ case 2:
+ return v2.DatabaseAtV2(db);
+ case 4:
+ return v4.DatabaseAtV4(db);
default:
throw MissingSchemaException(version, versions);
}
}
- static const versions = const [1, 2, 3, 4];
+ static const versions = const [1, 2, 3, 4, 5];
}
diff --git a/test/drift/app_db/generated/schema_v5.dart b/test/drift/app_db/generated/schema_v5.dart
new file mode 100644
index 00000000..4283aa98
--- /dev/null
+++ b/test/drift/app_db/generated/schema_v5.dart
@@ -0,0 +1,3433 @@
+// dart format width=80
+// GENERATED CODE, DO NOT EDIT BY HAND.
+// ignore_for_file: type=lint
+import 'package:drift/drift.dart';
+
+class AuthenticationTable extends Table
+ with TableInfo {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ AuthenticationTable(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn id = GeneratedColumn(
+ 'id', aliasedName, false,
+ hasAutoIncrement: true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultConstraints:
+ GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
+ late final GeneratedColumn cookie = GeneratedColumn(
+ 'cookie', aliasedName, false,
+ type: DriftSqlType.string, requiredDuringInsert: true);
+ late final GeneratedColumn accessToken = GeneratedColumn(
+ 'access_token', aliasedName, false,
+ type: DriftSqlType.string, requiredDuringInsert: true);
+ late final GeneratedColumn expiration = GeneratedColumn(
+ 'expiration', aliasedName, false,
+ type: DriftSqlType.dateTime, requiredDuringInsert: true);
+ @override
+ List get $columns => [id, cookie, accessToken, expiration];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'authentication_table';
+ @override
+ Set get $primaryKey => {id};
+ @override
+ AuthenticationTableData map(Map data,
+ {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return AuthenticationTableData(
+ id: attachedDatabase.typeMapping
+ .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
+ cookie: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}cookie'])!,
+ accessToken: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}access_token'])!,
+ expiration: attachedDatabase.typeMapping
+ .read(DriftSqlType.dateTime, data['${effectivePrefix}expiration'])!,
+ );
+ }
+
+ @override
+ AuthenticationTable createAlias(String alias) {
+ return AuthenticationTable(attachedDatabase, alias);
+ }
+}
+
+class AuthenticationTableData extends DataClass
+ implements Insertable {
+ final int id;
+ final String cookie;
+ final String accessToken;
+ final DateTime expiration;
+ const AuthenticationTableData(
+ {required this.id,
+ required this.cookie,
+ required this.accessToken,
+ required this.expiration});
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ map['id'] = Variable(id);
+ map['cookie'] = Variable(cookie);
+ map['access_token'] = Variable(accessToken);
+ map['expiration'] = Variable(expiration);
+ return map;
+ }
+
+ AuthenticationTableCompanion toCompanion(bool nullToAbsent) {
+ return AuthenticationTableCompanion(
+ id: Value(id),
+ cookie: Value(cookie),
+ accessToken: Value(accessToken),
+ expiration: Value(expiration),
+ );
+ }
+
+ factory AuthenticationTableData.fromJson(Map json,
+ {ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return AuthenticationTableData(
+ id: serializer.fromJson(json['id']),
+ cookie: serializer.fromJson(json['cookie']),
+ accessToken: serializer.fromJson(json['accessToken']),
+ expiration: serializer.fromJson(json['expiration']),
+ );
+ }
+ @override
+ Map toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return {
+ 'id': serializer.toJson(id),
+ 'cookie': serializer.toJson(cookie),
+ 'accessToken': serializer.toJson(accessToken),
+ 'expiration': serializer.toJson(expiration),
+ };
+ }
+
+ AuthenticationTableData copyWith(
+ {int? id,
+ String? cookie,
+ String? accessToken,
+ DateTime? expiration}) =>
+ AuthenticationTableData(
+ id: id ?? this.id,
+ cookie: cookie ?? this.cookie,
+ accessToken: accessToken ?? this.accessToken,
+ expiration: expiration ?? this.expiration,
+ );
+ AuthenticationTableData copyWithCompanion(AuthenticationTableCompanion data) {
+ return AuthenticationTableData(
+ id: data.id.present ? data.id.value : this.id,
+ cookie: data.cookie.present ? data.cookie.value : this.cookie,
+ accessToken:
+ data.accessToken.present ? data.accessToken.value : this.accessToken,
+ expiration:
+ data.expiration.present ? data.expiration.value : this.expiration,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AuthenticationTableData(')
+ ..write('id: $id, ')
+ ..write('cookie: $cookie, ')
+ ..write('accessToken: $accessToken, ')
+ ..write('expiration: $expiration')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(id, cookie, accessToken, expiration);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is AuthenticationTableData &&
+ other.id == this.id &&
+ other.cookie == this.cookie &&
+ other.accessToken == this.accessToken &&
+ other.expiration == this.expiration);
+}
+
+class AuthenticationTableCompanion
+ extends UpdateCompanion {
+ final Value id;
+ final Value cookie;
+ final Value accessToken;
+ final Value expiration;
+ const AuthenticationTableCompanion({
+ this.id = const Value.absent(),
+ this.cookie = const Value.absent(),
+ this.accessToken = const Value.absent(),
+ this.expiration = const Value.absent(),
+ });
+ AuthenticationTableCompanion.insert({
+ this.id = const Value.absent(),
+ required String cookie,
+ required String accessToken,
+ required DateTime expiration,
+ }) : cookie = Value(cookie),
+ accessToken = Value(accessToken),
+ expiration = Value(expiration);
+ static Insertable custom({
+ Expression? id,
+ Expression? cookie,
+ Expression? accessToken,
+ Expression? expiration,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (cookie != null) 'cookie': cookie,
+ if (accessToken != null) 'access_token': accessToken,
+ if (expiration != null) 'expiration': expiration,
+ });
+ }
+
+ AuthenticationTableCompanion copyWith(
+ {Value? id,
+ Value? cookie,
+ Value? accessToken,
+ Value? expiration}) {
+ return AuthenticationTableCompanion(
+ id: id ?? this.id,
+ cookie: cookie ?? this.cookie,
+ accessToken: accessToken ?? this.accessToken,
+ expiration: expiration ?? this.expiration,
+ );
+ }
+
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ if (id.present) {
+ map['id'] = Variable(id.value);
+ }
+ if (cookie.present) {
+ map['cookie'] = Variable(cookie.value);
+ }
+ if (accessToken.present) {
+ map['access_token'] = Variable(accessToken.value);
+ }
+ if (expiration.present) {
+ map['expiration'] = Variable(expiration.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AuthenticationTableCompanion(')
+ ..write('id: $id, ')
+ ..write('cookie: $cookie, ')
+ ..write('accessToken: $accessToken, ')
+ ..write('expiration: $expiration')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class BlacklistTable extends Table
+ with TableInfo {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ BlacklistTable(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn id = GeneratedColumn(
+ 'id', aliasedName, false,
+ hasAutoIncrement: true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultConstraints:
+ GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
+ late final GeneratedColumn name = GeneratedColumn(
+ 'name', aliasedName, false,
+ type: DriftSqlType.string, requiredDuringInsert: true);
+ late final GeneratedColumn elementType = GeneratedColumn(
+ 'element_type', aliasedName, false,
+ type: DriftSqlType.string, requiredDuringInsert: true);
+ late final GeneratedColumn elementId = GeneratedColumn(
+ 'element_id', aliasedName, false,
+ type: DriftSqlType.string, requiredDuringInsert: true);
+ @override
+ List get $columns => [id, name, elementType, elementId];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'blacklist_table';
+ @override
+ Set get $primaryKey => {id};
+ @override
+ BlacklistTableData map(Map data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return BlacklistTableData(
+ id: attachedDatabase.typeMapping
+ .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
+ name: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}name'])!,
+ elementType: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}element_type'])!,
+ elementId: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}element_id'])!,
+ );
+ }
+
+ @override
+ BlacklistTable createAlias(String alias) {
+ return BlacklistTable(attachedDatabase, alias);
+ }
+}
+
+class BlacklistTableData extends DataClass
+ implements Insertable {
+ final int id;
+ final String name;
+ final String elementType;
+ final String elementId;
+ const BlacklistTableData(
+ {required this.id,
+ required this.name,
+ required this.elementType,
+ required this.elementId});
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ map['id'] = Variable(id);
+ map['name'] = Variable(name);
+ map['element_type'] = Variable(elementType);
+ map['element_id'] = Variable(elementId);
+ return map;
+ }
+
+ BlacklistTableCompanion toCompanion(bool nullToAbsent) {
+ return BlacklistTableCompanion(
+ id: Value(id),
+ name: Value(name),
+ elementType: Value(elementType),
+ elementId: Value(elementId),
+ );
+ }
+
+ factory BlacklistTableData.fromJson(Map json,
+ {ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return BlacklistTableData(
+ id: serializer.fromJson(json['id']),
+ name: serializer.fromJson(json['name']),
+ elementType: serializer.fromJson(json['elementType']),
+ elementId: serializer.fromJson(json['elementId']),
+ );
+ }
+ @override
+ Map toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return {
+ 'id': serializer.toJson(id),
+ 'name': serializer.toJson(name),
+ 'elementType': serializer.toJson(elementType),
+ 'elementId': serializer.toJson(elementId),
+ };
+ }
+
+ BlacklistTableData copyWith(
+ {int? id, String? name, String? elementType, String? elementId}) =>
+ BlacklistTableData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ elementType: elementType ?? this.elementType,
+ elementId: elementId ?? this.elementId,
+ );
+ BlacklistTableData copyWithCompanion(BlacklistTableCompanion data) {
+ return BlacklistTableData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ elementType:
+ data.elementType.present ? data.elementType.value : this.elementType,
+ elementId: data.elementId.present ? data.elementId.value : this.elementId,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('BlacklistTableData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('elementType: $elementType, ')
+ ..write('elementId: $elementId')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(id, name, elementType, elementId);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is BlacklistTableData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.elementType == this.elementType &&
+ other.elementId == this.elementId);
+}
+
+class BlacklistTableCompanion extends UpdateCompanion {
+ final Value id;
+ final Value name;
+ final Value elementType;
+ final Value elementId;
+ const BlacklistTableCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.elementType = const Value.absent(),
+ this.elementId = const Value.absent(),
+ });
+ BlacklistTableCompanion.insert({
+ this.id = const Value.absent(),
+ required String name,
+ required String elementType,
+ required String elementId,
+ }) : name = Value(name),
+ elementType = Value(elementType),
+ elementId = Value(elementId);
+ static Insertable custom({
+ Expression? id,
+ Expression? name,
+ Expression? elementType,
+ Expression? elementId,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (elementType != null) 'element_type': elementType,
+ if (elementId != null) 'element_id': elementId,
+ });
+ }
+
+ BlacklistTableCompanion copyWith(
+ {Value? id,
+ Value? name,
+ Value? elementType,
+ Value? elementId}) {
+ return BlacklistTableCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ elementType: elementType ?? this.elementType,
+ elementId: elementId ?? this.elementId,
+ );
+ }
+
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ if (id.present) {
+ map['id'] = Variable(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable(name.value);
+ }
+ if (elementType.present) {
+ map['element_type'] = Variable(elementType.value);
+ }
+ if (elementId.present) {
+ map['element_id'] = Variable(elementId.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('BlacklistTableCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('elementType: $elementType, ')
+ ..write('elementId: $elementId')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class PreferencesTable extends Table
+ with TableInfo {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ PreferencesTable(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn id = GeneratedColumn(
+ 'id', aliasedName, false,
+ hasAutoIncrement: true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultConstraints:
+ GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'));
+ late final GeneratedColumn audioQuality = GeneratedColumn(
+ 'audio_quality', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(SourceQualities.high.name));
+ late final GeneratedColumn albumColorSync = GeneratedColumn(
+ 'album_color_sync', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("album_color_sync" IN (0, 1))'),
+ defaultValue: const Constant(true));
+ late final GeneratedColumn amoledDarkTheme = GeneratedColumn(
+ 'amoled_dark_theme', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("amoled_dark_theme" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn checkUpdate = GeneratedColumn(
+ 'check_update', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("check_update" IN (0, 1))'),
+ defaultValue: const Constant(true));
+ late final GeneratedColumn normalizeAudio = GeneratedColumn(
+ 'normalize_audio', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("normalize_audio" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn showSystemTrayIcon = GeneratedColumn(
+ 'show_system_tray_icon', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("show_system_tray_icon" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn systemTitleBar = GeneratedColumn(
+ 'system_title_bar', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("system_title_bar" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn skipNonMusic = GeneratedColumn(
+ 'skip_non_music', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("skip_non_music" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn closeBehavior = GeneratedColumn(
+ 'close_behavior', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(CloseBehavior.close.name));
+ late final GeneratedColumn accentColorScheme =
+ GeneratedColumn('accent_color_scheme', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const Constant("Orange:0xFFf97315"));
+ late final GeneratedColumn layoutMode = GeneratedColumn(
+ 'layout_mode', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(LayoutMode.adaptive.name));
+ late final GeneratedColumn locale = GeneratedColumn(
+ 'locale', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue:
+ const Constant('{"languageCode":"system","countryCode":"system"}'));
+ late final GeneratedColumn market = GeneratedColumn(
+ 'market', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(Market.US.name));
+ late final GeneratedColumn searchMode = GeneratedColumn(
+ 'search_mode', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(SearchMode.youtube.name));
+ late final GeneratedColumn downloadLocation = GeneratedColumn(
+ 'download_location', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const Constant(""));
+ late final GeneratedColumn localLibraryLocation =
+ GeneratedColumn('local_library_location', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const Constant(""));
+ late final GeneratedColumn pipedInstance = GeneratedColumn(
+ 'piped_instance', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const Constant("https://pipedapi.kavin.rocks"));
+ late final GeneratedColumn invidiousInstance =
+ GeneratedColumn('invidious_instance', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const Constant("https://inv.nadeko.net"));
+ late final GeneratedColumn themeMode = GeneratedColumn(
+ 'theme_mode', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(ThemeMode.system.name));
+ late final GeneratedColumn audioSource = GeneratedColumn(
+ 'audio_source', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(AudioSource.youtube.name));
+ late final GeneratedColumn youtubeClientEngine =
+ GeneratedColumn('youtube_client_engine', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(YoutubeClientEngine.youtubeExplode.name));
+ late final GeneratedColumn streamMusicCodec = GeneratedColumn(
+ 'stream_music_codec', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(SourceCodecs.weba.name));
+ late final GeneratedColumn downloadMusicCodec =
+ GeneratedColumn('download_music_codec', aliasedName, false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: Constant(SourceCodecs.m4a.name));
+ late final GeneratedColumn discordPresence = GeneratedColumn(
+ 'discord_presence', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("discord_presence" IN (0, 1))'),
+ defaultValue: const Constant(true));
+ late final GeneratedColumn endlessPlayback = GeneratedColumn(
+ 'endless_playback', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("endless_playback" IN (0, 1))'),
+ defaultValue: const Constant(true));
+ late final GeneratedColumn enableConnect = GeneratedColumn(
+ 'enable_connect', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("enable_connect" IN (0, 1))'),
+ defaultValue: const Constant(false));
+ late final GeneratedColumn cacheMusic = GeneratedColumn(
+ 'cache_music', aliasedName, false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints:
+ GeneratedColumn.constraintIsAlways('CHECK ("cache_music" IN (0, 1))'),
+ defaultValue: const Constant(true));
+ @override
+ List get $columns => [
+ id,
+ audioQuality,
+ albumColorSync,
+ amoledDarkTheme,
+ checkUpdate,
+ normalizeAudio,
+ showSystemTrayIcon,
+ systemTitleBar,
+ skipNonMusic,
+ closeBehavior,
+ accentColorScheme,
+ layoutMode,
+ locale,
+ market,
+ searchMode,
+ downloadLocation,
+ localLibraryLocation,
+ pipedInstance,
+ invidiousInstance,
+ themeMode,
+ audioSource,
+ youtubeClientEngine,
+ streamMusicCodec,
+ downloadMusicCodec,
+ discordPresence,
+ endlessPlayback,
+ enableConnect,
+ cacheMusic
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'preferences_table';
+ @override
+ Set get $primaryKey => {id};
+ @override
+ PreferencesTableData map(Map data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return PreferencesTableData(
+ id: attachedDatabase.typeMapping
+ .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
+ audioQuality: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}audio_quality'])!,
+ albumColorSync: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}album_color_sync'])!,
+ amoledDarkTheme: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool, data['${effectivePrefix}amoled_dark_theme'])!,
+ checkUpdate: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}check_update'])!,
+ normalizeAudio: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}normalize_audio'])!,
+ showSystemTrayIcon: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool, data['${effectivePrefix}show_system_tray_icon'])!,
+ systemTitleBar: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}system_title_bar'])!,
+ skipNonMusic: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}skip_non_music'])!,
+ closeBehavior: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}close_behavior'])!,
+ accentColorScheme: attachedDatabase.typeMapping.read(
+ DriftSqlType.string, data['${effectivePrefix}accent_color_scheme'])!,
+ layoutMode: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}layout_mode'])!,
+ locale: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}locale'])!,
+ market: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}market'])!,
+ searchMode: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}search_mode'])!,
+ downloadLocation: attachedDatabase.typeMapping.read(
+ DriftSqlType.string, data['${effectivePrefix}download_location'])!,
+ localLibraryLocation: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}local_library_location'])!,
+ pipedInstance: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}piped_instance'])!,
+ invidiousInstance: attachedDatabase.typeMapping.read(
+ DriftSqlType.string, data['${effectivePrefix}invidious_instance'])!,
+ themeMode: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}theme_mode'])!,
+ audioSource: attachedDatabase.typeMapping
+ .read(DriftSqlType.string, data['${effectivePrefix}audio_source'])!,
+ youtubeClientEngine: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}youtube_client_engine'])!,
+ streamMusicCodec: attachedDatabase.typeMapping.read(
+ DriftSqlType.string, data['${effectivePrefix}stream_music_codec'])!,
+ downloadMusicCodec: attachedDatabase.typeMapping.read(
+ DriftSqlType.string, data['${effectivePrefix}download_music_codec'])!,
+ discordPresence: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}discord_presence'])!,
+ endlessPlayback: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}endless_playback'])!,
+ enableConnect: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}enable_connect'])!,
+ cacheMusic: attachedDatabase.typeMapping
+ .read(DriftSqlType.bool, data['${effectivePrefix}cache_music'])!,
+ );
+ }
+
+ @override
+ PreferencesTable createAlias(String alias) {
+ return PreferencesTable(attachedDatabase, alias);
+ }
+}
+
+class PreferencesTableData extends DataClass
+ implements Insertable {
+ final int id;
+ final String audioQuality;
+ final bool albumColorSync;
+ final bool amoledDarkTheme;
+ final bool checkUpdate;
+ final bool normalizeAudio;
+ final bool showSystemTrayIcon;
+ final bool systemTitleBar;
+ final bool skipNonMusic;
+ final String closeBehavior;
+ final String accentColorScheme;
+ final String layoutMode;
+ final String locale;
+ final String market;
+ final String searchMode;
+ final String downloadLocation;
+ final String localLibraryLocation;
+ final String pipedInstance;
+ final String invidiousInstance;
+ final String themeMode;
+ final String audioSource;
+ final String youtubeClientEngine;
+ final String streamMusicCodec;
+ final String downloadMusicCodec;
+ final bool discordPresence;
+ final bool endlessPlayback;
+ final bool enableConnect;
+ final bool cacheMusic;
+ const PreferencesTableData(
+ {required this.id,
+ required this.audioQuality,
+ required this.albumColorSync,
+ required this.amoledDarkTheme,
+ required this.checkUpdate,
+ required this.normalizeAudio,
+ required this.showSystemTrayIcon,
+ required this.systemTitleBar,
+ required this.skipNonMusic,
+ required this.closeBehavior,
+ required this.accentColorScheme,
+ required this.layoutMode,
+ required this.locale,
+ required this.market,
+ required this.searchMode,
+ required this.downloadLocation,
+ required this.localLibraryLocation,
+ required this.pipedInstance,
+ required this.invidiousInstance,
+ required this.themeMode,
+ required this.audioSource,
+ required this.youtubeClientEngine,
+ required this.streamMusicCodec,
+ required this.downloadMusicCodec,
+ required this.discordPresence,
+ required this.endlessPlayback,
+ required this.enableConnect,
+ required this.cacheMusic});
+ @override
+ Map toColumns(bool nullToAbsent) {
+ final map = {};
+ map['id'] = Variable(id);
+ map['audio_quality'] = Variable(audioQuality);
+ map['album_color_sync'] = Variable(albumColorSync);
+ map['amoled_dark_theme'] = Variable(amoledDarkTheme);
+ map['check_update'] = Variable(checkUpdate);
+ map['normalize_audio'] = Variable(normalizeAudio);
+ map['show_system_tray_icon'] = Variable(showSystemTrayIcon);
+ map['system_title_bar'] = Variable(systemTitleBar);
+ map['skip_non_music'] = Variable(skipNonMusic);
+ map['close_behavior'] = Variable(closeBehavior);
+ map['accent_color_scheme'] = Variable(accentColorScheme);
+ map['layout_mode'] = Variable(layoutMode);
+ map['locale'] = Variable(locale);
+ map['market'] = Variable(market);
+ map['search_mode'] = Variable(searchMode);
+ map['download_location'] = Variable(downloadLocation);
+ map['local_library_location'] = Variable(localLibraryLocation);
+ map['piped_instance'] = Variable(pipedInstance);
+ map['invidious_instance'] = Variable(invidiousInstance);
+ map['theme_mode'] = Variable(themeMode);
+ map['audio_source'] = Variable(audioSource);
+ map['youtube_client_engine'] = Variable(youtubeClientEngine);
+ map['stream_music_codec'] = Variable(streamMusicCodec);
+ map['download_music_codec'] = Variable(downloadMusicCodec);
+ map['discord_presence'] = Variable(discordPresence);
+ map['endless_playback'] = Variable(endlessPlayback);
+ map['enable_connect'] = Variable(enableConnect);
+ map['cache_music'] = Variable(cacheMusic);
+ return map;
+ }
+
+ PreferencesTableCompanion toCompanion(bool nullToAbsent) {
+ return PreferencesTableCompanion(
+ id: Value(id),
+ audioQuality: Value(audioQuality),
+ albumColorSync: Value(albumColorSync),
+ amoledDarkTheme: Value(amoledDarkTheme),
+ checkUpdate: Value(checkUpdate),
+ normalizeAudio: Value(normalizeAudio),
+ showSystemTrayIcon: Value(showSystemTrayIcon),
+ systemTitleBar: Value(systemTitleBar),
+ skipNonMusic: Value(skipNonMusic),
+ closeBehavior: Value(closeBehavior),
+ accentColorScheme: Value(accentColorScheme),
+ layoutMode: Value(layoutMode),
+ locale: Value(locale),
+ market: Value(market),
+ searchMode: Value(searchMode),
+ downloadLocation: Value(downloadLocation),
+ localLibraryLocation: Value(localLibraryLocation),
+ pipedInstance: Value(pipedInstance),
+ invidiousInstance: Value(invidiousInstance),
+ themeMode: Value(themeMode),
+ audioSource: Value(audioSource),
+ youtubeClientEngine: Value(youtubeClientEngine),
+ streamMusicCodec: Value(streamMusicCodec),
+ downloadMusicCodec: Value(downloadMusicCodec),
+ discordPresence: Value(discordPresence),
+ endlessPlayback: Value(endlessPlayback),
+ enableConnect: Value(enableConnect),
+ cacheMusic: Value(cacheMusic),
+ );
+ }
+
+ factory PreferencesTableData.fromJson(Map json,
+ {ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return PreferencesTableData(
+ id: serializer.fromJson(json['id']),
+ audioQuality: serializer.fromJson(json['audioQuality']),
+ albumColorSync: serializer.fromJson(json['albumColorSync']),
+ amoledDarkTheme: serializer.fromJson(json['amoledDarkTheme']),
+ checkUpdate: serializer.fromJson(json['checkUpdate']),
+ normalizeAudio: serializer.fromJson(json['normalizeAudio']),
+ showSystemTrayIcon: serializer.fromJson(json['showSystemTrayIcon']),
+ systemTitleBar: serializer.fromJson(json['systemTitleBar']),
+ skipNonMusic: serializer.fromJson(json['skipNonMusic']),
+ closeBehavior: serializer.fromJson(json['closeBehavior']),
+ accentColorScheme: serializer.fromJson(json['accentColorScheme']),
+ layoutMode: serializer.fromJson(json['layoutMode']),
+ locale: serializer.fromJson(json['locale']),
+ market: serializer.fromJson(json['market']),
+ searchMode: serializer.fromJson(json['searchMode']),
+ downloadLocation: serializer.fromJson(json['downloadLocation']),
+ localLibraryLocation:
+ serializer.fromJson(json['localLibraryLocation']),
+ pipedInstance: serializer.fromJson(json['pipedInstance']),
+ invidiousInstance: serializer.fromJson(json['invidiousInstance']),
+ themeMode: serializer.fromJson(json['themeMode']),
+ audioSource: serializer.fromJson(json['audioSource']),
+ youtubeClientEngine:
+ serializer.fromJson