Skip to content

Fix start_scan() and get_scan_status()#7

Merged
khers merged 1 commit into
khers:mainfrom
atj:fix-scan-functions
May 13, 2026
Merged

Fix start_scan() and get_scan_status()#7
khers merged 1 commit into
khers:mainfrom
atj:fix-scan-functions

Conversation

@atj
Copy link
Copy Markdown

@atj atj commented Apr 20, 2026

The startScan and getScanStatus endpoints return a subsonic-response with a nested scanStatus element on success.

https://opensubsonic.netlify.app/docs/endpoints/startscan/
https://opensubsonic.netlify.app/docs/endpoints/getscanstatus/

Whilst testing calling startScan on my LMS server I encountered the following error:

Traceback (most recent call last):
  File "/home/atj/dev/opensubsonic/test.py", line 47, in <module>
    conn.start_scan()
    ~~~~~~~~~~~~~~~^^
  File "/home/atj/dev/venv/lib/python3.13/site-packages/libopensonic/_sync/connection.py", line 2064, in start_scan
    return ScanStatus.from_dict(dres['scanstatus'])
                                ~~~~^^^^^^^^^^^^^^
KeyError: 'scanstatus'

Further investigation showed that the response contained a scanStatus element but the code was checking for scanstatus. Here's an example response from LMS:

<Response [200]>
{'openSubsonic': True,
 'scanStatus': {'scanning': False},
 'serverVersion': 'v3.76.0',
 'status': 'ok',
 'type': 'lms',
 'version': '1.16.1'}

The startScan and getScanStatus endpoints return a subsonic-response
with a nested scanStatus element on success.
@khers khers merged commit 2886d86 into khers:main May 13, 2026
1 check passed
@khers
Copy link
Copy Markdown
Owner

khers commented May 13, 2026

Looks good and sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants