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:
commit
265cacf3dc
@ -12,7 +12,7 @@ type Settings struct {
|
|||||||
host string `help:"The address of the machine the Transmission daemon is running on"`
|
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"`
|
https bool `help:"Whether or not to connect to the host via HTTPS"`
|
||||||
password string `help:"The password for the Transmission user"`
|
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"`
|
url string `help:"The RPC URI that the daemon is accessible at"`
|
||||||
username string `help:"The username of the Transmission user"`
|
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"),
|
host: ymlConfig.UString("host"),
|
||||||
https: ymlConfig.UBool("https", false),
|
https: ymlConfig.UBool("https", false),
|
||||||
password: ymlConfig.UString("password"),
|
password: ymlConfig.UString("password"),
|
||||||
port: ymlConfig.UInt("port", 9091),
|
port: uint16(ymlConfig.UInt("port", 9091)),
|
||||||
url: ymlConfig.UString("url", "/transmission/"),
|
url: ymlConfig.UString("url", "/transmission/"),
|
||||||
username: ymlConfig.UString("username", ""),
|
username: ymlConfig.UString("username", ""),
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,10 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
widget.KeyboardWidget.SetView(widget.View)
|
widget.KeyboardWidget.SetView(widget.View)
|
||||||
|
|
||||||
// Create a persisten transmission client for use in the calls below
|
// 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 {
|
if err != nil {
|
||||||
client = nil
|
client = nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user