-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Refactor Jellyfin source to use Jellyfin API #172
Conversation
* Implement new jellyfin source using JF typescript api client library for communication * Use either API Key or username/password * Implement real-time scrobble monitoring * Implement feature parity filters from old jellyfin source (users) and add devices filters * Refactor documentation for new configuration with api and add migration steps for webhook users * Add deprecation warning to jellyfin webhook source
Offline played track events from Symfonium (#87) manifest in JF as:
Unfortunately, the openapi spec/sdk does not have a good way to get all change events for all sessions in a way that is helpful because the offline events are registered in an "instantaneous" session by the client (android symfonium) IE the client connects to send change data and then disconnects -- if we are only using API polling its possible (probable) we will entirely miss the session being active unless polling interval is extremely short. There is another solution: the websockets system bubbles all session data a user has access to which includes these short lived sessions. The data recieved is what I need: {
"MessageId": "8e5e58bb1a104683b2bf1232d6955dbf",
"Data": {
"UserId": "1ae8a43ed293456da28274f1a89cd2a5",
"UserDataList": [
{
"PlaybackPositionTicks": 0,
"PlayCount": 1,
"IsFavorite": false,
"LastPlayedDate": "2024-08-29T17:00:19.9369451Z",
"Played": true,
"Key": "Ana Tijoux-1977-0001-0005Obst\u00E1culo",
"ItemId": "097bd1f3c949da7e0b7d4a0f52bae481"
},
{
"PlaybackPositionTicks": 0,
"PlayCount": 0,
"IsFavorite": false,
"Played": false,
"Key": "39f26414-6687-7c9b-adac-f506b347cb15",
"ItemId": "39f2641466877c9badacf506b347cb15"
}
]
},
"MessageType": "UserDataChanged"
} More unfortunately, the JS sdk does not have a websocket api yet and the JF devs confirmed for me on matrix that the WS protocol is undocumented. I'll need to dig through the JF web client to figure out exactly what is going on. Sidebar: The two EDIT: Nope doesn't work. Even though the data from offline client (symfonium) is pushed by WS the Additionally, and inconveniently, the WS data for sessions is only available if the authentication is done using a username/password so its not available to API authentication. At this point I'm giving up on offline scrobbling because JF just doesn't surface the right info through its API and its impossible to coax it out. It may be stored/sent correctly (see all discussion in #87) but its not retrievable and might as well not exist. |
Use docker image Migrating from Webhook (multi-scrobbler below v0.9.0) to APIIn multi-scrobbler below v0.9.0 communication with Jellyfin was done using Jellyfin's Webhook plugin. To Migrate
New Jellyfin (API) SourceMust be using Jellyfin 10.7 or greater
It is recommended to use API Key + username but if you are not an admin for your Jellyfin instance you can also authenticate with your Jellyfin username and password. File-Config[
{
"name": "MyJellyfin",
"enable": true,
"clients": [],
"data": {
"url": "http://localhost:8096",
"user": "FoxxMD",
//either this
"password": "mypass"
// or this
"apiKey": "c9fa0875pfbf411ebb9c55b56bd6540c",
// optional
"usersAllowed": ["FoxxMD","SomeOtherUser"],
"usersBlocked": ["AnotherUser"],
"devicesAllowed": ["firefox"],
"devicesBlocked": ["google-home"]
},
"options": {
"logFilterFailure": "debug"
}
}
] ENV-Config
|
📦 A new release has been made for this pull request.To play around with this PR, pull an image:
Images are available for x86_64 and ARM64.
|
Edit: Nevermind my error in the original message. I had a typo in my jellyfin url. Now it works like a charm. Thanks for the work and fixing the old issue. Really appreciate it! I will leave the original message in, in case someone else has a typo in their url :D. Best, Hi @FoxxMD I am trying to test this new api connection. I get the following error:
My url is not with http but https (running it through a tailscale funnel). Could that be the problem? |
Checklist before requesting a review
develop
branch and NOTmaster
.Type of change
Describe your changes
#171