Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add invidious audio source and fix auto skipping tracks #2005

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/invidious.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ targets:
explicit_to_json: true
drift_dev:
options:
databases:
app_db: lib/models/database/database.dart
sql:
dialect: sqlite
options:
Expand Down
1 change: 1 addition & 0 deletions drift_schemas/app_db/drift_schema_v1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions drift_schemas/app_db/drift_schema_v2.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/collections/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
"piped_instance": "Piped Server Instance",
"piped_description": "The Piped server instance to use for track matching",
"piped_warning": "Some of them might not work well. So use at your own risk",
"invidious_instance": "Invidious Server Instance",
"invidious_description": "The Invidious server instance to use for track matching",
"invidious_warning": "Some of them might not work well. So use at your own risk",
"generate_playlist": "Generate Playlist",
"track_exists": "Track {track} already exists",
"replace_downloaded_tracks": "Replace all downloaded tracks",
Expand Down Expand Up @@ -307,6 +310,7 @@
"youtube_source_description": "Recommended and works best.",
"piped_source_description": "Feeling free? Same as YouTube but a lot free.",
"jiosaavn_source_description": "Best for South Asian region.",
"invidious_source_description": "Similar to Piped but with higher availability.",
"highest_quality": "Highest Quality: {quality}",
"select_audio_source": "Select Audio Source",
"endless_playback_description": "Automatically append new songs\nto the end of the queue",
Expand Down
4 changes: 2 additions & 2 deletions lib/models/connect/connect.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion lib/models/database/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:media_kit/media_kit.dart' hide Track;
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'package:spotify/spotify.dart' hide Playlist;
import 'package:spotube/models/database/database.steps.dart';
import 'package:spotube/models/lyrics.dart';
import 'package:spotube/services/kv_store/encrypted_kv_store.dart';
import 'package:spotube/services/kv_store/kv_store.dart';
Expand Down Expand Up @@ -57,7 +58,20 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());

@override
int get schemaVersion => 1;
int get schemaVersion => 2;

@override
MigrationStrategy get migration {
return MigrationStrategy(
onUpgrade: stepByStep(from1To2: (m, schema) async {
// Add invidiousInstance column to preferences table
await m.addColumn(
schema.preferencesTable,
schema.preferencesTable.invidiousInstance,
);
}),
);
}
}

LazyDatabase _openConnection() {
Expand Down
Loading
Loading