Commit Graph

20 Commits

Author SHA1 Message Date
Yahor Berdnikau b97e09b14b Provide app okhttp client instance to subsonic api client.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-06-24 17:30:38 +02:00
Yahor Berdnikau 8dc9534327 Move api client configuration to separate data class.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-06-24 17:30:38 +02:00
Yahor Berdnikau eb09e9b417 Update Ktlint to 0.20.0 version.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-03-24 19:54:12 +01:00
Yahor Berdnikau 61b92bee39 Update Retrofit to 2.4.0 version.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-03-24 18:57:18 +01:00
Yahor Berdnikau 7830ed3dbf Add flag to force using hex password authentication.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-01-21 18:06:41 +01:00
Yahor Berdnikau 1333534988 Allow to use self-signed certificates.
By default OkHttpClient will not allow self-signed certificates, but
some of app users use them.

This is disabled by default, should be enabled explicitly.

It also allows any CN in self-signed certificate.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-26 12:34:16 +01:00
Yahor Berdnikau 3fddef0ec5 Check call if it supported by current server version.
Add a api wrapper that checks if current protocol version is supported
for this call and fail fast if not.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-10 10:48:41 +01:00
Yahor Berdnikau d384bcc3c5 Update dynamically client version.
Now subsonic api client will update dynamically to the supported server
api version when it doing the requests.
2017-12-02 21:51:26 +01:00
Yahor Berdnikau 6b950f7b28 Extract password param providing in separate interceptors.
Added interceptor for api version before 1.12.0 and after.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-22 21:56:16 +01:00
Yahor Berdnikau 6503ce2e4c Add method to get final stream url.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-21 21:29:24 +01:00
Yahor Berdnikau 52545bc714 Add getAvatar() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-19 21:19:33 +01:00
Yahor Berdnikau 5ea9eb7818 Increase default read timeout to 60 sec.
Default Okhttp read timeout is 10 sec, and as subsonic servers may be
not fast, better to increase timeout.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-14 22:11:03 +01:00
Yahor Berdnikau ba412721ac Add stream call.
Also introduced helper method in SubsonicApiClient that handles error
cases.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-05 22:21:25 +01:00
Yahor Berdnikau 72333f245f Add Range header modifier.
Add interceptor that modifies call "Range" header. It changes header
value to "bytes=value-".
2017-11-05 18:44:31 +01:00
Yahor Berdnikau 48e6788224 Add method to get cover art.
As this call should return byte stream: I've introduced helper method
in client to do the actual call and parse possible json error response.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-10-17 21:48:37 +02:00
Yahor Berdnikau 2d12aea79f Enable setting to not fail parsing on unknown field.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-09-14 21:51:56 +02:00
Yahor Berdnikau 23fd3b03fb Increase API log level to full.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-08-11 20:48:55 +02:00
Yahor Berdnikau 317ccd2ed8 Fix detekt issues.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-07-30 22:23:25 +02:00
Yahor Berdnikau 24b85a1647 Fix base url is not have rest endpoint part.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-07-24 22:35:59 +02:00
Yahor Berdnikau f1ab0a3e0c Add using new authentication method since 1.13.0.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-07-23 20:03:25 +02:00