Skip to content

Commit

Permalink
Merge pull request #3 from x753/patch-3
Browse files Browse the repository at this point in the history
This fixes the issue with Windows 11 not using the Process name (Spotify.exe) for the UWP Spotify app, will merge. Thanks
  • Loading branch information
Jakhaxz authored Oct 4, 2022
2 parents 354c5fe + ebd55c5 commit 14bfa45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def get_media_info():
global current_session
current_session = sessions.get_current_session()
if current_session: # there needs to be a media session running
if current_session.source_app_user_model_id == 'Spotify.exe':
if current_session.source_app_user_model_id.startswith('Spotify'):
info = await current_session.try_get_media_properties_async()

# song_attr[0] != '_' ignores system attributes
Expand Down Expand Up @@ -81,7 +81,7 @@ def volSlider(unused_addr, arg):
sessions = AudioUtilities.GetAllSessions()
for session in sessions:
volume = session._ctl.QueryInterface(ISimpleAudioVolume)
if session.Process and session.Process.name() == "Spotify.exe":
if session.Process and session.Process.name().startswith("Spotify"):
print("Spotify volume: %s" % str(round(volume.GetMasterVolume(), 2)))
volume.SetMasterVolume(arg, None)
CoUninitialize()
Expand Down

0 comments on commit 14bfa45

Please sign in to comment.