ma-http-client 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/PKG-INFO +1 -1
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/client.py +5 -1
- ma_http_client-0.2.2/ma_http_client/version.py +1 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/PKG-INFO +1 -1
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_client_genres.py +8 -1
- ma_http_client-0.2.0/ma_http_client/version.py +0 -1
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/LICENSE +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/README.md +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/__init__.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/claude_tools.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/cli.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/debug.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/install_skill.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/skills/music-assistant/SKILL.md +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/SOURCES.txt +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/dependency_links.txt +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/entry_points.txt +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/requires.txt +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client.egg-info/top_level.txt +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/pyproject.toml +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/setup.cfg +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_claude_tools.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_cli.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_client.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_client_browse.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_client_catalog.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_client_playlists.py +0 -0
- {ma_http_client-0.2.0 → ma_http_client-0.2.2}/test/test_debug_client.py +0 -0
|
@@ -14,6 +14,7 @@ from music_assistant_models.player import Player
|
|
|
14
14
|
SORT_RANDOM = "random"
|
|
15
15
|
SORT_RANDOM_PLAY_COUNT = "random_play_count"
|
|
16
16
|
SORT_NAME = "sort_name"
|
|
17
|
+
RANDOM_SORT_FIELDS = (SORT_RANDOM, SORT_RANDOM_PLAY_COUNT)
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def debug_method(func):
|
|
@@ -181,7 +182,10 @@ class SimpleHTTPMusicAssistantClient:
|
|
|
181
182
|
args["search"] = search
|
|
182
183
|
if favorite is not None:
|
|
183
184
|
args["favorite"] = favorite
|
|
184
|
-
if sort_field:
|
|
185
|
+
if sort_field in RANDOM_SORT_FIELDS:
|
|
186
|
+
# the server only randomizes through the legacy order_by argument; sort_field=random is ignored
|
|
187
|
+
args["order_by"] = sort_field
|
|
188
|
+
elif sort_field:
|
|
185
189
|
args["sort_field"] = sort_field
|
|
186
190
|
if genre_ids:
|
|
187
191
|
args["genre"] = genre_ids
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.2"
|
|
@@ -38,7 +38,14 @@ class TestLibraryItems:
|
|
|
38
38
|
|
|
39
39
|
sent = _sent(mock_session)
|
|
40
40
|
assert sent["command"] == "music/tracks/library_items"
|
|
41
|
-
assert sent["args"] == {"limit": 20, "
|
|
41
|
+
assert sent["args"] == {"limit": 20, "order_by": "random"}
|
|
42
|
+
|
|
43
|
+
def test_named_sort_uses_sort_field(self, client, mock_session):
|
|
44
|
+
_respond(mock_session, [])
|
|
45
|
+
|
|
46
|
+
client.library_items(MediaType.TRACK, sort_field="sort_name")
|
|
47
|
+
|
|
48
|
+
assert _sent(mock_session)["args"] == {"limit": 25, "sort_field": "sort_name"}
|
|
42
49
|
|
|
43
50
|
def test_favorite_albums_with_search(self, client, mock_session):
|
|
44
51
|
_respond(mock_session, [])
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ma_http_client-0.2.0 → ma_http_client-0.2.2}/ma_http_client/skills/music-assistant/SKILL.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|