jellyfin / jellyfin/jellyfin-apiclient-python

API Token example does not work.

Open
#43 7 comments 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
149
Forks
42
PR merge metrics
No merged PRs in 30d

Description

There is a missing " on this line:
```python
client.authenticate({"Servers": [{"AccessToken: , "address": }]}, discover=False)
```

It should be:
```python
client.authenticate({"Servers": [{"AccessToken": , "address": }]}, discover=False)
```

Although after adding that, there is now an error about missing key `DateLastAccessed`.

```
Traceback (most recent call last):
File "/home/sjorge/anilist-jf-sync/./sync.py", line 29, in
jas = JellyfinAnilistSync(
File "/home/sjorge/anilist-jf-sync/./sync.py", line 25, in __init__
self.client.authenticate({"Servers": [{"AccessToken": api, "address": url}]}, discover=False)
File "/home/sjorge/anilist-jf-sync/venv/lib/python3.10/site-packages/jellyfin_apiclient_python/client.py", line 55, in authenticate
state = self.auth.connect(options or {}, discover)
File "/home/sjorge/anilist-jf-sync/venv/lib/python3.10/site-packages/jellyfin_apiclient_python/connection_manager.py", line 197, in connect
servers = self.get_available_servers(discover)
File "/home/sjorge/anilist-jf-sync/venv/lib/python3.10/site-packages/jellyfin_apiclient_python/connection_manager.py", line 88, in get_available_servers
servers.sort(key=itemgetter('DateLastAccessed'), reverse=True)
KeyError: 'DateLastAccessed'
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the API-token authentication example and inspect connection_manager.py, especially get_available_servers where the traceback reports the DateLastAccessed sort. Confirm the corrected example no longer raises the KeyError, and add or update a focused regression test if the repository contains coverage for authentication or server discovery.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.