|
|
|
@ -6,6 +6,8 @@ import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"io/ioutil"
|
|
|
|
|
"net/http"
|
|
|
|
|
"path"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"git.ramonr.ch/ramon/mediaconverter/converter"
|
|
|
|
|
"k8s.io/klog"
|
|
|
|
@ -17,14 +19,20 @@ var (
|
|
|
|
|
commit = ""
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const baseDir = "/mnt/data/media/downloads/music/"
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
klog.InitFlags(nil)
|
|
|
|
|
postAddr := flag.String("post-addr", "mediaconverter", "the address where to post the request")
|
|
|
|
|
directory := flag.String("dir", "", "the directory that contains the flac files")
|
|
|
|
|
postAddr := flag.String("post-addr", "http://localhost:8088", "the address where to post the request")
|
|
|
|
|
directory := flag.String("dir", "", "the directory that contains the flac files. If relative path, baseDir will be appendend automatically")
|
|
|
|
|
artistName := flag.String("artist", "", "name of the artist")
|
|
|
|
|
flag.Parse()
|
|
|
|
|
fmt.Printf("Mediaconverter version %v, commit %v\n", version, commit)
|
|
|
|
|
|
|
|
|
|
if !strings.HasPrefix("/", *directory) {
|
|
|
|
|
*directory = path.Join(baseDir, *directory)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
msg, err := converter.CreateMessage(*artistName, *directory)
|
|
|
|
|
if err != nil {
|
|
|
|
|
klog.Fatalf("could not create message: %v", err)
|
|
|
|
|