From c7817909ce0920fac6d70706bc596e6fa3039a09 Mon Sep 17 00:00:00 2001
From: Amin <23167933+aminsaedi@users.noreply.github.com>
Date: Sun, 29 Oct 2023 05:56:48 -0400
Subject: [PATCH 01/72] Updated README.md file (#847)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 71589794..d82af783 100644
--- a/README.md
+++ b/README.md
@@ -108,7 +108,7 @@ This handy table lists all methods you can use to install Spotube:
-
Then run: sudo apt install Spotube-linux-x86_64.deb
+ Then run: sudo apt install ./Spotube-linux-x86_64.deb
From 03b5f08102a0837cd41bc52fe200aa15c339236a Mon Sep 17 00:00:00 2001
From: Kingkor Roy Tirtho
Date: Tue, 21 Nov 2023 20:03:22 +0600
Subject: [PATCH 02/72] chore: remove supabase dep
---
.circleci/config.yml | 2 -
.env.example | 3 -
lib/collections/env.dart | 6 -
.../proxy_playlist/next_fetcher_mixin.dart | 22 ----
.../proxy_playlist_provider.dart | 30 -----
lib/services/supabase.dart | 16 ---
pubspec.lock | 106 +++---------------
pubspec.yaml | 1 -
windows/flutter/CMakeLists.txt | 7 +-
9 files changed, 23 insertions(+), 170 deletions(-)
delete mode 100644 lib/services/supabase.dart
diff --git a/.circleci/config.yml b/.circleci/config.yml
index a5c71033..a55310ce 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -82,8 +82,6 @@ jobs:
name: Generate .env file
command: |
echo "SPOTIFY_SECRETS=${SPOTIFY_SECRETS}" >> .env
- echo "SUPABASE_URL=${SUPABASE_URL}" >> .env
- echo "SUPABASE_API_KEY=${SUPABASE_API_KEY}" >> .env
- run:
name: Replace Version in files
diff --git a/.env.example b/.env.example
index 67d1be8e..22abd24b 100644
--- a/.env.example
+++ b/.env.example
@@ -1,6 +1,3 @@
-SUPABASE_URL=
-SUPABASE_API_KEY=
-
# The format:
# SPOTIFY_SECRETS=clintId1:clientSecret1,clientId2:clientSecret2
SPOTIFY_SECRETS=
diff --git a/lib/collections/env.dart b/lib/collections/env.dart
index 1b9de3de..3923435b 100644
--- a/lib/collections/env.dart
+++ b/lib/collections/env.dart
@@ -4,12 +4,6 @@ part 'env.g.dart';
@Envied(obfuscate: true, requireEnvFile: true, path: ".env")
abstract class Env {
- @EnviedField(varName: 'SUPABASE_URL')
- static final String? supabaseUrl = _Env.supabaseUrl;
-
- @EnviedField(varName: 'SUPABASE_API_KEY')
- static final String? supabaseAnonKey = _Env.supabaseAnonKey;
-
@EnviedField(varName: 'SPOTIFY_SECRETS')
static final String rawSpotifySecrets = _Env.rawSpotifySecrets;
diff --git a/lib/provider/proxy_playlist/next_fetcher_mixin.dart b/lib/provider/proxy_playlist/next_fetcher_mixin.dart
index 61b86d8c..fa7fdfe8 100644
--- a/lib/provider/proxy_playlist/next_fetcher_mixin.dart
+++ b/lib/provider/proxy_playlist/next_fetcher_mixin.dart
@@ -1,14 +1,11 @@
import 'package:collection/collection.dart';
-import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/models/local_track.dart';
import 'package:spotube/models/logger.dart';
-import 'package:spotube/models/matched_track.dart';
import 'package:spotube/models/spotube_track.dart';
import 'package:spotube/provider/proxy_playlist/proxy_playlist.dart';
import 'package:spotube/provider/user_preferences_provider.dart';
-import 'package:spotube/services/supabase.dart';
import 'package:spotube/services/youtube/youtube.dart';
final logger = getLogger("NextFetcherMixin");
@@ -112,23 +109,4 @@ mixin NextFetcher on StateNotifier {
.whereNotNull()
.toList();
}
-
- /// This method must be called after any playback operation as
- /// it can increase the latency
- Future storeTrack(Track track, SpotubeTrack spotubeTrack) async {
- try {
- if (track is! SpotubeTrack) {
- await supabase.insertTrack(
- MatchedTrack(
- youtubeId: spotubeTrack.ytTrack.id,
- spotifyId: spotubeTrack.id!,
- searchMode: spotubeTrack.ytTrack.searchMode,
- ),
- );
- }
- } catch (e, stackTrace) {
- logger.e(e.toString());
- logger.t(stackTrace);
- }
- }
}
diff --git a/lib/provider/proxy_playlist/proxy_playlist_provider.dart b/lib/provider/proxy_playlist/proxy_playlist_provider.dart
index 685a9942..69537979 100644
--- a/lib/provider/proxy_playlist/proxy_playlist_provider.dart
+++ b/lib/provider/proxy_playlist/proxy_playlist_provider.dart
@@ -138,13 +138,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier
if (track != null) {
state = state.copyWith(tracks: mergeTracks([track], state.tracks));
}
-
- if (oldTrack != null && track != null) {
- await storeTrack(
- oldTrack,
- track,
- );
- }
} catch (e, stackTrace) {
// Removing tracks that were not found to avoid queue interruption
// TODO: Add a flag to enable/disable skip not found tracks
@@ -332,10 +325,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier
collections: {},
);
await notificationService.addTrack(addableTrack);
- await storeTrack(
- tracks.elementAt(initialIndex),
- addableTrack,
- );
}
await audioPlayer.openPlaylist(
@@ -365,13 +354,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier
if (oldTrack != null || track != null) {
await notificationService.addTrack(track ?? oldTrack!);
}
-
- if (oldTrack != null && track != null) {
- await storeTrack(
- oldTrack,
- track,
- );
- }
}
Future jumpToTrack(Track track) async {
@@ -474,12 +456,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier
if (oldTrack != null || track != null) {
await notificationService.addTrack(track ?? oldTrack!);
}
- if (oldTrack != null && track != null) {
- await storeTrack(
- oldTrack,
- track,
- );
- }
}
Future previous() async {
@@ -505,12 +481,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier
if (oldTrack != null || track != null) {
await notificationService.addTrack(track ?? oldTrack!);
}
- if (oldTrack != null && track != null) {
- await storeTrack(
- oldTrack,
- track,
- );
- }
}
Future stop() async {
diff --git a/lib/services/supabase.dart b/lib/services/supabase.dart
deleted file mode 100644
index d42d8eeb..00000000
--- a/lib/services/supabase.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-import 'package:spotube/collections/env.dart';
-import 'package:spotube/models/matched_track.dart';
-import 'package:supabase/supabase.dart';
-
-class SupabaseService {
- static final api = SupabaseClient(
- Env.supabaseUrl ?? "",
- Env.supabaseAnonKey ?? "",
- );
-
- Future insertTrack(MatchedTrack track) async {
- await api.from("tracks").insert(track.toJson());
- }
-}
-
-final supabase = SupabaseService();
diff --git a/pubspec.lock b/pubspec.lock
index 3dbc3cbf..093a133b 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -325,10 +325,10 @@ packages:
dependency: "direct main"
description:
name: collection
- sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
+ sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
- version: "1.17.2"
+ version: "1.18.0"
color:
dependency: transitive
description:
@@ -931,14 +931,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
- functions_client:
- dependency: transitive
- description:
- name: functions_client
- sha256: "3b157b4d3ae9e38614fd80fab76d1ef1e0e39ff3412a45de2651f27cecb9d2d2"
- url: "https://pub.dev"
- source: hosted
- version: "1.3.2"
fuzzywuzzy:
dependency: "direct main"
description:
@@ -971,14 +963,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
- gotrue:
- dependency: transitive
- description:
- name: gotrue
- sha256: af61c5c6a2374d9032b7e4b388de0bb0442f4bedc56372d5382c1ef61c85f1f3
- url: "https://pub.dev"
- source: hosted
- version: "1.12.1"
graphs:
dependency: transitive
description:
@@ -1192,14 +1176,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.2"
- jwt_decode:
- dependency: transitive
- description:
- name: jwt_decode
- sha256: d2e9f68c052b2225130977429d30f187aa1981d789c76ad104a32243cfdebfbb
- url: "https://pub.dev"
- source: hosted
- version: "0.3.1"
lints:
dependency: transitive
description:
@@ -1324,10 +1300,10 @@ packages:
dependency: transitive
description:
name: meta
- sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
+ sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
- version: "1.9.1"
+ version: "1.10.0"
metadata_god:
dependency: "direct main"
description:
@@ -1540,10 +1516,10 @@ packages:
dependency: transitive
description:
name: platform
- sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76"
+ sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102
url: "https://pub.dev"
source: hosted
- version: "3.1.0"
+ version: "3.1.2"
plugin_platform_interface:
dependency: transitive
description:
@@ -1576,14 +1552,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.8+2"
- postgrest:
- dependency: transitive
- description:
- name: postgrest
- sha256: d6cc0f60c7dc761f84d1c6d11d9e02b3ad90399bd84639a28c1c024adbaa9bde
- url: "https://pub.dev"
- source: hosted
- version: "1.5.0"
process:
dependency: transitive
description:
@@ -1648,22 +1616,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.2.1"
- realtime_client:
- dependency: transitive
- description:
- name: realtime_client
- sha256: b4b7bb293417dafc73943ed639209b2dcb796db8495e56bba29a4e26fadef5cd
- url: "https://pub.dev"
- source: hosted
- version: "1.2.1"
- retry:
- dependency: transitive
- description:
- name: retry
- sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc"
- url: "https://pub.dev"
- source: hosted
- version: "3.1.2"
riverpod:
dependency: transitive
description:
@@ -1890,10 +1842,10 @@ packages:
dependency: transitive
description:
name: stack_trace
- sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
+ sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
- version: "1.11.0"
+ version: "1.11.1"
state_notifier:
dependency: transitive
description:
@@ -1902,22 +1854,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.2+1"
- storage_client:
- dependency: transitive
- description:
- name: storage_client
- sha256: "4bf2fc76f09c3698f0ba3f1a44d567995796f6aef76501f194631d0c03752ab7"
- url: "https://pub.dev"
- source: hosted
- version: "1.5.2"
stream_channel:
dependency: transitive
description:
name: stream_channel
- sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
+ sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
- version: "2.1.1"
+ version: "2.1.2"
stream_transform:
dependency: transitive
description:
@@ -1942,14 +1886,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.2"
- supabase:
- dependency: "direct main"
- description:
- name: supabase
- sha256: "4bfa8f673b39c036ed82829a2ddc462dcacfc36fe168b680664ab954c7d91ccd"
- url: "https://pub.dev"
- source: hosted
- version: "1.11.3"
sync_http:
dependency: transitive
description:
@@ -2002,10 +1938,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
+ sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
- version: "0.6.0"
+ version: "0.6.1"
time:
dependency: transitive
description:
@@ -2178,10 +2114,10 @@ packages:
dependency: transitive
description:
name: vm_service
- sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f
+ sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
url: "https://pub.dev"
source: hosted
- version: "11.7.1"
+ version: "11.10.0"
watcher:
dependency: transitive
description:
@@ -2194,10 +2130,10 @@ packages:
dependency: transitive
description:
name: web
- sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
+ sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
- version: "0.1.4-beta"
+ version: "0.3.0"
web_socket_channel:
dependency: transitive
description:
@@ -2271,14 +2207,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
- yet_another_json_isolate:
- dependency: transitive
- description:
- name: yet_another_json_isolate
- sha256: "86fad76026c4241a32831d6c7febd8f9bded5019e2cd36c5b148499808d8307d"
- url: "https://pub.dev"
- source: hosted
- version: "1.1.1"
youtube_explode_dart:
dependency: "direct main"
description:
@@ -2288,5 +2216,5 @@ packages:
source: hosted
version: "2.0.2"
sdks:
- dart: ">=3.1.0 <4.0.0"
+ dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.13.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 04f2d8b8..f8e36ada 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -98,7 +98,6 @@ dependencies:
smtc_windows: ^0.1.1
spotify: ^0.12.0
stroke_text: ^0.0.2
- supabase: ^1.9.9
system_theme: ^2.1.0
titlebar_buttons: ^1.0.0
url_launcher: ^6.1.7
diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt
index b2e4bd8d..4f2af69b 100644
--- a/windows/flutter/CMakeLists.txt
+++ b/windows/flutter/CMakeLists.txt
@@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
+# Set fallback configurations for older versions of the flutter tool.
+if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
+ set(FLUTTER_TARGET_PLATFORM "windows-x64")
+endif()
+
# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
@@ -91,7 +96,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
- windows-x64 $
+ ${FLUTTER_TARGET_PLATFORM} $
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
From 722dd86810ea076c0e540ff5cd108fb5f2df2a0f Mon Sep 17 00:00:00 2001
From: Kingkor Roy Tirtho
Date: Mon, 27 Nov 2023 19:34:18 +0600
Subject: [PATCH 03/72] chore: track view play not working properly
---
.../sections/body/track_view_body.dart | 18 +-
lib/extensions/infinite_query.dart | 26 +-
lib/pages/artist/section/footer.dart | 6 +-
.../playlist_generate/playlist_generate.dart | 513 +++++++++---------
lib/pages/playlist/playlist.dart | 2 +-
5 files changed, 296 insertions(+), 269 deletions(-)
diff --git a/lib/components/shared/tracks_view/sections/body/track_view_body.dart b/lib/components/shared/tracks_view/sections/body/track_view_body.dart
index 486e4405..1c3ba3fb 100644
--- a/lib/components/shared/tracks_view/sections/body/track_view_body.dart
+++ b/lib/components/shared/tracks_view/sections/body/track_view_body.dart
@@ -25,8 +25,6 @@ class TrackViewBodySection extends HookConsumerWidget {
final playlistNotifier = ref.watch(ProxyPlaylistNotifier.notifier);
final props = InheritedTrackView.of(context);
- final trackViewState = ref.watch(trackViewProvider(props.tracks));
-
final searchController = useTextEditingController();
final searchFocus = useFocusNode();
@@ -35,12 +33,19 @@ class TrackViewBodySection extends HookConsumerWidget {
final isFiltering = useState(false);
+ final uniqTracks = useMemoized(() {
+ final trackIds = props.tracks.map((e) => e.id).toSet();
+ return props.tracks.where((e) => trackIds.remove(e.id)).toList();
+ }, [props.tracks]);
+
+ final trackViewState = ref.watch(trackViewProvider(uniqTracks));
+
final tracks = useMemoized(() {
List