Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/redesign' into new-track-list-tile
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Nov 3, 2024
2 parents f477eb9 + 34cda03 commit ede3b8a
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 131 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ jobs:
# with:
# distribution: 'zulu'
# java-version: '17'
- name: Set up Rust (for smtc_windows)
uses: hecrj/setup-rust-action@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion lib/components/PlayerScreen/artist_chip.g.dart

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

7 changes: 4 additions & 3 deletions lib/services/audio_service_smtc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class AudioServiceSMTC extends AudioServicePlatform {
// initialize SMTC
//TODO we should call smtc.dispose() before the app is closed to prevent a background process from continuing to run
// https://pub.dev/packages/flutter_window_close could be used to detect when the app is closed
await SMTCWindows.initialize();
smtc = SMTCWindows(
// Which buttons to show in the OS media player
config: const SMTCConfig(
Expand Down Expand Up @@ -62,12 +63,12 @@ class AudioServiceSMTC extends AudioServicePlatform {
if (request.state.playing && !smtc.enabled) {
await smtc
.enableSmtc()
.then((value) => smtc.setPlaybackStatus(PlaybackStatus.Playing));
.then((value) => smtc.setPlaybackStatus(PlaybackStatus.playing));
} else {
await smtc.setPosition(request.state.updatePosition);
await smtc.setPlaybackStatus(request.state.playing
? PlaybackStatus.Playing
: PlaybackStatus.Paused);
? PlaybackStatus.playing
: PlaybackStatus.paused);

await smtc.setRepeatMode(switch (request.state.repeatMode) {
AudioServiceRepeatModeMessage.none => RepeatMode.none,
Expand Down
4 changes: 3 additions & 1 deletion lib/services/favorite_provider.g.dart

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

4 changes: 3 additions & 1 deletion lib/services/finamp_settings_helper.g.dart

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

1 change: 1 addition & 0 deletions lib/services/offline_listen_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class OfflineListenLogHelper {
/// The [timestamp] provided to this function should be in seconds
/// and marks the time the track was stopped.
Future<void> _logOfflineListen(OfflineListen listen) {
_logger.info("Storing offline listen for ${listen.name}");
return Future.wait([
Hive.box<OfflineListen>("OfflineListens").add(listen),
_exportOfflineListenToFile(listen)
Expand Down
14 changes: 8 additions & 6 deletions lib/services/playback_history_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,21 @@ class PlaybackHistoryService {
PlaybackState? previousState,
bool skippingForward,
) async {
final shouldReportPreviousTrack = previousItem != null &&
previousState != null &&
// don't submit stop events for idle tracks (at position 0 and not playing)
(previousState.playing ||
previousState.updatePosition != Duration.zero);

if (FinampSettingsHelper.finampSettings.isOffline) {
if (previousItem != null) {
if (shouldReportPreviousTrack) {
await _offlineListenLogHelper.logOfflineListen(previousItem.item);
}
return;
}

jellyfin_models.PlaybackProgressInfo? previousTrackPlaybackData;
if (previousItem != null &&
previousState != null &&
// don't submit stop events for idle tracks (at position 0 and not playing)
(previousState.playing ||
previousState.updatePosition != Duration.zero)) {
if (shouldReportPreviousTrack) {
previousTrackPlaybackData = generatePlaybackProgressInfoFromState(
previousItem,
previousState,
Expand Down
8 changes: 4 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

Expand All @@ -19,9 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
2 changes: 1 addition & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
isar_flutter_libs
media_kit_libs_linux
screen_retriever
screen_retriever_linux
url_launcher_linux
window_manager
)
Expand Down
Loading

0 comments on commit ede3b8a

Please sign in to comment.