Skip to content

Commit

Permalink
patch out discord
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 17, 2024
1 parent cb95663 commit 56b03f3
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 118 deletions.
6 changes: 1 addition & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:catcher_2/catcher_2.dart';
import 'package:dart_discord_rpc/dart_discord_rpc.dart';

import 'package:device_preview/device_preview.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -69,10 +69,6 @@ Future<void> main(List<String> rawArgs) async {
MetadataGod.initialize();
}

if (DesktopTools.platform.isWindows || DesktopTools.platform.isLinux) {
DiscordRPC.initialize();
}

await KVStoreService.initialize();

final hiveCacheDir =
Expand Down
7 changes: 0 additions & 7 deletions lib/pages/settings/sections/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ class SettingsDesktopSection extends HookConsumerWidget {
value: preferences.systemTitleBar,
onChanged: preferencesNotifier.setSystemTitleBar,
),
if (!DesktopTools.platform.isMacOS)
SwitchListTile(
secondary: const Icon(SpotubeIcons.discord),
title: Text(context.l10n.discord_rich_presence),
value: preferences.discordPresence,
onChanged: preferencesNotifier.setDiscordPresence,
),
],
);
}
Expand Down
69 changes: 0 additions & 69 deletions lib/provider/discord_provider.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/provider/proxy_playlist/player_listeners.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extension ProxyPlaylistListeners on ProxyPlaylistNotifier {
);

notificationService.addTrack(state.activeTrack!);
discord.updatePresence(state.activeTrack!);
updatePalette();
});
}
Expand Down
3 changes: 0 additions & 3 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import 'package:spotube/provider/user_preferences/user_preferences_provider.dart
import 'package:spotube/provider/user_preferences/user_preferences_state.dart';
import 'package:spotube/services/audio_player/audio_player.dart';
import 'package:spotube/services/audio_services/audio_services.dart';
import 'package:spotube/provider/discord_provider.dart';

import 'package:spotube/utils/persisted_state_notifier.dart';

Expand All @@ -31,7 +30,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist> {
UserPreferences get preferences => ref.read(userPreferencesProvider);
ProxyPlaylist get playlist => state;
BlackListNotifier get blacklist => ref.read(blacklistProvider.notifier);
Discord get discord => ref.read(discordProvider);

List<StreamSubscription> _subscriptions = [];

Expand Down Expand Up @@ -164,7 +162,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist> {
Future<void> stop() async {
state = ProxyPlaylist({});
await audioPlayer.stop();
discord.clear();
}

Future<void> updatePalette() async {
Expand Down
4 changes: 0 additions & 4 deletions lib/provider/user_preferences/user_preferences_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ class UserPreferencesNotifier extends PersistedStateNotifier<UserPreferences> {
}
}

void setDiscordPresence(bool discordPresence) {
state = state.copyWith(discordPresence: discordPresence);
}

void setAmoledDarkTheme(bool isAmoled) {
state = state.copyWith(amoledDarkTheme: isAmoled);
}
Expand Down
1 change: 0 additions & 1 deletion lib/provider/user_preferences/user_preferences_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class UserPreferences with _$UserPreferences {
@Default(AudioSource.youtube) AudioSource audioSource,
@Default(SourceCodecs.weba) SourceCodecs streamMusicCodec,
@Default(SourceCodecs.m4a) SourceCodecs downloadMusicCodec,
@Default(true) bool discordPresence,
@Default(true) bool endlessPlayback,
@Default(false) bool enableConnect,
}) = _UserPreferences;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ mixin _$UserPreferences {
AudioSource get audioSource => throw _privateConstructorUsedError;
SourceCodecs get streamMusicCodec => throw _privateConstructorUsedError;
SourceCodecs get downloadMusicCodec => throw _privateConstructorUsedError;
bool get discordPresence => throw _privateConstructorUsedError;
bool get endlessPlayback => throw _privateConstructorUsedError;
bool get enableConnect => throw _privateConstructorUsedError;

Expand Down Expand Up @@ -93,7 +92,6 @@ abstract class $UserPreferencesCopyWith<$Res> {
AudioSource audioSource,
SourceCodecs streamMusicCodec,
SourceCodecs downloadMusicCodec,
bool discordPresence,
bool endlessPlayback,
bool enableConnect});
}
Expand Down Expand Up @@ -131,7 +129,6 @@ class _$UserPreferencesCopyWithImpl<$Res, $Val extends UserPreferences>
Object? audioSource = null,
Object? streamMusicCodec = null,
Object? downloadMusicCodec = null,
Object? discordPresence = null,
Object? endlessPlayback = null,
Object? enableConnect = null,
}) {
Expand Down Expand Up @@ -216,10 +213,6 @@ class _$UserPreferencesCopyWithImpl<$Res, $Val extends UserPreferences>
? _value.downloadMusicCodec
: downloadMusicCodec // ignore: cast_nullable_to_non_nullable
as SourceCodecs,
discordPresence: null == discordPresence
? _value.discordPresence
: discordPresence // ignore: cast_nullable_to_non_nullable
as bool,
endlessPlayback: null == endlessPlayback
? _value.endlessPlayback
: endlessPlayback // ignore: cast_nullable_to_non_nullable
Expand Down
4 changes: 0 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "generated_plugin_registrant.h"

#include <dart_discord_rpc/dart_discord_rpc_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <gtk/gtk_plugin.h>
Expand All @@ -20,9 +19,6 @@
#include <window_size/window_size_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dart_discord_rpc_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DartDiscordRpcPlugin");
dart_discord_rpc_plugin_register_with_registrar(dart_discord_rpc_registrar);
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
Expand Down
1 change: 0 additions & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
dart_discord_rpc
file_selector_linux
flutter_secure_storage_linux
gtk
Expand Down
9 changes: 0 additions & 9 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.2"
dart_discord_rpc:
dependency: "direct main"
description:
path: "."
ref: HEAD
resolved-ref: "4d05017838ebeadcdb832e1893fabad1506fddba"
url: "https://github.com/Tommypop2/dart_discord_rpc.git"
source: git
version: "0.0.3"
dart_style:
dependency: transitive
description:
Expand Down
3 changes: 0 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ dependencies:
very_good_infinite_list: ^0.7.1
gap: ^3.0.1
sliver_tools: ^0.2.12
dart_discord_rpc:
git:
url: https://github.com/Tommypop2/dart_discord_rpc.git
html_unescape: ^2.0.0
wikipedia_api: ^0.1.0
skeletonizer: ^0.8.0
Expand Down
3 changes: 0 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <app_links/app_links_plugin_c_api.h>
#include <bonsoir_windows/bonsoir_windows_plugin_c_api.h>
#include <dart_discord_rpc/dart_discord_rpc_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <local_notifier/local_notifier_plugin.h>
Expand All @@ -26,8 +25,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
BonsoirWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BonsoirWindowsPluginCApi"));
DartDiscordRpcPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DartDiscordRpcPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
Expand Down
1 change: 0 additions & 1 deletion windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
app_links
bonsoir_windows
dart_discord_rpc
file_selector_windows
flutter_secure_storage_windows
local_notifier
Expand Down

0 comments on commit 56b03f3

Please sign in to comment.