mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
- Switched from subsonic-response in xml to response in json
- Retrofitting of all Subsonic models
This commit is contained in:
parent
ca15f51c85
commit
521c51b17e
85 changed files with 682 additions and 898 deletions
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class AlbumSongListClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -29,44 +31,44 @@ public class AlbumSongListClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.albumSongListService = retrofit.create(AlbumSongListService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumList(String type, int size, int offset) {
|
||||
public Call<ApiResponse> getAlbumList(String type, int size, int offset) {
|
||||
Log.d(TAG, "getAlbumList()");
|
||||
return albumSongListService.getAlbumList(subsonic.getParams(), type, size, offset);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumList2(String type, int size, int offset, Integer fromYear, Integer toYear) {
|
||||
public Call<ApiResponse> getAlbumList2(String type, int size, int offset, Integer fromYear, Integer toYear) {
|
||||
Log.d(TAG, "getAlbumList2()");
|
||||
return albumSongListService.getAlbumList2(subsonic.getParams(), type, size, offset, fromYear, toYear);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getRandomSongs(int size, Integer fromYear, Integer toYear) {
|
||||
public Call<ApiResponse> getRandomSongs(int size, Integer fromYear, Integer toYear) {
|
||||
Log.d(TAG, "getRandomSongs()");
|
||||
return albumSongListService.getRandomSongs(subsonic.getParams(), size, fromYear, toYear);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getSongsByGenre(String genre, int count, int offset) {
|
||||
public Call<ApiResponse> getSongsByGenre(String genre, int count, int offset) {
|
||||
Log.d(TAG, "getSongsByGenre()");
|
||||
return albumSongListService.getSongsByGenre(subsonic.getParams(), genre, count, offset);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getNowPlaying() {
|
||||
public Call<ApiResponse> getNowPlaying() {
|
||||
Log.d(TAG, "getNowPlaying()");
|
||||
return albumSongListService.getNowPlaying(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getStarred() {
|
||||
public Call<ApiResponse> getStarred() {
|
||||
Log.d(TAG, "getStarred()");
|
||||
return albumSongListService.getStarred(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getStarred2() {
|
||||
public Call<ApiResponse> getStarred2() {
|
||||
Log.d(TAG, "getStarred2()");
|
||||
return albumSongListService.getStarred2(subsonic.getParams());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.albumsonglist;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,23 +12,23 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface AlbumSongListService {
|
||||
@GET("getAlbumList")
|
||||
Call<SubsonicResponse> getAlbumList(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset);
|
||||
Call<ApiResponse> getAlbumList(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset);
|
||||
|
||||
@GET("getAlbumList2")
|
||||
Call<SubsonicResponse> getAlbumList2(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset, @Query("fromYear") Integer fromYear, @Query("toYear") Integer toYear);
|
||||
Call<ApiResponse> getAlbumList2(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset, @Query("fromYear") Integer fromYear, @Query("toYear") Integer toYear);
|
||||
|
||||
@GET("getRandomSongs")
|
||||
Call<SubsonicResponse> getRandomSongs(@QueryMap Map<String, String> params, @Query("size") int size, @Query("fromYear") Integer fromYear, @Query("toYear") Integer toYear);
|
||||
Call<ApiResponse> getRandomSongs(@QueryMap Map<String, String> params, @Query("size") int size, @Query("fromYear") Integer fromYear, @Query("toYear") Integer toYear);
|
||||
|
||||
@GET("getSongsByGenre")
|
||||
Call<SubsonicResponse> getSongsByGenre(@QueryMap Map<String, String> params, @Query("genre") String genre, @Query("count") int count, @Query("offset") int offset);
|
||||
Call<ApiResponse> getSongsByGenre(@QueryMap Map<String, String> params, @Query("genre") String genre, @Query("count") int count, @Query("offset") int offset);
|
||||
|
||||
@GET("getNowPlaying")
|
||||
Call<SubsonicResponse> getNowPlaying(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getNowPlaying(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getStarred")
|
||||
Call<SubsonicResponse> getStarred(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getStarred(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getStarred2")
|
||||
Call<SubsonicResponse> getStarred2(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getStarred2(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class BrowsingClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -29,94 +31,94 @@ public class BrowsingClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.browsingService = retrofit.create(BrowsingService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getMusicFolders() {
|
||||
public Call<ApiResponse> getMusicFolders() {
|
||||
Log.d(TAG, "getMusicFolders()");
|
||||
return browsingService.getMusicFolders(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getIndexes() {
|
||||
public Call<ApiResponse> getIndexes() {
|
||||
Log.d(TAG, "getIndexes()");
|
||||
return browsingService.getIndexes(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getMusicDirectory(String id) {
|
||||
public Call<ApiResponse> getMusicDirectory(String id) {
|
||||
Log.d(TAG, "getMusicDirectory()");
|
||||
return browsingService.getMusicDirectory(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getGenres() {
|
||||
public Call<ApiResponse> getGenres() {
|
||||
Log.d(TAG, "getGenres()");
|
||||
return browsingService.getGenres(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getArtists() {
|
||||
public Call<ApiResponse> getArtists() {
|
||||
Log.d(TAG, "getArtists()");
|
||||
return browsingService.getArtists(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getArtist(String id) {
|
||||
public Call<ApiResponse> getArtist(String id) {
|
||||
Log.d(TAG, "getArtist()");
|
||||
return browsingService.getArtist(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbum(String id) {
|
||||
public Call<ApiResponse> getAlbum(String id) {
|
||||
Log.d(TAG, "getAlbum()");
|
||||
return browsingService.getAlbum(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getSong(String id) {
|
||||
public Call<ApiResponse> getSong(String id) {
|
||||
Log.d(TAG, "getSong()");
|
||||
return browsingService.getSong(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getVideos() {
|
||||
public Call<ApiResponse> getVideos() {
|
||||
Log.d(TAG, "getVideos()");
|
||||
return browsingService.getVideos(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getVideoInfo(String id) {
|
||||
public Call<ApiResponse> getVideoInfo(String id) {
|
||||
Log.d(TAG, "getVideoInfo()");
|
||||
return browsingService.getVideoInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getArtistInfo(String id) {
|
||||
public Call<ApiResponse> getArtistInfo(String id) {
|
||||
Log.d(TAG, "getArtistInfo()");
|
||||
return browsingService.getArtistInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getArtistInfo2(String id) {
|
||||
public Call<ApiResponse> getArtistInfo2(String id) {
|
||||
Log.d(TAG, "getArtistInfo2()");
|
||||
return browsingService.getArtistInfo2(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumInfo(String id) {
|
||||
public Call<ApiResponse> getAlbumInfo(String id) {
|
||||
Log.d(TAG, "getAlbumInfo()");
|
||||
return browsingService.getAlbumInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumInfo2(String id) {
|
||||
public Call<ApiResponse> getAlbumInfo2(String id) {
|
||||
Log.d(TAG, "getAlbumInfo2()");
|
||||
return browsingService.getAlbumInfo2(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getSimilarSongs(String id, int count) {
|
||||
public Call<ApiResponse> getSimilarSongs(String id, int count) {
|
||||
Log.d(TAG, "getSimilarSongs()");
|
||||
return browsingService.getSimilarSongs(subsonic.getParams(), id, count);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getSimilarSongs2(String id, int limit) {
|
||||
public Call<ApiResponse> getSimilarSongs2(String id, int limit) {
|
||||
Log.d(TAG, "getSimilarSongs2()");
|
||||
return browsingService.getSimilarSongs2(subsonic.getParams(), id, limit);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getTopSongs(String artist, int count) {
|
||||
public Call<ApiResponse> getTopSongs(String artist, int count) {
|
||||
Log.d(TAG, "getTopSongs()");
|
||||
return browsingService.getTopSongs(subsonic.getParams(), artist, count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.browsing;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,53 +12,53 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface BrowsingService {
|
||||
@GET("getMusicFolders")
|
||||
Call<SubsonicResponse> getMusicFolders(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getMusicFolders(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getIndexes")
|
||||
Call<SubsonicResponse> getIndexes(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getIndexes(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getMusicDirectory")
|
||||
Call<SubsonicResponse> getMusicDirectory(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getMusicDirectory(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getGenres")
|
||||
Call<SubsonicResponse> getGenres(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getGenres(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getArtists")
|
||||
Call<SubsonicResponse> getArtists(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getArtists(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getArtist")
|
||||
Call<SubsonicResponse> getArtist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getArtist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbum")
|
||||
Call<SubsonicResponse> getAlbum(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getAlbum(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSong")
|
||||
Call<SubsonicResponse> getSong(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getSong(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getVideos")
|
||||
Call<SubsonicResponse> getVideos(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getVideos(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getVideoInfo")
|
||||
Call<SubsonicResponse> getVideoInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getVideoInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo")
|
||||
Call<SubsonicResponse> getArtistInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getArtistInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo2")
|
||||
Call<SubsonicResponse> getArtistInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getArtistInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo")
|
||||
Call<SubsonicResponse> getAlbumInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getAlbumInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo2")
|
||||
Call<SubsonicResponse> getAlbumInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getAlbumInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSimilarSongs")
|
||||
Call<SubsonicResponse> getSimilarSongs(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
Call<ApiResponse> getSimilarSongs(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getSimilarSongs2")
|
||||
Call<SubsonicResponse> getSimilarSongs2(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
Call<ApiResponse> getSimilarSongs2(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getTopSongs")
|
||||
Call<SubsonicResponse> getTopSongs(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("count") int count);
|
||||
Call<ApiResponse> getTopSongs(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("count") int count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class MediaAnnotationClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -29,29 +31,29 @@ public class MediaAnnotationClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.mediaAnnotationService = retrofit.create(MediaAnnotationService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> star(String id, String albumId, String artistId) {
|
||||
public Call<ApiResponse> star(String id, String albumId, String artistId) {
|
||||
Log.d(TAG, "star()");
|
||||
return mediaAnnotationService.star(subsonic.getParams(), id, albumId, artistId);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> unstar(String id, String albumId, String artistId) {
|
||||
public Call<ApiResponse> unstar(String id, String albumId, String artistId) {
|
||||
Log.d(TAG, "unstar()");
|
||||
return mediaAnnotationService.unstar(subsonic.getParams(), id, albumId, artistId);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> setRating(String id, int rating) {
|
||||
public Call<ApiResponse> setRating(String id, int rating) {
|
||||
Log.d(TAG, "setRating()");
|
||||
return mediaAnnotationService.setRating(subsonic.getParams(), id, rating);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> scrobble(String id) {
|
||||
public Call<ApiResponse> scrobble(String id) {
|
||||
Log.d(TAG, "scrobble()");
|
||||
return mediaAnnotationService.scrobble(subsonic.getParams(), id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.mediaannotation;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,14 +12,14 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface MediaAnnotationService {
|
||||
@GET("star")
|
||||
Call<SubsonicResponse> star(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
Call<ApiResponse> star(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
|
||||
@GET("unstar")
|
||||
Call<SubsonicResponse> unstar(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
Call<ApiResponse> unstar(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
|
||||
@GET("setRating")
|
||||
Call<SubsonicResponse> setRating(@QueryMap Map<String, String> params, @Query("id") String id, @Query("rating") int rating);
|
||||
Call<ApiResponse> setRating(@QueryMap Map<String, String> params, @Query("id") String id, @Query("rating") int rating);
|
||||
|
||||
@GET("scrobble")
|
||||
Call<SubsonicResponse> scrobble(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> scrobble(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class MediaLibraryScanningClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
|
@ -29,19 +31,19 @@ public class MediaLibraryScanningClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.mediaLibraryScanningService = retrofit.create(MediaLibraryScanningService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> startScan() {
|
||||
public Call<ApiResponse> startScan() {
|
||||
Log.d(TAG, "startScan()");
|
||||
return mediaLibraryScanningService.startScan(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getScanStatus() {
|
||||
public Call<ApiResponse> getScanStatus() {
|
||||
Log.d(TAG, "getScanStatus()");
|
||||
return mediaLibraryScanningService.getScanStatus(subsonic.getParams());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.medialibraryscanning;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface MediaLibraryScanningService {
|
||||
@GET("startScan")
|
||||
Call<SubsonicResponse> startScan(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> startScan(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getScanStatus")
|
||||
Call<SubsonicResponse> getScanStatus(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getScanStatus(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class MediaRetrievalClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -29,24 +31,24 @@ public class MediaRetrievalClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.mediaRetrievalService = retrofit.create(MediaRetrievalService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> stream(String id, Integer maxBitRate, String format) {
|
||||
public Call<ApiResponse> stream(String id, Integer maxBitRate, String format) {
|
||||
Log.d(TAG, "stream()");
|
||||
return mediaRetrievalService.stream(subsonic.getParams(), id, maxBitRate, format);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> download(String id) {
|
||||
public Call<ApiResponse> download(String id) {
|
||||
Log.d(TAG, "download()");
|
||||
return mediaRetrievalService.download(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getLyrics(String artist, String title) {
|
||||
public Call<ApiResponse> getLyrics(String artist, String title) {
|
||||
Log.d(TAG, "getLyrics()");
|
||||
return mediaRetrievalService.getLyrics(subsonic.getParams(), artist, title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.mediaretrieval;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,11 +12,11 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface MediaRetrievalService {
|
||||
@GET("stream")
|
||||
Call<SubsonicResponse> stream(@QueryMap Map<String, String> params, @Query("id") String id, @Query("maxBitRate") Integer maxBitRate, @Query("format") String format);
|
||||
Call<ApiResponse> stream(@QueryMap Map<String, String> params, @Query("id") String id, @Query("maxBitRate") Integer maxBitRate, @Query("format") String format);
|
||||
|
||||
@GET("download")
|
||||
Call<SubsonicResponse> download(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> download(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getLyrics")
|
||||
Call<SubsonicResponse> getLyrics(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("title") String title);
|
||||
Call<ApiResponse> getLyrics(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("title") String title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
@ -16,6 +17,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class PlaylistClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -30,34 +32,34 @@ public class PlaylistClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.playlistService = retrofit.create(PlaylistService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getPlaylists() {
|
||||
public Call<ApiResponse> getPlaylists() {
|
||||
Log.d(TAG, "getPlaylists()");
|
||||
return playlistService.getPlaylists(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getPlaylist(String id) {
|
||||
public Call<ApiResponse> getPlaylist(String id) {
|
||||
Log.d(TAG, "getPlaylist()");
|
||||
return playlistService.getPlaylist(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> createPlaylist(String playlistId, String name, ArrayList<String> songsId) {
|
||||
public Call<ApiResponse> createPlaylist(String playlistId, String name, ArrayList<String> songsId) {
|
||||
Log.d(TAG, "createPlaylist()");
|
||||
return playlistService.createPlaylist(subsonic.getParams(), playlistId, name, songsId);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> updatePlaylist(String playlistId, String name, boolean isPublic, ArrayList<String> songIdToAdd, ArrayList<Integer> songIndexToRemove) {
|
||||
public Call<ApiResponse> updatePlaylist(String playlistId, String name, boolean isPublic, ArrayList<String> songIdToAdd, ArrayList<Integer> songIndexToRemove) {
|
||||
Log.d(TAG, "updatePlaylist()");
|
||||
return playlistService.updatePlaylist(subsonic.getParams(), playlistId, name, isPublic, songIdToAdd, songIndexToRemove);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> deletePlaylist(String id) {
|
||||
public Call<ApiResponse> deletePlaylist(String id) {
|
||||
Log.d(TAG, "deletePlaylist()");
|
||||
return playlistService.deletePlaylist(subsonic.getParams(), id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.playlist;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -12,17 +13,17 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface PlaylistService {
|
||||
@GET("getPlaylists")
|
||||
Call<SubsonicResponse> getPlaylists(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getPlaylists(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getPlaylist")
|
||||
Call<SubsonicResponse> getPlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> getPlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("createPlaylist")
|
||||
Call<SubsonicResponse> createPlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("songId") ArrayList<String> songsId);
|
||||
Call<ApiResponse> createPlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("songId") ArrayList<String> songsId);
|
||||
|
||||
@GET("updatePlaylist")
|
||||
Call<SubsonicResponse> updatePlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("public") boolean isPublic, @Query("songIdToAdd") ArrayList<String> songIdToAdd, @Query("songIndexToRemove") ArrayList<Integer> songIndexToRemove);
|
||||
Call<ApiResponse> updatePlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("public") boolean isPublic, @Query("songIdToAdd") ArrayList<String> songIdToAdd, @Query("songIndexToRemove") ArrayList<Integer> songIndexToRemove);
|
||||
|
||||
@GET("deletePlaylist")
|
||||
Call<SubsonicResponse> deletePlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
Call<ApiResponse> deletePlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class PodcastClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
|
@ -29,27 +31,28 @@ public class PodcastClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.podcastService = retrofit.create(PodcastService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getPodcasts(boolean includeEpisodes, String channelId) {
|
||||
public Call<ApiResponse> getPodcasts(boolean includeEpisodes, String channelId) {
|
||||
Log.d(TAG, "getPodcasts()");
|
||||
return podcastService.getPodcasts(subsonic.getParams(), includeEpisodes, channelId);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getNewestPodcasts(int count) {
|
||||
public Call<ApiResponse> getNewestPodcasts(int count) {
|
||||
Log.d(TAG, "getNewestPodcasts()");
|
||||
return podcastService.getNewestPodcasts(subsonic.getParams(), count);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> refreshPodcasts() {
|
||||
public Call<ApiResponse> refreshPodcasts() {
|
||||
Log.d(TAG, "refreshPodcasts()");
|
||||
return podcastService.refreshPodcasts(subsonic.getParams());
|
||||
}
|
||||
|
||||
private OkHttpClient getOkHttpClient() {
|
||||
CacheUtil cacheUtil = new CacheUtil(context, 60, 60 * 60 * 24 * 30);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.podcast;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,11 +12,11 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface PodcastService {
|
||||
@GET("getPodcasts")
|
||||
Call<SubsonicResponse> getPodcasts(@QueryMap Map<String, String> params, @Query("includeEpisodes") boolean includeEpisodes, @Query("id") String id);
|
||||
Call<ApiResponse> getPodcasts(@QueryMap Map<String, String> params, @Query("includeEpisodes") boolean includeEpisodes, @Query("id") String id);
|
||||
|
||||
@GET("getNewestPodcasts")
|
||||
Call<SubsonicResponse> getNewestPodcasts(@QueryMap Map<String, String> params, @Query("count") int count);
|
||||
Call<ApiResponse> getNewestPodcasts(@QueryMap Map<String, String> params, @Query("count") int count);
|
||||
|
||||
@GET("refreshPodcasts")
|
||||
Call<SubsonicResponse> refreshPodcasts(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> refreshPodcasts(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class SearchingClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
|
@ -29,19 +31,19 @@ public class SearchingClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.searchingService = retrofit.create(SearchingService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> search2(String query, int songCount, int albumCount, int artistCount) {
|
||||
public Call<ApiResponse> search2(String query, int songCount, int albumCount, int artistCount) {
|
||||
Log.d(TAG, "search2()");
|
||||
return searchingService.search2(subsonic.getParams(), query, songCount, albumCount, artistCount);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> search3(String query, int songCount, int albumCount, int artistCount) {
|
||||
public Call<ApiResponse> search3(String query, int songCount, int albumCount, int artistCount) {
|
||||
Log.d(TAG, "search3()");
|
||||
return searchingService.search3(subsonic.getParams(), query, songCount, albumCount, artistCount);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.searching;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -11,8 +12,8 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface SearchingService {
|
||||
@GET("search2")
|
||||
Call<SubsonicResponse> search2(@QueryMap Map<String, String> params, @Query("query") String query, @Query("songCount") int songCount, @Query("albumCount") int albumCount, @Query("artistCount") int artistCount);
|
||||
Call<ApiResponse> search2(@QueryMap Map<String, String> params, @Query("query") String query, @Query("songCount") int songCount, @Query("albumCount") int albumCount, @Query("artistCount") int artistCount);
|
||||
|
||||
@GET("search3")
|
||||
Call<SubsonicResponse> search3(@QueryMap Map<String, String> params, @Query("query") String query, @Query("songCount") int songCount, @Query("albumCount") int albumCount, @Query("artistCount") int artistCount);
|
||||
Call<ApiResponse> search3(@QueryMap Map<String, String> params, @Query("query") String query, @Query("songCount") int songCount, @Query("albumCount") int albumCount, @Query("artistCount") int artistCount);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import android.content.Context;
|
|||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.Subsonic;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.utils.CacheUtil;
|
||||
import com.tickaroo.tikxml.retrofit.TikXmlConverterFactory;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ import okhttp3.OkHttpClient;
|
|||
import okhttp3.logging.HttpLoggingInterceptor;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class SystemClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
|
@ -29,19 +31,19 @@ public class SystemClient {
|
|||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(subsonic.getUrl())
|
||||
.addConverterFactory(TikXmlConverterFactory.create())
|
||||
.addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
|
||||
.client(getOkHttpClient())
|
||||
.build();
|
||||
|
||||
this.systemService = retrofit.create(SystemService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> ping() {
|
||||
public Call<ApiResponse> ping() {
|
||||
Log.d(TAG, "ping()");
|
||||
return systemService.ping(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getLicense() {
|
||||
public Call<ApiResponse> getLicense() {
|
||||
Log.d(TAG, "getLicense()");
|
||||
return systemService.getLicense(subsonic.getParams());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.api.system;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ import retrofit2.http.QueryMap;
|
|||
|
||||
public interface SystemService {
|
||||
@GET("ping")
|
||||
Call<SubsonicResponse> ping(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> ping(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getLicense")
|
||||
Call<SubsonicResponse> getLicense(@QueryMap Map<String, String> params);
|
||||
Call<ApiResponse> getLicense(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.cappielloantonio.play.subsonic.base
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
class ApiResponse {
|
||||
@SerializedName("subsonic-response")
|
||||
var subsonicResponse: SubsonicResponse? = null
|
||||
}
|
||||
|
|
@ -1,48 +1,25 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Parcelize
|
||||
@Xml(name = "album")
|
||||
open class AlbumID3 : Parcelable {
|
||||
@Attribute
|
||||
var id: String? = null
|
||||
|
||||
@Attribute
|
||||
var name: String? = null
|
||||
|
||||
@Attribute
|
||||
var artist: String? = null
|
||||
|
||||
@Attribute
|
||||
var artistId: String? = null
|
||||
|
||||
@Attribute(name = "coverArt")
|
||||
@SerializedName("coverArt")
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Attribute
|
||||
var songCount = 0
|
||||
|
||||
@Attribute
|
||||
var duration = 0
|
||||
|
||||
@Attribute
|
||||
var playCount: Long? = null
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var created: Date? = null
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var starred: Date? = null
|
||||
|
||||
@Attribute
|
||||
var year: Int? = null
|
||||
|
||||
@Attribute
|
||||
var genre: String? = null
|
||||
}
|
||||
|
|
@ -1,25 +1,11 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class AlbumInfo {
|
||||
@Attribute
|
||||
var notes: String? = null
|
||||
|
||||
@Attribute
|
||||
var musicBrainzId: String? = null
|
||||
|
||||
@Attribute
|
||||
var lastFmUrl: String? = null
|
||||
|
||||
@Attribute
|
||||
var smallImageUrl: String? = null
|
||||
|
||||
@Attribute
|
||||
var mediumImageUrl: String? = null
|
||||
|
||||
@Attribute
|
||||
var largeImageUrl: String? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class AlbumList2 {
|
||||
@Element
|
||||
@SerializedName("album")
|
||||
var albums: List<AlbumID3>? = null
|
||||
}
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class AlbumWithSongsID3 : AlbumID3(), Parcelable {
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,27 +1,17 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Parcelize
|
||||
@Xml(name = "artist")
|
||||
open class ArtistID3 : Parcelable {
|
||||
@Attribute
|
||||
var id: String? = null
|
||||
|
||||
@Attribute
|
||||
var name: String? = null
|
||||
|
||||
@Attribute(name = "coverArt")
|
||||
@SerializedName("coverArt")
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Attribute
|
||||
var albumCount = 0
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var starred: Date? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import java.util.*
|
||||
|
||||
@Xml
|
||||
class ArtistInfo2 : ArtistInfoBase() {
|
||||
@Element(name = "similarArtist")
|
||||
var similarArtists: List<SimilarArtistID3>? = null
|
||||
@SerializedName("similarArtist")
|
||||
var similarArtists: List<SimilarArtistID3>? = emptyList()
|
||||
}
|
||||
|
|
@ -1,25 +1,10 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.PropertyElement
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
open class ArtistInfoBase {
|
||||
@PropertyElement
|
||||
var biography: String? = null
|
||||
|
||||
@PropertyElement
|
||||
var musicBrainzId: String? = null
|
||||
|
||||
@PropertyElement
|
||||
var lastFmUrl: String? = null
|
||||
|
||||
@PropertyElement
|
||||
var smallImageUrl: String? = null
|
||||
|
||||
@PropertyElement
|
||||
var mediumImageUrl: String? = null
|
||||
|
||||
@PropertyElement
|
||||
var largeImageUrl: String? = null
|
||||
}
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class ArtistWithAlbumsID3 : ArtistID3(), Parcelable {
|
||||
@Element(name = "album")
|
||||
@SerializedName("album")
|
||||
var albums: List<AlbumID3>? = null
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class ArtistsID3 {
|
||||
@Element(name = "index")
|
||||
@SerializedName("index")
|
||||
var indices: List<IndexID3>? = null
|
||||
var ignoredArticles: String? = null
|
||||
}
|
||||
|
|
@ -3,137 +3,108 @@ package com.cappielloantonio.play.subsonic.models
|
|||
import android.os.Parcelable
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.PrimaryKey
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
open class Child(
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
@Attribute
|
||||
open val id: String,
|
||||
|
||||
@ColumnInfo(name = "parent_id")
|
||||
@Attribute(name = "parent")
|
||||
@SerializedName("parent")
|
||||
var parentId: String? = null,
|
||||
|
||||
@ColumnInfo(name = "is_dir")
|
||||
@Attribute
|
||||
var isDir: Boolean = false,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var title: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var album: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var artist: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var track: Int? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var year: Int? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute(name = "genre")
|
||||
@SerializedName("genre")
|
||||
var genre: String? = null,
|
||||
|
||||
@ColumnInfo(name = "cover_art_id")
|
||||
@Attribute(name = "coverArt")
|
||||
@SerializedName("coverArt")
|
||||
var coverArtId: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var size: Long? = null,
|
||||
|
||||
@ColumnInfo(name = "content_type")
|
||||
@Attribute
|
||||
var contentType: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var suffix: String? = null,
|
||||
|
||||
@ColumnInfo("transcoding_content_type")
|
||||
@Attribute
|
||||
var transcodedContentType: String? = null,
|
||||
|
||||
@ColumnInfo(name = "transcoded_suffix")
|
||||
@Attribute
|
||||
var transcodedSuffix: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var duration: Int? = null,
|
||||
|
||||
@ColumnInfo("bitrate")
|
||||
@Attribute(name = "bitRate")
|
||||
@SerializedName("bitRate")
|
||||
var bitrate: Int? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var path: String? = null,
|
||||
|
||||
@ColumnInfo(name = "is_video")
|
||||
@Attribute(name = "isVideo")
|
||||
@SerializedName("isVideo")
|
||||
var isVideo: Boolean = false,
|
||||
|
||||
@ColumnInfo(name = "user_rating")
|
||||
@Attribute
|
||||
var userRating: Int? = null,
|
||||
|
||||
@ColumnInfo(name = "average_rating")
|
||||
@Attribute
|
||||
var averageRating: Double? = null,
|
||||
|
||||
@ColumnInfo(name = "play_count")
|
||||
@Attribute
|
||||
var playCount: Long? = null,
|
||||
|
||||
@ColumnInfo(name = "disc_number")
|
||||
@Attribute
|
||||
var discNumber: Int? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var created: Date? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var starred: Date? = null,
|
||||
|
||||
@ColumnInfo(name = "album_id")
|
||||
@Attribute
|
||||
var albumId: String? = null,
|
||||
|
||||
@ColumnInfo(name = "artist_id")
|
||||
@Attribute
|
||||
var artistId: String? = null,
|
||||
|
||||
@ColumnInfo
|
||||
@Attribute
|
||||
var type: String? = null,
|
||||
|
||||
@ColumnInfo(name = "bookmark_position")
|
||||
@Attribute
|
||||
var bookmarkPosition: Long? = null,
|
||||
|
||||
@ColumnInfo(name = "original_width")
|
||||
@Attribute
|
||||
var originalWidth: Int? = null,
|
||||
|
||||
@ColumnInfo(name = "original_height")
|
||||
@Attribute
|
||||
var originalHeight: Int? = null
|
||||
) : Parcelable
|
||||
|
|
@ -1,14 +1,7 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.cappielloantonio.play.subsonic.utils.converter.ErrorCodeConverter
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class Error {
|
||||
@Attribute(converter = ErrorCodeConverter::class)
|
||||
var code: ErrorCode? = null
|
||||
|
||||
@Attribute
|
||||
var message: String? = null
|
||||
}
|
||||
|
|
@ -1,20 +1,13 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.TextContent
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class Genre : Parcelable {
|
||||
@TextContent
|
||||
@SerializedName("value")
|
||||
var genre: String? = null
|
||||
|
||||
@Attribute
|
||||
var songCount = 0
|
||||
|
||||
@Attribute
|
||||
var albumCount = 0
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class Genres {
|
||||
@Element
|
||||
@SerializedName("genre")
|
||||
var genres: List<Genre>? = null
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class IndexID3 {
|
||||
@Element(name = "artist")
|
||||
@SerializedName("artist")
|
||||
var artists: List<ArtistID3>? = null
|
||||
var name: String? = null
|
||||
}
|
||||
|
|
@ -1,17 +1,7 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.TextContent
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml(name = "lyrics")
|
||||
class Lyrics {
|
||||
@TextContent
|
||||
var content: String? = null
|
||||
|
||||
@Attribute
|
||||
var artist: String? = null
|
||||
|
||||
@Attribute
|
||||
var title: String? = null
|
||||
}
|
||||
|
|
@ -1,11 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class MediaType {
|
||||
@Attribute
|
||||
var value: String? = null
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class MusicFolder {
|
||||
@Attribute
|
||||
var id = 0
|
||||
|
||||
@Attribute
|
||||
var name: String? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,5 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class MusicFolders {
|
||||
@Element
|
||||
var musicFolders: List<MusicFolder>? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class NewestPodcasts {
|
||||
@Element(name = "episode")
|
||||
@SerializedName("episode")
|
||||
var episodes: List<PodcastEpisode>? = null
|
||||
}
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
class NowPlayingEntry(override val id: String) : Child(id) {
|
||||
class NowPlayingEntry(
|
||||
// TODO
|
||||
@SerializedName("_id")
|
||||
override val id: String
|
||||
) : Child(id) {
|
||||
var username: String? = null
|
||||
var minutesAgo = 0
|
||||
var playerId = 0
|
||||
|
|
|
|||
|
|
@ -5,60 +5,45 @@ import androidx.room.ColumnInfo
|
|||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Parcelize
|
||||
@Entity(tableName = "playlist")
|
||||
@Xml
|
||||
open class Playlist : Parcelable {
|
||||
open class Playlist(
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
@Attribute
|
||||
lateinit var id: String
|
||||
|
||||
open var id: String
|
||||
) : Parcelable {
|
||||
@ColumnInfo(name = "name")
|
||||
@Attribute
|
||||
var name: String? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute
|
||||
var comment: String? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute
|
||||
var owner: String? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute(name = "public")
|
||||
@SerializedName("public")
|
||||
var isUniversal: Boolean? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute
|
||||
var songCount: Int = 0
|
||||
|
||||
@Ignore
|
||||
@ColumnInfo(name = "duration")
|
||||
@Attribute
|
||||
var duration: Long = 0
|
||||
|
||||
@Ignore
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var created: Date? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var changed: Date? = null
|
||||
|
||||
@Ignore
|
||||
@ColumnInfo(name = "coverArt")
|
||||
@Attribute
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Ignore
|
||||
@Attribute
|
||||
var allowedUsers: List<String>? = null
|
||||
}
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class PlaylistWithSongs : Playlist(), Parcelable {
|
||||
@Element(name = "entry")
|
||||
class PlaylistWithSongs(
|
||||
@SerializedName("_id")
|
||||
override var id: String
|
||||
) : Playlist(id), Parcelable {
|
||||
@SerializedName("entry")
|
||||
var entries: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class Playlists {
|
||||
@Element(name = "playlist")
|
||||
class Playlists(
|
||||
@SerializedName("playlist")
|
||||
var playlists: List<Playlist>? = null
|
||||
}
|
||||
)
|
||||
|
|
@ -1,38 +1,19 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class PodcastChannel : Parcelable {
|
||||
@Element(name = "episode")
|
||||
@SerializedName("episode")
|
||||
var episodes: List<PodcastEpisode>? = null
|
||||
|
||||
@Attribute
|
||||
var id: String? = null
|
||||
|
||||
@Attribute
|
||||
var url: String? = null
|
||||
|
||||
@Attribute
|
||||
var title: String? = null
|
||||
|
||||
@Attribute
|
||||
var description: String? = null
|
||||
|
||||
@Attribute
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Attribute
|
||||
var originalImageUrl: String? = null
|
||||
|
||||
@Attribute
|
||||
var status: String? = null
|
||||
|
||||
@Attribute
|
||||
var errorMessage: String? = null
|
||||
}
|
||||
|
|
@ -1,120 +1,54 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import java.util.*
|
||||
|
||||
@Parcelize
|
||||
@Xml
|
||||
class PodcastEpisode : Parcelable {
|
||||
@Attribute
|
||||
var id: String? = null
|
||||
|
||||
@Attribute(name = "parent")
|
||||
@SerializedName("parent")
|
||||
var parentId: String? = null
|
||||
|
||||
@Attribute(name = "isDir")
|
||||
@SerializedName("isDir")
|
||||
var isDir = false
|
||||
|
||||
@Attribute
|
||||
var title: String? = null
|
||||
|
||||
@Attribute
|
||||
var album: String? = null
|
||||
|
||||
@Attribute
|
||||
var artist: String? = null
|
||||
|
||||
@Attribute
|
||||
var track: Int? = null
|
||||
|
||||
@Attribute
|
||||
var year: Int? = null
|
||||
|
||||
@Attribute(name = "genre")
|
||||
var genre: String? = null
|
||||
|
||||
@Attribute(name = "coverArt")
|
||||
@SerializedName("coverArt")
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Attribute
|
||||
var size: Long? = null
|
||||
|
||||
@Attribute
|
||||
var contentType: String? = null
|
||||
|
||||
@Attribute
|
||||
var suffix: String? = null
|
||||
|
||||
@Attribute
|
||||
var transcodedContentType: String? = null
|
||||
|
||||
@Attribute
|
||||
var transcodedSuffix: String? = null
|
||||
|
||||
@Attribute
|
||||
var duration: Int? = null
|
||||
|
||||
@Attribute
|
||||
var bitRate: Int? = null
|
||||
|
||||
@Attribute
|
||||
var path: String? = null
|
||||
|
||||
@Attribute(name = "isVideo")
|
||||
@SerializedName("isVideo")
|
||||
var video: Boolean? = null
|
||||
|
||||
@Attribute
|
||||
var userRating: Int? = null
|
||||
|
||||
@Attribute
|
||||
var averageRating: Double? = null
|
||||
|
||||
@Attribute
|
||||
var playCount: Long? = null
|
||||
|
||||
@Attribute
|
||||
var discNumber: Int? = null
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var created: Date? = null
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var starred: Date? = null
|
||||
|
||||
@Attribute
|
||||
var albumId: String? = null
|
||||
|
||||
@Attribute
|
||||
var artistId: String? = null
|
||||
|
||||
@Attribute
|
||||
var type: String? = null
|
||||
|
||||
@Attribute
|
||||
var bookmarkPosition: Long? = null
|
||||
|
||||
@Attribute
|
||||
var originalWidth: Int? = null
|
||||
|
||||
@Attribute
|
||||
var originalHeight: Int? = null
|
||||
|
||||
@Attribute
|
||||
var streamId: String? = null
|
||||
|
||||
@Attribute
|
||||
var channelId: String? = null
|
||||
|
||||
@Attribute
|
||||
var description: String? = null
|
||||
|
||||
@Attribute
|
||||
var status: String? = null
|
||||
|
||||
@Attribute(converter = DateRfc3339TypeConverter::class)
|
||||
var publishDate: Date? = null
|
||||
}
|
||||
|
|
@ -1,11 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class PodcastStatus {
|
||||
@Attribute
|
||||
var value: String? = null
|
||||
|
||||
companion object {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class Podcasts {
|
||||
@Element(name = "channel")
|
||||
@SerializedName("channel")
|
||||
var channels: List<PodcastChannel>? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class ResponseStatus(@param:Attribute val value: String) {
|
||||
class ResponseStatus(val value: String) {
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml
|
||||
class ScanStatus {
|
||||
@Attribute
|
||||
var isScanning = false
|
||||
|
||||
@Attribute
|
||||
var count: Long? = null
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class SearchResult2 {
|
||||
@Element(name = "artist")
|
||||
@SerializedName("artist")
|
||||
var artists: List<Artist>? = null
|
||||
|
||||
@Element(name = "album")
|
||||
@SerializedName("album")
|
||||
var albums: List<Child>? = null
|
||||
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class SearchResult3 {
|
||||
@Element(name = "artist")
|
||||
@SerializedName("artist")
|
||||
var artists: List<ArtistID3>? = null
|
||||
|
||||
@Element(name = "album")
|
||||
@SerializedName("album")
|
||||
var albums: List<AlbumID3>? = null
|
||||
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,22 +1,7 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@Xml(name = "similarArtist")
|
||||
class SimilarArtistID3 : Parcelable {
|
||||
@Attribute
|
||||
var id: String? = null
|
||||
|
||||
@Attribute
|
||||
var name: String? = null
|
||||
|
||||
@Attribute(name = "coverArt")
|
||||
var coverArtId: String? = null
|
||||
|
||||
@Attribute
|
||||
var albumCount = 0
|
||||
}
|
||||
class SimilarArtistID3 : ArtistID3(), Parcelable
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class SimilarSongs2 {
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class Songs {
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class Starred2 {
|
||||
@Element(name = "artist")
|
||||
@SerializedName("artist")
|
||||
var artists: List<ArtistID3>? = null
|
||||
|
||||
@Element(name = "album")
|
||||
@SerializedName("album")
|
||||
var albums: List<AlbumID3>? = null
|
||||
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,54 +1,25 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.cappielloantonio.play.subsonic.utils.converter.ResponseStatusConverter
|
||||
import com.tickaroo.tikxml.annotation.Attribute
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
|
||||
@Xml(name = "subsonic-response")
|
||||
class SubsonicResponse {
|
||||
@Element
|
||||
var error: Error? = null
|
||||
|
||||
@Element(name = "scanStatus")
|
||||
var scanStatus: ScanStatus? = null
|
||||
|
||||
@Element(name = "topSongs")
|
||||
var topSongs: TopSongs? = null
|
||||
|
||||
@Element(name = "similarSongs2")
|
||||
var similarSongs2: SimilarSongs2? = null
|
||||
var similarSongs: SimilarSongs? = null
|
||||
|
||||
@Element(name = "artistInfo2")
|
||||
var artistInfo2: ArtistInfo2? = null
|
||||
var artistInfo: ArtistInfo? = null
|
||||
|
||||
@Element(name = "albumInfo")
|
||||
var albumInfo: AlbumInfo? = null
|
||||
|
||||
@Element(name = "starred2")
|
||||
var starred2: Starred2? = null
|
||||
var starred: Starred? = null
|
||||
var shares: Shares? = null
|
||||
var playQueue: PlayQueue? = null
|
||||
var bookmarks: Bookmarks? = null
|
||||
var internetRadioStations: InternetRadioStations? = null
|
||||
|
||||
@Element(name = "newestPodcasts")
|
||||
var newestPodcasts: NewestPodcasts? = null
|
||||
var podcasts: Podcasts? = null
|
||||
|
||||
@Element(name = "lyrics")
|
||||
var lyrics: Lyrics? = null
|
||||
|
||||
@Element(name = "songsByGenre")
|
||||
var songsByGenre: Songs? = null
|
||||
|
||||
@Element(name = "randomSongs")
|
||||
var randomSongs: Songs? = null
|
||||
|
||||
@Element
|
||||
var albumList2: AlbumList2? = null
|
||||
var albumList: AlbumList? = null
|
||||
var chatMessages: ChatMessages? = null
|
||||
|
|
@ -57,52 +28,24 @@ class SubsonicResponse {
|
|||
var license: License? = null
|
||||
var jukeboxPlaylist: JukeboxPlaylist? = null
|
||||
var jukeboxStatus: JukeboxStatus? = null
|
||||
|
||||
@Element(name = "playlist")
|
||||
var playlist: PlaylistWithSongs? = null
|
||||
|
||||
@Element
|
||||
var playlists: Playlists? = null
|
||||
|
||||
@Element
|
||||
var searchResult3: SearchResult3? = null
|
||||
|
||||
@Element
|
||||
var searchResult2: SearchResult2? = null
|
||||
var searchResult: SearchResult? = null
|
||||
var nowPlaying: NowPlaying? = null
|
||||
var videoInfo: VideoInfo? = null
|
||||
var videos: Videos? = null
|
||||
|
||||
@Element(name = "song")
|
||||
var song: Child? = null
|
||||
|
||||
@Element(name = "album")
|
||||
var album: AlbumWithSongsID3? = null
|
||||
|
||||
@Element(name = "artist")
|
||||
var artist: ArtistWithAlbumsID3? = null
|
||||
|
||||
@Element(name = "artists")
|
||||
var artists: ArtistsID3? = null
|
||||
|
||||
@Element
|
||||
var genres: Genres? = null
|
||||
var directory: Directory? = null
|
||||
var indexes: Indexes? = null
|
||||
|
||||
@Element
|
||||
var musicFolders: MusicFolders? = null
|
||||
|
||||
@Attribute(converter = ResponseStatusConverter::class)
|
||||
var status: ResponseStatus? = null
|
||||
|
||||
@Attribute
|
||||
var status: String? = null
|
||||
var version: String? = null
|
||||
|
||||
@Attribute
|
||||
var type: String? = null
|
||||
|
||||
@Attribute
|
||||
var serverVersion: String? = null
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.cappielloantonio.play.subsonic.models
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element
|
||||
import com.tickaroo.tikxml.annotation.Xml
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Xml
|
||||
class TopSongs {
|
||||
@Element(name = "song")
|
||||
@SerializedName("song")
|
||||
var songs: List<Child>? = null
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.cappielloantonio.play.subsonic.utils.converter;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.ErrorCode;
|
||||
import com.tickaroo.tikxml.TypeConverter;
|
||||
|
||||
public class ErrorCodeConverter implements TypeConverter<ErrorCode> {
|
||||
@Override
|
||||
public ErrorCode read(String value) throws Exception {
|
||||
return new ErrorCode(Integer.parseInt(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String write(ErrorCode value) throws Exception {
|
||||
return String.valueOf(value.getValue());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.cappielloantonio.play.subsonic.utils.converter;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.ResponseStatus;
|
||||
import com.tickaroo.tikxml.TypeConverter;
|
||||
|
||||
public class ResponseStatusConverter implements TypeConverter<ResponseStatus> {
|
||||
@Override
|
||||
public ResponseStatus read(String value) throws Exception {
|
||||
return new ResponseStatus(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String write(ResponseStatus value) throws Exception {
|
||||
return value.getValue();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue