mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 01:26:43 +08:00
maintain (path): absolute path
getting things ready to have config coming as a plugin to handle various distributions
This commit is contained in:
@ -12,7 +12,6 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -78,7 +77,7 @@ func init() {
|
||||
return
|
||||
}
|
||||
|
||||
cachePath := filepath.Join(GetCurrentDir(), VideoCachePath)
|
||||
cachePath := GetAbsolutePath(VideoCachePath)
|
||||
os.RemoveAll(cachePath)
|
||||
os.MkdirAll(cachePath, os.ModePerm)
|
||||
|
||||
@ -124,8 +123,7 @@ func hls_playlist(reader io.ReadCloser, ctx *App, res *http.ResponseWriter, req
|
||||
}
|
||||
|
||||
cacheName := "vid_" + GenerateID(ctx) + "_" + QuickHash(path, 10) + ".dat"
|
||||
cachePath := filepath.Join(
|
||||
GetCurrentDir(),
|
||||
cachePath := GetAbsolutePath(
|
||||
VideoCachePath,
|
||||
cacheName,
|
||||
)
|
||||
@ -172,8 +170,7 @@ func hls_transcode(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
startTime := segmentNumber * HLS_SEGMENT_LENGTH
|
||||
cachePath := filepath.Join(
|
||||
GetCurrentDir(),
|
||||
cachePath := GetAbsolutePath(
|
||||
VideoCachePath,
|
||||
req.URL.Query().Get("path"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user