duration as an int breaks the player
By forcing strings for responses in Ampache i've broken the playlist view and probably a few other things. I've tested this in Ultrasonic but it works okay.
In the API examples it seems to want all values as strings (at least in the xml?) http://www.subsonic.org/pages/inc/api/examples/playlists_example_1.xml
here's a broken example. if i convert duration to an int everything works again.
{
"subsonic-response": {
"status": "ok",
"version": "1.13.0",
"playlists": {
"playlist": [
{
"id": "800002002",
"name": "dewaardradio",
"owner": "System",
"public": false,
"created": "2019-01-03T15:44:05+10:00",
"changed": "2020-10-31T05:13:34+10:00",
"songCount": "15472",
"duration": "3627454"
}
]
}
}
}
the error is in the timedelta call.
2020-11-03 15:50:02,546:ERROR:concurrent.futures:_base:exception calling callback for <Future at 0x7fd13c3c9cd0 state=finished raised CacheMissError>
Traceback (most recent call last):
File "/app/lib/python3.8/site-packages/dataclasses_json/core.py", line 263, in _decode_generic
res = _get_type_cons(type_)(xs)
File "/app/lib/python3.8/site-packages/dataclasses_json/core.py", line 306, in <genexpr>
items = (_decode_dataclass(type_arg, x, infer_missing)
File "/app/lib/python3.8/site-packages/dataclasses_json/core.py", line 187, in _decode_dataclass
init_kwargs[field.name] = overrides[field.name].decoder(
File "/app/lib/python3.8/site-packages/sublime_music/adapters/subsonic/api_objects.py", line 23, in <lambda>
timedelta: (lambda s: timedelta(seconds=s) if s else None),
TypeError: unsupported type for timedelta seconds component: str
It would be good to find something that references the JSON api for subsonic instead of just xml as i don't know what is expected in that format.