feat(subsonic): support timeOffset in stream.view (#384)

as per
https://github.com/opensubsonic/open-subsonic-api/pull/54
https://github.com/opensubsonic/open-subsonic-api/discussions/21

dont cache partial transcodes

add a transcode seek test
This commit is contained in:
Senan Kelly
2023-10-08 17:10:49 +01:00
committed by GitHub
parent 318b62415d
commit 7eaf602e69
4 changed files with 48 additions and 1 deletions

View File

@@ -23,6 +23,11 @@ func NewCachingTranscoder(t Transcoder, cachePath string) *CachingTranscoder {
}
func (t *CachingTranscoder) Transcode(ctx context.Context, profile Profile, in string, out io.Writer) error {
// don't try cache partial transcodes
if profile.Seek() > 0 {
return t.transcoder.Transcode(ctx, profile, in, out)
}
if err := os.MkdirAll(t.cachePath, perm^0o111); err != nil {
return fmt.Errorf("make cache path: %w", err)
}