Added DirData field.
This commit is contained in:
parent
77a91c1086
commit
f9b0103471
@ -1,7 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"os"
|
||||||
"reader/internal/config"
|
"reader/internal/config"
|
||||||
logger "reader/internal/log"
|
logger "reader/internal/log"
|
||||||
"reader/internal/metrics"
|
"reader/internal/metrics"
|
||||||
@ -13,6 +15,7 @@ func main() {
|
|||||||
//
|
//
|
||||||
//http.HandleFunc("GET /download", handlers.Download) // example request: {"date": "07-03-2025", "start_time": "16-43", "end_time": "16-44"}
|
//http.HandleFunc("GET /download", handlers.Download) // example request: {"date": "07-03-2025", "start_time": "16-43", "end_time": "16-44"}
|
||||||
//http.HandleFunc("GET /hls/", handlers.HLS)
|
//http.HandleFunc("GET /hls/", handlers.HLS)
|
||||||
|
//http.HandleFunc("GET /vods", handlers.ListVodsHandler)
|
||||||
//
|
//
|
||||||
//log.Println("Starting server on:")
|
//log.Println("Starting server on:")
|
||||||
//log.Printf("Serving on HTTP port: %d\n", port)
|
//log.Printf("Serving on HTTP port: %d\n", port)
|
||||||
@ -22,7 +25,13 @@ func main() {
|
|||||||
go metrics.Metrics()
|
go metrics.Metrics()
|
||||||
logger.StartMainLogger(config.Local, "reader")
|
logger.StartMainLogger(config.Local, "reader")
|
||||||
|
|
||||||
err := unpacker.CreateVideo(config.Local)
|
// Check if the data folder in the directory.
|
||||||
|
homeDir, err := os.UserHomeDir()
|
||||||
|
if err != nil {
|
||||||
|
}
|
||||||
|
config.DirData = fmt.Sprintf("%s/%s/vod", homeDir, config.Local)
|
||||||
|
|
||||||
|
err = unpacker.CreateVideo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Error("Failed to create flow", zap.Error(err))
|
logger.Log.Error("Failed to create flow", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user