Skip to content

Commit 6223b71

Browse files
playback progress doesnt actually work
1 parent 6aacf86 commit 6223b71

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

cmd/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ func main() {
7676
r.GET("/health", handlers.ProcessHealthcheckWebhookGin)
7777

7878
// Add plex webhook handler
79-
// TODO: split out non plex specific stuff into a library
8079
r.POST("/plexwebhook", func(c *gin.Context) {
8180
handlers.ProcessWebhook(plexChan, c)
8281
})
@@ -92,11 +91,11 @@ func main() {
9291
r.POST("/save-config", api.SaveConfig)
9392
// TODO: add generic webhook endpoint, maybe mqtt?
9493

95-
// TODO implement signal checking, error chan, etc
9694
/*
9795
###############################
9896
block until workers get ready
9997
############################## */
98+
log.Info("Waiting for workers to be ready...")
10099
<-plexReady
101100
<-minidspReady
102101
<-jfReady

internal/common/webhooks.go

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/iloveicedgreentea/go-plex/models"
99
)
1010

11-
// TODO: test this if not already
1211
func DecodeWebhook(payload []string) (models.PlexWebhookPayload, int, error) {
1312
var pwhPayload models.PlexWebhookPayload
1413

internal/handlers/jellyfin_handler.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ func jfEventRouter(jfClient *jellyfin.JellyfinClient, beqClient *ezbeq.BeqClient
126126
case "PlaybackStop":
127127
jfMediaStop(jfClient, beqClient, haClient, payload, model, false, data, skipActions)
128128
// really annoyingly jellyfin doesnt send a pause or resume event only progress every X seconds with a isPaused flag
129-
// TODO: support pause resume without running resume on every playbackprogress
130-
case "PlaybackProgress":
131-
if payload.IsPaused == "true" {
132-
jfMediaPause(beqClient, haClient, payload, model, skipActions)
133-
} else {
134-
jfMediaResume(jfClient, beqClient, haClient, payload, model, false, data, skipActions)
135-
}
129+
// Jellyfin playback progress is way too buggy to support and makes absolutely no sense anyway
130+
// case "PlaybackProgress":
131+
// if payload.IsPaused == "true" {
132+
// jfMediaPause(beqClient, haClient, payload, model, skipActions)
133+
// } else {
134+
// jfMediaResume(jfClient, beqClient, haClient, payload, model, false, data, skipActions)
135+
// }
136136
default:
137137
log.Warnf("Received unsupported webhook event. Nothing to do: %s", payload.NotificationType)
138138
}

readme.md

+9-14
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
Players Supported:
4141
* Plex
42-
* Jellyfin (experimental)
43-
* Emby (no support or testing)
42+
* Jellyfin (no support given, but tested)
43+
* Emby (may work due to jellyfin support, no support given and not tested)
4444

4545
Main features:
4646
* Load/unload BEQ profiles automatically, without user action and the correct codec detected
@@ -56,18 +56,13 @@ Other cool stuff:
5656
* Dry run and notification modes to verify BEQ profiles without actually loading them
5757
* Built in support for Home Assistant and Minidsp
5858

59-
> ℹ Jellyfin support is coming soon®
60-
61-
62-
This application is primarily focused on Plex and HomeAssistant but I plan on adding support for other sources in the future.
63-
6459
## Setup
6560
> ⚠️ ⚠️ *Warning: You should really set a compressor on your minidsp for safety as outlined in the [BEQ forum post](https://www.avsforum.com/threads/bass-eq-for-filtered-movies.2995212/). I am not responsible for any damage* ⚠️ ⚠️
6661
### Prerequisites
6762
> ℹ It is assumed you have the following tools working. Refer to their respective guides for installation help.
6863
* MQTT Broker (Optional)
6964
* Home Assistant (Optional)
70-
* Plex or Jellyfin (still experimental)
65+
* Plex or Jellyfin
7166
* ezBEQ
7267
* Minidsp (other DSPs may work but I have not tested them. If ezBEQ supports it, it should be work)
7368

@@ -99,11 +94,12 @@ You must use the [official Jellyfin Webhooks plugin](https://github.com/jellyfin
9994
2) Add http://(your-server-ip):9999/jellyfinwebhook as the url
10095
3) Types:
10196
* PlaybackStart
102-
* PlaybackProgress (needed for pause)
10397
* PlaybackStopped
10498
4) You can optionally add a user filter
10599
5) Item types: Movies, Episodes
106100

101+
*note: playbackProgress is not supported because it is way too buggy and unreliable*
102+
107103
Configure the webhook in whatever way you want but it *must* include the following and in this order:
108104

109105
```json
@@ -245,13 +241,10 @@ mode: queued
245241
max: 10
246242
```
247243
248-
249244
### Handlers
250245
`/plexwebhook`
251-
This endpoint is where you should tell Plex to send webhooks to. It automatically processes them. No further action is needed. This handler does most of the work - Loading BEQ, lights, volume, etc
252246

253247
`/jellyfin`
254-
Coming soon
255248

256249
`/minidspwebhook`
257250
This endpoint accepts commands used by minidsp-rs which are performed by EZbeq. Here is how to trigger it with Home Assistant
@@ -281,7 +274,7 @@ One use case is to mute the subs at night. You can use the time integration to t
281274
### Config
282275
The only supported way to configure this is via the web UI. You can dump the current config via the `/config` endpoint.
283276

284-
### Authentication
277+
### Plex Authentication
285278
You must whitelist your server IP in "List of IP addresses and networks that are allowed without auth"
286279

287280
Why? Plex refuses to implement client to server authentication and you must go through their auth servers. I may eventually implement their auth flow but it is not a priority.
@@ -305,10 +298,12 @@ If enabled, it will also send a notification to Home Assistant via Notify so you
305298
For safety, the application tries to unload the profile when it loads up each time in case it crashed or was killed previously, and will unload before playing anything so it doesn't start playing something with the wrong profile.
306299

307300
### Matching
308-
The application will search the catalog and match based on codec (Atmos, DTS-X, etc), title, year, and edition. I have tested with multiple titles and everything matched as expected.
301+
The application will search the catalog and match based on codec (Atmos, DTS-X, etc), title, year, TMDB, and edition. I have tested with multiple titles and everything matched as expected.
309302

310303
> ⚠️ *If you get an incorrect match, please open a github issue with the full log output and expected codec and title*
311304

305+
Jellyfin may have some issues matching as I have found it will sometimes just not return a TMDB. This has nothing to do with me. Jellyfin is generally just quite buggy. There is a configuration option that you should probably enable in the Jellyfin section which lets you skip TMDB matching. It will instead use the title name which could be prone to false negatives.
306+
312307
### Editions
313308

314309
This application will do its best to match editions. It will look for one of the following:

0 commit comments

Comments
 (0)