Skip to content

Commit 3f1e437

Browse files
committed
fix(plaxt): ignore 0% progress once a session started
1 parent 8bc0cf6 commit 3f1e437

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

handler/plex.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ func (c *PlexClient) syncTimelineWithPlaxt(r *http.Request) {
276276
session := c.sessions[sessionKey]
277277
sessionChanged := false
278278

279+
progress := int(math.Round(float64(viewOffset) / float64(session.metadata.Duration) * 100.0))
280+
if session.status != sessionUnplayed && progress <= 0 {
281+
return
282+
}
283+
279284
serverIdentifier := c.getServerIdentifier()
280285
if serverIdentifier == "" {
281286
return
@@ -311,7 +316,6 @@ func (c *PlexClient) syncTimelineWithPlaxt(r *http.Request) {
311316
}
312317

313318
var event string
314-
progress := int(math.Round(float64(viewOffset) / float64(session.metadata.Duration) * 100.0))
315319
switch state {
316320
case "playing":
317321
if session.status == sessionPlaying {

0 commit comments

Comments
 (0)