Big changes

This commit is contained in:
ponzischeme89
2026-07-29 15:26:55 +12:00
parent 70914400b4
commit a265636139
73 changed files with 9593 additions and 0 deletions
@@ -0,0 +1,27 @@
package emby
import (
"net/url"
"testing"
"time"
)
func TestSubtitleURLUsesCanonicalVTTEndpoint(t *testing.T) {
client := New("http://emby:8096", "https://emby.example", "Memby", time.Second)
got := client.SubtitleURL(
Credentials{Token: "a b"},
"item id",
"source/id",
4,
)
parsed, err := url.Parse(got)
if err != nil {
t.Fatal(err)
}
if parsed.EscapedPath() != "/Videos/item%20id/source%2Fid/Subtitles/4/Stream.vtt" {
t.Fatalf("unexpected subtitle path %q", parsed.EscapedPath())
}
if parsed.Query().Get("api_key") != "a b" {
t.Fatalf("subtitle token was not preserved")
}
}