-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.go
49 lines (42 loc) · 981 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"fengqi/kodi-metadata-tmdb-cli/config"
"fengqi/kodi-metadata-tmdb-cli/ffmpeg"
"fengqi/kodi-metadata-tmdb-cli/kodi"
"fengqi/kodi-metadata-tmdb-cli/movies"
"fengqi/kodi-metadata-tmdb-cli/music_videos"
"fengqi/kodi-metadata-tmdb-cli/shows"
"fengqi/kodi-metadata-tmdb-cli/tmdb"
"fengqi/kodi-metadata-tmdb-cli/utils"
"flag"
"fmt"
"runtime"
"sync"
)
var (
configFile string
version bool
buildVersion = "dev-master"
)
func init() {
flag.StringVar(&configFile, "config", "./config.json", "config file")
flag.BoolVar(&version, "version", false, "display version")
flag.Parse()
}
func main() {
if version {
fmt.Printf("version: %s, build with: %s\n", buildVersion, runtime.Version())
return
}
config.LoadConfig(configFile)
utils.InitLogger()
tmdb.InitTmdb()
kodi.InitKodi()
ffmpeg.InitFfmpeg()
wg := &sync.WaitGroup{}
wg.Add(3)
go shows.RunCollector()
go movies.RunCollector()
go music_videos.RunCollector()
wg.Wait()
}