mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-16 15:08:17 +08:00
43 lines
927 B
Go
43 lines
927 B
Go
package main
|
|
|
|
import (
|
|
"AynaLivePlayer/config"
|
|
"AynaLivePlayer/controller"
|
|
"AynaLivePlayer/gui"
|
|
"AynaLivePlayer/logger"
|
|
"AynaLivePlayer/plugin/diange"
|
|
"AynaLivePlayer/plugin/qiege"
|
|
"AynaLivePlayer/plugin/textinfo"
|
|
"AynaLivePlayer/plugin/webinfo"
|
|
"fmt"
|
|
"github.com/mitchellh/panicwrap"
|
|
"os"
|
|
)
|
|
|
|
func init() {
|
|
exitStatus, _ := panicwrap.BasicWrap(func(s string) {
|
|
logger.Logger.Panic(s)
|
|
os.Exit(1)
|
|
return
|
|
})
|
|
if exitStatus >= 0 {
|
|
os.Exit(exitStatus)
|
|
}
|
|
}
|
|
|
|
var plugins = []controller.Plugin{diange.NewDiange(), qiege.NewQiege(), textinfo.NewTextInfo(), webinfo.NewWebInfo()}
|
|
|
|
func main() {
|
|
fmt.Printf("BiliAudioBot Revive %s\n", config.VERSION)
|
|
controller.Initialize()
|
|
controller.LoadPlugins(plugins...)
|
|
defer func() {
|
|
controller.Destroy()
|
|
config.SaveToConfigFile(config.CONFIG_PATH)
|
|
//i18n.SaveTranslation()
|
|
}()
|
|
gui.Initialize()
|
|
gui.MainWindow.ShowAndRun()
|
|
controller.ClosePlugins(plugins...)
|
|
}
|