Skip to content

Commit 9f2d423

Browse files
authored
feat: add invidious audio source and fix auto skipping tracks (#2005)
* feat: add invidious audio source with automatic track switch even on server playback endpoint * fix: switching to different source on playback endpoint error not working * chore: update invidious version * feat: invidious instances customizability
1 parent 3c45732 commit 9f2d423

30 files changed

+10400
-1193
lines changed

assets/invidious.jpg

97.9 KB
Loading

build.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ targets:
1010
explicit_to_json: true
1111
drift_dev:
1212
options:
13+
databases:
14+
app_db: lib/models/database/database.dart
1315
sql:
1416
dialect: sqlite
1517
options:

drift_schemas/app_db/drift_schema_v1.json

+1
Large diffs are not rendered by default.

drift_schemas/app_db/drift_schema_v2.json

+1
Large diffs are not rendered by default.

lib/collections/assets.gen.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/l10n/app_en.arb

+4
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@
190190
"piped_instance": "Piped Server Instance",
191191
"piped_description": "The Piped server instance to use for track matching",
192192
"piped_warning": "Some of them might not work well. So use at your own risk",
193+
"invidious_instance": "Invidious Server Instance",
194+
"invidious_description": "The Invidious server instance to use for track matching",
195+
"invidious_warning": "Some of them might not work well. So use at your own risk",
193196
"generate_playlist": "Generate Playlist",
194197
"track_exists": "Track {track} already exists",
195198
"replace_downloaded_tracks": "Replace all downloaded tracks",
@@ -307,6 +310,7 @@
307310
"youtube_source_description": "Recommended and works best.",
308311
"piped_source_description": "Feeling free? Same as YouTube but a lot free.",
309312
"jiosaavn_source_description": "Best for South Asian region.",
313+
"invidious_source_description": "Similar to Piped but with higher availability.",
310314
"highest_quality": "Highest Quality: {quality}",
311315
"select_audio_source": "Select Audio Source",
312316
"endless_playback_description": "Automatically append new songs\nto the end of the queue",

lib/models/connect/connect.g.dart

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/models/database/database.dart

+15-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:media_kit/media_kit.dart' hide Track;
99
import 'package:path/path.dart';
1010
import 'package:path_provider/path_provider.dart';
1111
import 'package:spotify/spotify.dart' hide Playlist;
12+
import 'package:spotube/models/database/database.steps.dart';
1213
import 'package:spotube/models/lyrics.dart';
1314
import 'package:spotube/services/kv_store/encrypted_kv_store.dart';
1415
import 'package:spotube/services/kv_store/kv_store.dart';
@@ -57,7 +58,20 @@ class AppDatabase extends _$AppDatabase {
5758
AppDatabase() : super(_openConnection());
5859

5960
@override
60-
int get schemaVersion => 1;
61+
int get schemaVersion => 2;
62+
63+
@override
64+
MigrationStrategy get migration {
65+
return MigrationStrategy(
66+
onUpgrade: stepByStep(from1To2: (m, schema) async {
67+
// Add invidiousInstance column to preferences table
68+
await m.addColumn(
69+
schema.preferencesTable,
70+
schema.preferencesTable.invidiousInstance,
71+
);
72+
}),
73+
);
74+
}
6175
}
6276

6377
LazyDatabase _openConnection() {

0 commit comments

Comments
 (0)