tryffel / jellycli

Jellyfin terminal client
GNU General Public License v3.0
206 stars 8 forks source link

Send correct PlaybackStoppedInfo in ReportProgress #26

Closed vrutkovs closed 2 years ago

vrutkovs commented 2 years ago

This fixes a warning about invalid data sent to /Sessions/Playing/Stopped on stop (or playback start):

[19:17:38.425] DEBUG received play event: PlayNow
[19:17:38.425]  INFO Stop audio
[19:17:38.425] ERROR stop: audio stream completed but streamer is nil
[19:17:38.433] DEBUG POST /Sessions/Playing/Stopped: 400 (6 ms)
[19:17:38.434] DEBUG Progress event: stop
[19:17:38.434] ERROR report audio progress to server: push progress: invalid request, code: 400, msg: {"type":"https://tools.ietf.org/html/rfc7231#section-6.5.1","title":"One or more validation errors occurred.","status":400,"traceId":"00-6b53a9318cdd8946b546c78f0913adb8-1d7f1ba299a90546-00","errors":{"":["The supplied value is invalid."],"playbackStopInfo":["The playbackStopInfo field is required."]}}
vrutkovs commented 2 years ago

Server now accepts this, but still not happy about the contents:

Jellyfin.Server.Implementations.Events.Consumers.Session.PlaybackStopLogger: PlaybackStopped reported with null media info.

Investigating

vrutkovs commented 2 years ago

Latest commit should have fixed it. We still get a warning on first play (as we're sending Stop with empty data), but other than that it works perfectly