Skip to content

Commit

Permalink
Merge pull request #367 from doronz88/bugfix/media
Browse files Browse the repository at this point in the history
Bugfix/media
  • Loading branch information
doronz88 authored Oct 15, 2024
2 parents d107851 + ed6a1bd commit 94679af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rpcclient/rpcclient/darwin/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from typing import Any, Union

CfSerializable = Union[
tuple[str, Any], list, tuple[Any, ...], str, bool, float, bytes, datetime, None]
dict[str, Any], list, tuple[Any, ...], str, bool, float, bytes, datetime, None]
2 changes: 1 addition & 1 deletion src/rpcclient/rpcclient/darwin/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def set_mode(self, mode: AVAudioSessionMode):
def set_category(self, category: AVAudioSessionCategory,
mode: AVAudioSessionMode = AVAudioSessionMode.Default,
route_sharing_policy: AVAudioSessionRouteSharingPolicy = AVAudioSessionRouteSharingPolicy.Default,
options: AVAudioSessionCategoryOptions = 0):
options: AVAudioSessionCategoryOptions = AVAudioSessionCategoryOptions.DefaultToSpeaker) -> None:
category = self._client.symbols[category.value][0]
mode = self._client.symbols[mode.value][0]
self._session.objc_call('setCategory:mode:routeSharingPolicy:options:error:', category, mode,
Expand Down
6 changes: 6 additions & 0 deletions src/rpcclient/rpcclient/darwin/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ def objc_symbol(self):

@property
def osstatus(self) -> Optional[list[ErrorCode]]:
""" Get possible translation to given error code by querying osstatus """
return get_possible_error_codes(self)

@property
def stripped_value(self) -> 'DarwinSymbol':
""" Remove PAC upper bits """
return self._client.symbol(self & 0xfffffffff)
2 changes: 1 addition & 1 deletion src/rpcclient/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_get_dummy_block(client):
"""
:param rpcclient.client.Client client:
"""
assert client.get_dummy_block()[0] == client.symbols._NSConcreteGlobalBlock
client.cf([1, 2, 3]).objc_call('enumerateObjectsUsingBlock:', client.get_dummy_block())


def test_listdir(client):
Expand Down

0 comments on commit 94679af

Please sign in to comment.