From f7ca3a654f125b2c39f8e0b8cdd8b58eff01dfbe Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 2 Jun 2023 13:06:02 +0600 Subject: [PATCH] chore: only remove native event loop for macos --- .github/workflows/spotube-release-binary.yml | 1 + lib/services/audio_player/loop_mode.dart | 24 ----------------- linux/flutter/generated_plugins.cmake | 1 + pubspec.lock | 27 +++++++------------- pubspec.yaml | 5 ++-- windows/flutter/generated_plugins.cmake | 1 + 6 files changed, 14 insertions(+), 45 deletions(-) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 1ad9632a0..05c4809fb 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -283,6 +283,7 @@ jobs: - name: Generate Secrets run: | flutter pub get + flutter pub remove media_kit_native_event_loop dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns - name: Build Macos App diff --git a/lib/services/audio_player/loop_mode.dart b/lib/services/audio_player/loop_mode.dart index 252d68105..78da43bae 100644 --- a/lib/services/audio_player/loop_mode.dart +++ b/lib/services/audio_player/loop_mode.dart @@ -1,7 +1,5 @@ import 'package:audio_service/audio_service.dart'; import 'package:media_kit/media_kit.dart'; -// import 'package:just_audio/just_audio.dart'; -import 'package:mpris_service/mpris_service.dart'; /// An unified loop mode for both [LoopMode] and [PlaylistMode] enum PlaybackLoopMode { @@ -53,28 +51,6 @@ enum PlaybackLoopMode { } } - static PlaybackLoopMode fromMPRISLoopStatus(MPRISLoopStatus status) { - switch (status) { - case MPRISLoopStatus.none: - return PlaybackLoopMode.none; - case MPRISLoopStatus.track: - return PlaybackLoopMode.one; - case MPRISLoopStatus.playlist: - return PlaybackLoopMode.all; - } - } - - MPRISLoopStatus toMPRISLoopStatus() { - switch (this) { - case PlaybackLoopMode.all: - return MPRISLoopStatus.playlist; - case PlaybackLoopMode.one: - return MPRISLoopStatus.track; - case PlaybackLoopMode.none: - return MPRISLoopStatus.none; - } - } - static PlaybackLoopMode fromAudioServiceRepeatMode( AudioServiceRepeatMode mode) { switch (mode) { diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index e4784bd4c..1d7de67a6 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -16,6 +16,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + media_kit_native_event_loop metadata_god ) diff --git a/pubspec.lock b/pubspec.lock index 29f765d7b..b29affab8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -161,14 +161,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" - base_x: - dependency: transitive - description: - name: base_x - sha256: "3f1043679659f1759c651f900da6f24f0a8062c28daa6f9625e8d580002e187b" - url: "https://pub.dev" - source: hosted - version: "2.0.0" boolean_selector: dependency: transitive description: @@ -419,7 +411,7 @@ packages: source: hosted version: "1.1.0" dbus: - dependency: transitive + dependency: "direct main" description: name: dbus sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" @@ -1102,6 +1094,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.3" + media_kit_native_event_loop: + dependency: "direct main" + description: + name: media_kit_native_event_loop + sha256: "521125e534603c3f603b93283db3938f557f33ecc383fbd62edd4beb3bf73747" + url: "https://pub.dev" + source: hosted + version: "1.0.4" meta: dependency: transitive description: @@ -1126,15 +1126,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" - mpris_service: - dependency: "direct main" - description: - path: "." - ref: HEAD - resolved-ref: "3a4a72140087d3df130271c9213e61fa413d5740" - url: "https://github.com/alexmercerind/mpris_service" - source: git - version: "1.0.0" mutex: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2c80b92a9..7c87589f5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,9 +64,6 @@ dependencies: media_kit_libs_windows_audio: ^1.0.3 metadata_god: ^0.4.1 mime: ^1.0.2 - mpris_service: - git: - url: https://github.com/alexmercerind/mpris_service package_info_plus: ^3.0.2 palette_generator: ^0.3.3 path: ^1.8.0 @@ -103,6 +100,8 @@ dependencies: ref: eaade37d0938d31dbfa35bb5152caca4e284bda6 supabase_flutter: ^1.9.1 device_preview: ^1.1.0 + media_kit_native_event_loop: ^1.0.4 + dbus: ^0.7.8 dev_dependencies: build_runner: ^2.3.2 diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 30434037d..186806c74 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -18,6 +18,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + media_kit_native_event_loop metadata_god smtc_windows )