Skip to content

Commit 47c1abc

Browse files
committed
fix(menu/player): again clicking on another song crashes.
Updated release build for macos without mpris
1 parent 1d04eb7 commit 47c1abc

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ jobs:
5151
brew install meson ninja libmng dbus
5252
# Install other dependencies
5353
brew install cmake pkg-config fftw mpv curl fmt rapidjson
54+
export PKG_CONFIG_PATH="/usr/local/lib:/opt/homebrew/lib:$PKG_CONFIG_PATH"
5455
# Manually build and install sdbus-c++ for macOS
55-
git clone --depth 1 https://github.com/Kistler-Group/sdbus-cpp.git
56-
cd sdbus-cpp
57-
mkdir build && cd build
58-
cmake .. -DCMAKE_BUILD_TYPE=Release -DSDBUSCPP_BUILD_CODEGEN=ON
59-
cmake --build .
60-
sudo cmake --build . --target install
56+
#git clone --depth 1 https://github.com/Kistler-Group/sdbus-cpp.git
57+
#cd sdbus-cpp
58+
#mkdir build && cd build
59+
#cmake .. -DCMAKE_BUILD_TYPE=Release -DSDBUSCPP_BUILD_CODEGEN=ON
60+
#cmake --build .
61+
#sudo cmake --build . --target install
6162
# elif [ "$RUNNER_OS" == "Windows" ]; then
6263
# choco install cmake
6364
# # Note: Windows build requires vcpkg or manual dependency setup
@@ -69,7 +70,11 @@ jobs:
6970
mkdir build
7071
cd build
7172
if [ "${{ matrix.target }}" == "macos-arm64" ]; then
72-
cmake .. -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release
73+
export PKG_CONFIG_PATH="/usr/local/lib:/opt/homebrew/lib:$PKG_CONFIG_PATH"
74+
cmake .. -DWITH_MPRIS=OFF -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_BUILD_TYPE=Release
75+
elif [ "${{ matrix.target }}" == "macos-x64" ]; then
76+
export PKG_CONFIG_PATH="/usr/local/lib:/opt/homebrew/lib:$PKG_CONFIG_PATH"
77+
cmake .. -DWITH_MPRIS=OFF -DCMAKE_BUILD_TYPE=Release
7378
else
7479
cmake .. -DCMAKE_BUILD_TYPE=Release
7580
fi

src/core/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ void switch_playlist_source(const std::vector<Track> &new_tracks) {
223223
#ifdef WITH_MPRIS
224224
#include "../audio/mpris_handler.cpp"
225225
std::unique_ptr<MPRISHandler> mpris_handler;
226+
bool is_mpris_active = false;
226227

227228
// In TUI mode initialization:
228229
void setupMPRISForDaemon(std::shared_ptr<MusicPlayer> player,
@@ -666,7 +667,10 @@ int main(int argc, char *argv[]) {
666667

667668

668669
#ifdef WITH_MPRIS
669-
tui_mpris->setup(player);
670+
if(!is_mpris_active){
671+
tui_mpris->setup(player);
672+
is_mpris_active = true;
673+
}
670674
#endif
671675

672676
screen.PostEvent(Event::Custom);

0 commit comments

Comments
 (0)