mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
- 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
32 lines
647 B
Go
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
|
|
}
|