Commit Graph

100 Commits

Author SHA1 Message Date
Óscar García Amor 871082aea3 Madsonic v 5.1.xxx fix (#145)
* Fixes #129

Signed-off-by: Óscar García Amor <ogarcia@connectical.com>
2018-01-23 21:07:12 +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 0b5cc5d3f3 Make subsonic error parser more fail safe.
Now it should parse more malformed error json, though having "code" field is still mandatory.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-01-20 10:56:58 +01:00
Yahor Berdnikau fff0762e08 Add more test for error responses.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-01-13 10:54:30 +01:00
Yahor Berdnikau 3e1dbe3476 Fix api error parses always in generic error.
Now it parses to right error representation. Also fix that right
exception for error is not thrown on api call.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-01-13 10:19:42 +01:00
Yahor Berdnikau ada94dc24f Change to handle json parse exception instead of xml.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2018-01-07 13:30:37 +01:00
Yahor Berdnikau 70c2e5213c Fix checkstyle problem.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-27 22:28:36 +01:00
Yahor Berdnikau c9bc3df543 Merge branch 'master' into develop 2017-12-27 22:01:10 +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 07802e9206 Update KtLint to 0.14.0 version.
Also fix style problems.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-21 10:58:43 +01:00
Yahor Berdnikau b2384a43ce Update api definition to use String type for ids.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 22:14:01 +01:00
Yahor Berdnikau 5bf5af2842 Change MusicDirectoryChild ids type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 21:28:18 +01:00
Yahor Berdnikau ad20064d79 Change Share id type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 20:54:43 +01:00
Yahor Berdnikau 9cb6a5c4e9 Change PodcastChannel id type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 20:51:07 +01:00
Yahor Berdnikau 434d07c4a3 Change Playlist id type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 20:47:00 +01:00
Yahor Berdnikau e62e5c553c Change MusicDirectory ids type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 20:43:39 +01:00
Yahor Berdnikau f2d838cb1c Change album ids type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 20:10:25 +01:00
Yahor Berdnikau a694f895e9 Change artist id type to String.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-16 19:50:57 +01:00
Yahor Berdnikau 66d7973c5a Replace type of id property to String.
Some api implementations are using UUID string for ids.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-12 21:08:49 +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 336f505ba5 Replace ServerTooOldException with more proper ApiNotSupportedException. 2017-12-03 14:14:01 +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 e838750ee2 Add proxy password interceptor.
It passes request chain either to hex password interceptor or
to md5+salt interceptor depending on current protocol version.
2017-12-02 21:51:26 +01:00
Yahor Berdnikau 0c5ac61402 Add 1.16.0 subsonic version. 2017-12-02 21:51:26 +01:00
Yahor Berdnikau c76d25e1ba Add version interceptor.
This interceptor add version param to request and peeks into response
to parse server version.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-02 21:51:26 +01:00
Yahor Berdnikau 1c56d6459b Fix subsonic accepts only lowercase md5 password hash.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-12-02 11:48:23 +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 22ec570b69 Add updateShare() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-19 15:25:31 +01:00
Yahor Berdnikau a1d5450515 Add deleteShare() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-19 14:36:41 +01:00
Yahor Berdnikau d26b6dce7d Add getVideos() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-19 13:51:20 +01:00
Yahor Berdnikau ca2ffc7279 Add deleteBookmark() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-18 22:14:48 +01:00
Yahor Berdnikau 010d7679b9 Add createBookmark() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-18 21:55:07 +01:00
Yahor Berdnikau 0cc0bbedaf Add getBookmarks() api call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-18 21:33:02 +01:00
Yahor Berdnikau c618538b14 Add addChatMessage() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-16 22:18:13 +01:00
Yahor Berdnikau c917bcb1a6 Update ktlint to 0.12.1 version.
Also updated ktlint-gradle to 2.3.0 version. Added ktlint reports to
circle CI.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-16 22:04:38 +01:00
Yahor Berdnikau 9cecebb314 Add getChatMessages() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-16 21:19:24 +01:00
Yahor Berdnikau 6b74a3e563 Add getUser api call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-14 22:46:51 +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 10e25e8597 Add getSongsByGenre api call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-14 21:57:28 +01:00
Yahor Berdnikau 1502c4c9c8 Add getGenres app call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-12 00:00:11 +01:00
Yahor Berdnikau 1012e41620 Add createShare api call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-11 20:31:20 +01:00
Yahor Berdnikau d5cdc18174 Add getShares call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-10 21:15:36 +01:00
Yahor Berdnikau 947a1ce3b5 Add jukebox control call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-11-07 21:26:44 +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 c8c8766b55 Increase read timeout.
When range interceptor modifies request it also increases read timeout,
that allows server to do transcoding of the response and skip bytes
to offset value.

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 f85759eb58 Add getStarred2() call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
2017-09-16 22:57:39 +02:00