mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
add open in browser
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/alexflint/go-arg"
|
"github.com/alexflint/go-arg"
|
||||||
|
"github.com/pkg/browser"
|
||||||
"server"
|
"server"
|
||||||
"server/log"
|
"server/log"
|
||||||
"server/settings"
|
"server/settings"
|
||||||
@@ -20,6 +21,7 @@ type args struct {
|
|||||||
LogPath string `arg:"-l" help:"log path"`
|
LogPath string `arg:"-l" help:"log path"`
|
||||||
RDB bool `arg:"-r" help:"start in read-only DB mode"`
|
RDB bool `arg:"-r" help:"start in read-only DB mode"`
|
||||||
DontKill bool `arg:"-k" help:"dont kill program on signal"`
|
DontKill bool `arg:"-k" help:"dont kill program on signal"`
|
||||||
|
UI bool `arg:"-u" help:"run page torrserver in browser"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
@@ -45,6 +47,13 @@ func main() {
|
|||||||
dnsResolve()
|
dnsResolve()
|
||||||
Preconfig(params.DontKill)
|
Preconfig(params.DontKill)
|
||||||
|
|
||||||
|
if params.UI {
|
||||||
|
go func() {
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
browser.OpenURL("http://127.0.0.1:" + params.Port)
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
server.Start(params.Port, params.RDB)
|
server.Start(params.Port, params.RDB)
|
||||||
log.TLogln(server.WaitServer())
|
log.TLogln(server.WaitServer())
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user