aur/pianobar to 2012.05.06-1

This commit is contained in:
Kevin Mihelich 2012-05-06 21:55:03 -04:00
parent 4a5575cb0e
commit 77e0e7481e
2 changed files with 5 additions and 69 deletions

View file

@ -3,25 +3,19 @@
plugrel=1
pkgname=pianobar
pkgver=2012.04.24
pkgrel=2
pkgdesc="console-based frontend for Pandora (official version)"
pkgver=2012.05.06
pkgrel=1
pkgdesc="console-based frontend for Pandora"
url="http://6xq.net/0017"
arch=('i686' 'x86_64')
license=('MIT')
depends=('libao' 'faad2' 'libmad' 'gnutls')
source=(http://6xq.net/media/00/16/pianobar-$pkgver.tar.bz2
protocol-fix.patch)
sha256sums=('1286005b14ef58ea5b7baece054e772761e6351fdeceadd3a69e0a7c8b9bf28e'
'39f30666783d28ccb0bdfe985738bb06c9545e6f0f42e3eba905da2d202de2f7')
source=(http://6xq.net/media/00/16/pianobar-$pkgver.tar.bz2)
sha256sums=('b143882ca50303d560f49567d1a508ca4b48208db4eb8aa67f369fcaae708d7a')
_builddir="$pkgname-$pkgver"
build() {
cd "$_builddir"
# temporary fix from https://gist.github.com/2500616/654f1869da5698696ce60cb8a7fe3cae0f4dfd25
patch -p 1 -i ../protocol-fix.patch
make
}

View file

@ -1,58 +0,0 @@
diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c
index 342e4ec..b70477e 100644
--- a/src/libpiano/piano.c
+++ b/src/libpiano/piano.c
@@ -42,7 +42,7 @@ THE SOFTWARE.
#include "crypt.h"
#include "config.h"
-#define PIANO_PROTOCOL_VERSION "33"
+#define PIANO_PROTOCOL_VERSION "34"
#define PIANO_RPC_HOST "www.pandora.com"
#define PIANO_RPC_PORT "80"
#define PIANO_RPC_PATH "/radio/xmlrpc/v" PIANO_PROTOCOL_VERSION "?"
@@ -272,6 +272,7 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
"<?xml version=\"1.0\"?><methodCall>"
"<methodName>listener.authenticateListener</methodName>"
"<params><param><value><int>%lu</int></value></param>"
+ "<param><value><string></string></value></param>"
/* user */
"<param><value><string>%s</string></value></param>"
/* password */
diff --git a/src/main.c b/src/main.c
index 43f3ffc..9a637cf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -77,10 +77,31 @@ static bool BarMainLoginUser (BarApp_t *app) {
WaitressReturn_t wRet;
PianoRequestDataLogin_t reqData;
bool ret;
+ WaitressHandle_t waithSync;
+ char *syncTime;
+ unsigned long int syncTimeInt;
+
+ /* skip sync step by fetching time from somewhere else */
+ WaitressInit (&waithSync);
+ WaitressSetUrl (&waithSync, "http://ridetheclown.com/s2/synctime.php");
+ if (app->settings.proxy != NULL && strlen (app->settings.proxy) > 0) {
+ WaitressSetProxy (&waithSync, app->settings.proxy);
+ }
+ wRet = WaitressFetchBuf (&waithSync, &syncTime);
+ WaitressFree (&waithSync);
+ if (wRet != WAITRESS_RET_OK) {
+ BarUiMsg (&app->settings, MSG_ERR, "Unable to sync: %s\n",
+ WaitressErrorToStr (wRet));
+ return false;
+ }
+
+ syncTimeInt = strtoul (syncTime, NULL, 0);
+ app->ph.timeOffset = time (NULL) - syncTimeInt;
+ free (syncTime);
reqData.user = app->settings.username;
reqData.password = app->settings.password;
- reqData.step = 0;
+ reqData.step = 1;
BarUiMsg (&app->settings, MSG_INFO, "Login... ");
ret = BarUiPianoCall (app, PIANO_REQUEST_LOGIN, &reqData, &pRet, &wRet);