summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-05-07 12:18:16 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-05-07 12:18:16 +0200
commite7596998032c586bd8baf02ad15c06ed15c67909 (patch)
treeef4b2024355555f7d88f93cbcdf17e184a8bf030
parent5608100cfdb98c127cbf834b6265b7b25dd20bef (diff)
downloadpianobar-e7596998032c586bd8baf02ad15c06ed15c67909.tar.gz
pianobar-e7596998032c586bd8baf02ad15c06ed15c67909.tar.bz2
pianobar-e7596998032c586bd8baf02ad15c06ed15c67909.zip
Configureable RPC host
In case someone wants to use internal-tuner.pandora.com. See #243.
-rw-r--r--contrib/pianobar.13
-rw-r--r--src/main.c2
-rw-r--r--src/settings.c4
-rw-r--r--src/settings.h2
4 files changed, 9 insertions, 2 deletions
diff --git a/contrib/pianobar.1 b/contrib/pianobar.1
index 73953c7..b66f2a9 100644
--- a/contrib/pianobar.1
+++ b/contrib/pianobar.1
@@ -297,6 +297,9 @@ Use a http proxy. Note that this setting overrides the http_proxy environment
variable. Only "Basic" http authentication is supported.
.TP
+.B rpc_host = tuner.pandora.com
+
+.TP
.B sort = {name_az, name_za, quickmix_01_name_az, quickmix_01_name_za, quickmix_10_name_az, quickmix_10_name_za}
Sort station list by name or type (is quickmix) and name. name_az for example
sorts by name from a to z, quickmix_01_name_za by type (quickmix at the
diff --git a/src/main.c b/src/main.c
index b2b0ea5..3e7ac54 100644
--- a/src/main.c
+++ b/src/main.c
@@ -356,7 +356,7 @@ int main (int argc, char **argv) {
}
WaitressInit (&app.waith);
- app.waith.url.host = strdup (PIANO_RPC_HOST);
+ app.waith.url.host = app.settings.rpcHost;
app.waith.tlsFingerprint = app.settings.tlsFingerprint;
/* init fds */
diff --git a/src/settings.c b/src/settings.c
index 19c07f5..0c0d31d 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -93,6 +93,7 @@ void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->npStationFormat);
free (settings->listSongFormat);
free (settings->fifo);
+ free (settings->rpcHost);
free (settings->partnerUser);
free (settings->partnerPassword);
free (settings->device);
@@ -188,6 +189,9 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->username = strdup (val);
} else if (streq ("password", key)) {
settings->password = strdup (val);
+ } else if (streq ("rpc_host", key)) {
+ free (settings->rpcHost);
+ settings->rpcHost = strdup (val);
} else if (streq ("partner_user", key)) {
free (settings->partnerUser);
settings->partnerUser = strdup (val);
diff --git a/src/settings.h b/src/settings.h
index 0624289..ac31653 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -98,7 +98,7 @@ typedef struct {
char *npStationFormat;
char *listSongFormat;
char *fifo;
- char *partnerUser, *partnerPassword, *device, *inkey, *outkey;
+ char *rpcHost, *partnerUser, *partnerPassword, *device, *inkey, *outkey;
char tlsFingerprint[20];
char keys[BAR_KS_COUNT];
BarMsgFormatStr_t msgFormat[MSG_COUNT];