stash/pkg/models/paths/paths_audio.go
2026-04-25 01:09:30 -07:00

32 lines
647 B
Go

// TODO(audio): update this file
package paths
import (
"path/filepath"
"github.com/stashapp/stash/pkg/fsutil"
)
type audioPaths struct {
generatedPaths
}
func newAudioPaths(p Paths) *audioPaths {
sp := audioPaths{
generatedPaths: *p.Generated,
}
return &sp
}
func (sp *audioPaths) GetTranscodePath(checksum string) string {
return filepath.Join(sp.Transcodes, checksum+".mp4")
}
func (sp *audioPaths) GetStreamPath(audioPath string, checksum string) string {
transcodePath := sp.GetTranscodePath(checksum)
transcodeExists, _ := fsutil.FileExists(transcodePath)
if transcodeExists {
return transcodePath
}
return audioPath
}