1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge pull request #569 from Seanstoppable/transmissionport

Use port value for transmission client. Fixes #565
This commit is contained in:
Chris Cummer 2019-08-29 20:46:51 -07:00 committed by GitHub
commit 265cacf3dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -12,7 +12,7 @@ type Settings struct {
host string `help:"The address of the machine the Transmission daemon is running on"`
https bool `help:"Whether or not to connect to the host via HTTPS"`
password string `help:"The password for the Transmission user"`
port int `help:"The port to connect to the Transmission daemon on"`
port uint16 `help:"The port to connect to the Transmission daemon on"`
url string `help:"The RPC URI that the daemon is accessible at"`
username string `help:"The username of the Transmission user"`
}
@ -29,7 +29,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
host: ymlConfig.UString("host"),
https: ymlConfig.UBool("https", false),
password: ymlConfig.UString("password"),
port: ymlConfig.UInt("port", 9091),
port: uint16(ymlConfig.UInt("port", 9091)),
url: ymlConfig.UString("url", "/transmission/"),
username: ymlConfig.UString("username", ""),
}

View File

@ -35,7 +35,10 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
widget.KeyboardWidget.SetView(widget.View)
// Create a persisten transmission client for use in the calls below
client, err := transmissionrpc.New(widget.settings.host, widget.settings.username, widget.settings.password, nil)
client, err := transmissionrpc.New(widget.settings.host, widget.settings.username, widget.settings.password,
&transmissionrpc.AdvancedConfig{
Port: widget.settings.port,
})
if err != nil {
client = nil
}