stash/pkg/models/paths/paths_audio.go
Bob 169bebeaf5 Direct Streams working
- Removed funscripts, they are for interactive
- updated the scanner to correctly create `audio_files` row
- Adding Audio to `paths`
- Updated sqlite to add AudioFile

Need to update mutations next
2026-04-26 20:21:51 -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+".mp3")
}
func (sp *audioPaths) GetStreamPath(audioPath string, checksum string) string {
transcodePath := sp.GetTranscodePath(checksum)
transcodeExists, _ := fsutil.FileExists(transcodePath)
if transcodeExists {
return transcodePath
}
return audioPath
}