mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-13 01:20:27 -07:00
build: change of package name
This commit is contained in:
parent
49afdbe4eb
commit
b76a38cb30
274 changed files with 1981 additions and 2161 deletions
|
|
@ -0,0 +1,56 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.albumsonglist;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class AlbumSongListClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final AlbumSongListService albumSongListService;
|
||||
|
||||
public AlbumSongListClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.albumSongListService = new RetrofitClient(subsonic).getRetrofit().create(AlbumSongListService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getAlbumList(String type, int size, int offset) {
|
||||
Log.d(TAG, "getAlbumList()");
|
||||
return albumSongListService.getAlbumList(subsonic.getParams(), type, size, offset);
|
||||
}
|
||||
|
||||
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<ApiResponse> getRandomSongs(int size, Integer fromYear, Integer toYear) {
|
||||
Log.d(TAG, "getRandomSongs()");
|
||||
return albumSongListService.getRandomSongs(subsonic.getParams(), size, fromYear, toYear);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getSongsByGenre(String genre, int count, int offset) {
|
||||
Log.d(TAG, "getSongsByGenre()");
|
||||
return albumSongListService.getSongsByGenre(subsonic.getParams(), genre, count, offset);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getNowPlaying() {
|
||||
Log.d(TAG, "getNowPlaying()");
|
||||
return albumSongListService.getNowPlaying(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getStarred() {
|
||||
Log.d(TAG, "getStarred()");
|
||||
return albumSongListService.getStarred(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getStarred2() {
|
||||
Log.d(TAG, "getStarred2()");
|
||||
return albumSongListService.getStarred2(subsonic.getParams());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.albumsonglist;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface AlbumSongListService {
|
||||
@GET("getAlbumList")
|
||||
Call<ApiResponse> getAlbumList(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset);
|
||||
|
||||
@GET("getAlbumList2")
|
||||
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<ApiResponse> getRandomSongs(@QueryMap Map<String, String> params, @Query("size") int size, @Query("fromYear") Integer fromYear, @Query("toYear") Integer toYear);
|
||||
|
||||
@GET("getSongsByGenre")
|
||||
Call<ApiResponse> getSongsByGenre(@QueryMap Map<String, String> params, @Query("genre") String genre, @Query("count") int count, @Query("offset") int offset);
|
||||
|
||||
@GET("getNowPlaying")
|
||||
Call<ApiResponse> getNowPlaying(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getStarred")
|
||||
Call<ApiResponse> getStarred(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getStarred2")
|
||||
Call<ApiResponse> getStarred2(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.bookmarks;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class BookmarksClient {
|
||||
private static final String TAG = "BookmarksClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final BookmarksService bookmarksService;
|
||||
|
||||
public BookmarksClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.bookmarksService = new RetrofitClient(subsonic).getRetrofit().create(BookmarksService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getPlayQueue() {
|
||||
Log.d(TAG, "getPlayQueue()");
|
||||
return bookmarksService.getPlayQueue(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> savePlayQueue(List<String> ids, String current, long position) {
|
||||
Log.d(TAG, "savePlayQueue()");
|
||||
return bookmarksService.savePlayQueue(subsonic.getParams(), ids, current, position);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.bookmarks;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface BookmarksService {
|
||||
@GET("getPlayQueue")
|
||||
Call<ApiResponse> getPlayQueue(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("savePlayQueue")
|
||||
Call<ApiResponse> savePlayQueue(@QueryMap Map<String, String> params, @Query("id") List<String> ids, @Query("current") String current, @Query("position") long position);
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.browsing;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class BrowsingClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final BrowsingService browsingService;
|
||||
|
||||
public BrowsingClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.browsingService = new RetrofitClient(subsonic).getRetrofit().create(BrowsingService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getMusicFolders() {
|
||||
Log.d(TAG, "getMusicFolders()");
|
||||
return browsingService.getMusicFolders(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getIndexes(String musicFolderId, Long ifModifiedSince) {
|
||||
Log.d(TAG, "getIndexes()");
|
||||
return browsingService.getIndexes(subsonic.getParams(), musicFolderId, ifModifiedSince);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getMusicDirectory(String id) {
|
||||
Log.d(TAG, "getMusicDirectory()");
|
||||
return browsingService.getMusicDirectory(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getGenres() {
|
||||
Log.d(TAG, "getGenres()");
|
||||
return browsingService.getGenres(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getArtists() {
|
||||
Log.d(TAG, "getArtists()");
|
||||
return browsingService.getArtists(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getArtist(String id) {
|
||||
Log.d(TAG, "getArtist()");
|
||||
return browsingService.getArtist(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getAlbum(String id) {
|
||||
Log.d(TAG, "getAlbum()");
|
||||
return browsingService.getAlbum(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getSong(String id) {
|
||||
Log.d(TAG, "getSong()");
|
||||
return browsingService.getSong(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getVideos() {
|
||||
Log.d(TAG, "getVideos()");
|
||||
return browsingService.getVideos(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getVideoInfo(String id) {
|
||||
Log.d(TAG, "getVideoInfo()");
|
||||
return browsingService.getVideoInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getArtistInfo(String id) {
|
||||
Log.d(TAG, "getArtistInfo()");
|
||||
return browsingService.getArtistInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getArtistInfo2(String id) {
|
||||
Log.d(TAG, "getArtistInfo2()");
|
||||
return browsingService.getArtistInfo2(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getAlbumInfo(String id) {
|
||||
Log.d(TAG, "getAlbumInfo()");
|
||||
return browsingService.getAlbumInfo(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getAlbumInfo2(String id) {
|
||||
Log.d(TAG, "getAlbumInfo2()");
|
||||
return browsingService.getAlbumInfo2(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getSimilarSongs(String id, int count) {
|
||||
Log.d(TAG, "getSimilarSongs()");
|
||||
return browsingService.getSimilarSongs(subsonic.getParams(), id, count);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getSimilarSongs2(String id, int limit) {
|
||||
Log.d(TAG, "getSimilarSongs2()");
|
||||
return browsingService.getSimilarSongs2(subsonic.getParams(), id, limit);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getTopSongs(String artist, int count) {
|
||||
Log.d(TAG, "getTopSongs()");
|
||||
return browsingService.getTopSongs(subsonic.getParams(), artist, count);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.browsing;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface BrowsingService {
|
||||
@GET("getMusicFolders")
|
||||
Call<ApiResponse> getMusicFolders(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getIndexes")
|
||||
Call<ApiResponse> getIndexes(@QueryMap Map<String, String> params, @Query("musicFolderId") String musicFolderId, @Query("ifModifiedSince") Long ifModifiedSince);
|
||||
|
||||
@GET("getMusicDirectory")
|
||||
Call<ApiResponse> getMusicDirectory(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getGenres")
|
||||
Call<ApiResponse> getGenres(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getArtists")
|
||||
Call<ApiResponse> getArtists(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getArtist")
|
||||
Call<ApiResponse> getArtist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbum")
|
||||
Call<ApiResponse> getAlbum(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSong")
|
||||
Call<ApiResponse> getSong(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getVideos")
|
||||
Call<ApiResponse> getVideos(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getVideoInfo")
|
||||
Call<ApiResponse> getVideoInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo")
|
||||
Call<ApiResponse> getArtistInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo2")
|
||||
Call<ApiResponse> getArtistInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo")
|
||||
Call<ApiResponse> getAlbumInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo2")
|
||||
Call<ApiResponse> getAlbumInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSimilarSongs")
|
||||
Call<ApiResponse> getSimilarSongs(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getSimilarSongs2")
|
||||
Call<ApiResponse> getSimilarSongs2(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getTopSongs")
|
||||
Call<ApiResponse> getTopSongs(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("count") int count);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.internetradio;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class InternetRadioClient {
|
||||
private static final String TAG = "InternetRadioClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final InternetRadioService internetRadioService;
|
||||
|
||||
public InternetRadioClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.internetRadioService = new RetrofitClient(subsonic).getRetrofit().create(InternetRadioService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getInternetRadioStations() {
|
||||
Log.d(TAG, "getInternetRadioStations()");
|
||||
return internetRadioService.getInternetRadioStations(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> createInternetRadioStation(String streamUrl, String name, String homepageUrl) {
|
||||
Log.d(TAG, "createInternetRadioStation()");
|
||||
return internetRadioService.createInternetRadioStation(subsonic.getParams(), streamUrl, name, homepageUrl);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> updateInternetRadioStation(String id, String streamUrl, String name, String homepageUrl) {
|
||||
Log.d(TAG, "updateInternetRadioStation()");
|
||||
return internetRadioService.updateInternetRadioStation(subsonic.getParams(), id, streamUrl, name, homepageUrl);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> deleteInternetRadioStation(String id) {
|
||||
Log.d(TAG, "deleteInternetRadioStation()");
|
||||
return internetRadioService.deleteInternetRadioStation(subsonic.getParams(), id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.internetradio;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface InternetRadioService {
|
||||
@GET("getInternetRadioStations")
|
||||
Call<ApiResponse> getInternetRadioStations(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("createInternetRadioStation")
|
||||
Call<ApiResponse> createInternetRadioStation(@QueryMap Map<String, String> params, @Query("streamUrl") String streamUrl, @Query("name") String name, @Query("homepageUrl") String homepageUrl);
|
||||
|
||||
@GET("updateInternetRadioStation")
|
||||
Call<ApiResponse> updateInternetRadioStation(@QueryMap Map<String, String> params, @Query("id") String id, @Query("streamUrl") String streamUrl, @Query("name") String name, @Query("homepageUrl") String homepageUrl);
|
||||
|
||||
@GET("deleteInternetRadioStation")
|
||||
Call<ApiResponse> deleteInternetRadioStation(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.mediaannotation;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class MediaAnnotationClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final MediaAnnotationService mediaAnnotationService;
|
||||
|
||||
public MediaAnnotationClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.mediaAnnotationService = new RetrofitClient(subsonic).getRetrofit().create(MediaAnnotationService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> star(String id, String albumId, String artistId) {
|
||||
Log.d(TAG, "star()");
|
||||
return mediaAnnotationService.star(subsonic.getParams(), id, albumId, 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<ApiResponse> setRating(String id, int rating) {
|
||||
Log.d(TAG, "setRating()");
|
||||
return mediaAnnotationService.setRating(subsonic.getParams(), id, rating);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> scrobble(String id) {
|
||||
Log.d(TAG, "scrobble()");
|
||||
return mediaAnnotationService.scrobble(subsonic.getParams(), id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.mediaannotation;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface MediaAnnotationService {
|
||||
@GET("star")
|
||||
Call<ApiResponse> star(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
|
||||
@GET("unstar")
|
||||
Call<ApiResponse> unstar(@QueryMap Map<String, String> params, @Query("id") String id, @Query("albumId") String albumId, @Query("artistId") String artistId);
|
||||
|
||||
@GET("setRating")
|
||||
Call<ApiResponse> setRating(@QueryMap Map<String, String> params, @Query("id") String id, @Query("rating") int rating);
|
||||
|
||||
@GET("scrobble")
|
||||
Call<ApiResponse> scrobble(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.medialibraryscanning;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class MediaLibraryScanningClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final MediaLibraryScanningService mediaLibraryScanningService;
|
||||
|
||||
public MediaLibraryScanningClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.mediaLibraryScanningService = new RetrofitClient(subsonic).getRetrofit().create(MediaLibraryScanningService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> startScan() {
|
||||
Log.d(TAG, "startScan()");
|
||||
return mediaLibraryScanningService.startScan(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getScanStatus() {
|
||||
Log.d(TAG, "getScanStatus()");
|
||||
return mediaLibraryScanningService.getScanStatus(subsonic.getParams());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.medialibraryscanning;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface MediaLibraryScanningService {
|
||||
@GET("startScan")
|
||||
Call<ApiResponse> startScan(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getScanStatus")
|
||||
Call<ApiResponse> getScanStatus(@QueryMap Map<String, String> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.mediaretrieval;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class MediaRetrievalClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final MediaRetrievalService mediaRetrievalService;
|
||||
|
||||
public MediaRetrievalClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.mediaRetrievalService = new RetrofitClient(subsonic).getRetrofit().create(MediaRetrievalService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> stream(String id, Integer maxBitRate, String format) {
|
||||
Log.d(TAG, "stream()");
|
||||
return mediaRetrievalService.stream(subsonic.getParams(), id, maxBitRate, format);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> download(String id) {
|
||||
Log.d(TAG, "download()");
|
||||
return mediaRetrievalService.download(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getLyrics(String artist, String title) {
|
||||
Log.d(TAG, "getLyrics()");
|
||||
return mediaRetrievalService.getLyrics(subsonic.getParams(), artist, title);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.mediaretrieval;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface MediaRetrievalService {
|
||||
@GET("stream")
|
||||
Call<ApiResponse> stream(@QueryMap Map<String, String> params, @Query("id") String id, @Query("maxBitRate") Integer maxBitRate, @Query("format") String format);
|
||||
|
||||
@GET("download")
|
||||
Call<ApiResponse> download(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getLyrics")
|
||||
Call<ApiResponse> getLyrics(@QueryMap Map<String, String> params, @Query("artist") String artist, @Query("title") String title);
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.playlist;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class PlaylistClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final PlaylistService playlistService;
|
||||
|
||||
public PlaylistClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.playlistService = new RetrofitClient(subsonic).getRetrofit().create(PlaylistService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getPlaylists() {
|
||||
Log.d(TAG, "getPlaylists()");
|
||||
return playlistService.getPlaylists(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getPlaylist(String id) {
|
||||
Log.d(TAG, "getPlaylist()");
|
||||
return playlistService.getPlaylist(subsonic.getParams(), id);
|
||||
}
|
||||
|
||||
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<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<ApiResponse> deletePlaylist(String id) {
|
||||
Log.d(TAG, "deletePlaylist()");
|
||||
return playlistService.deletePlaylist(subsonic.getParams(), id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.playlist;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface PlaylistService {
|
||||
@GET("getPlaylists")
|
||||
Call<ApiResponse> getPlaylists(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getPlaylist")
|
||||
Call<ApiResponse> getPlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("createPlaylist")
|
||||
Call<ApiResponse> createPlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("songId") ArrayList<String> songsId);
|
||||
|
||||
@GET("updatePlaylist")
|
||||
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<ApiResponse> deletePlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.podcast;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class PodcastClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final PodcastService podcastService;
|
||||
|
||||
public PodcastClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.podcastService = new RetrofitClient(subsonic).getRetrofit().create(PodcastService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getPodcasts(boolean includeEpisodes, String channelId) {
|
||||
Log.d(TAG, "getPodcasts()");
|
||||
return podcastService.getPodcasts(subsonic.getParams(), includeEpisodes, channelId);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getNewestPodcasts(int count) {
|
||||
Log.d(TAG, "getNewestPodcasts()");
|
||||
return podcastService.getNewestPodcasts(subsonic.getParams(), count);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> refreshPodcasts() {
|
||||
Log.d(TAG, "refreshPodcasts()");
|
||||
return podcastService.refreshPodcasts(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> createPodcastChannel(String url) {
|
||||
Log.d(TAG, "createPodcastChannel()");
|
||||
return podcastService.createPodcastChannel(subsonic.getParams(), url);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> deletePodcastChannel(String channelId) {
|
||||
Log.d(TAG, "deletePodcastChannel()");
|
||||
return podcastService.deletePodcastChannel(subsonic.getParams(), channelId);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> deletePodcastEpisode(String episodeId) {
|
||||
Log.d(TAG, "deletePodcastEpisode()");
|
||||
return podcastService.deletePodcastEpisode(subsonic.getParams(), episodeId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.podcast;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface PodcastService {
|
||||
@GET("getPodcasts")
|
||||
Call<ApiResponse> getPodcasts(@QueryMap Map<String, String> params, @Query("includeEpisodes") boolean includeEpisodes, @Query("id") String id);
|
||||
|
||||
@GET("getNewestPodcasts")
|
||||
Call<ApiResponse> getNewestPodcasts(@QueryMap Map<String, String> params, @Query("count") int count);
|
||||
|
||||
@GET("refreshPodcasts")
|
||||
Call<ApiResponse> refreshPodcasts(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("createPodcastChannel")
|
||||
Call<ApiResponse> createPodcastChannel(@QueryMap Map<String, String> params, @Query("url") String url);
|
||||
|
||||
@GET("deletePodcastChannel")
|
||||
Call<ApiResponse> deletePodcastChannel(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("deletePodcastEpisode")
|
||||
Call<ApiResponse> deletePodcastEpisode(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.searching;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class SearchingClient {
|
||||
private static final String TAG = "BrowsingClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final SearchingService searchingService;
|
||||
|
||||
public SearchingClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.searchingService = new RetrofitClient(subsonic).getRetrofit().create(SearchingService.class);
|
||||
}
|
||||
|
||||
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<ApiResponse> search3(String query, int songCount, int albumCount, int artistCount) {
|
||||
Log.d(TAG, "search3()");
|
||||
return searchingService.search3(subsonic.getParams(), query, songCount, albumCount, artistCount);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.searching;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface SearchingService {
|
||||
@GET("search2")
|
||||
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<ApiResponse> search3(@QueryMap Map<String, String> params, @Query("query") String query, @Query("songCount") int songCount, @Query("albumCount") int albumCount, @Query("artistCount") int artistCount);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.system;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.RetrofitClient;
|
||||
import com.cappielloantonio.tempo.subsonic.Subsonic;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
||||
public class SystemClient {
|
||||
private static final String TAG = "SystemClient";
|
||||
|
||||
private final Subsonic subsonic;
|
||||
private final SystemService systemService;
|
||||
|
||||
public SystemClient(Subsonic subsonic) {
|
||||
this.subsonic = subsonic;
|
||||
this.systemService = new RetrofitClient(subsonic).getRetrofit().create(SystemService.class);
|
||||
}
|
||||
|
||||
public Call<ApiResponse> ping() {
|
||||
Log.d(TAG, "ping()");
|
||||
return systemService.ping(subsonic.getParams());
|
||||
}
|
||||
|
||||
public Call<ApiResponse> getLicense() {
|
||||
Log.d(TAG, "getLicense()");
|
||||
return systemService.getLicense(subsonic.getParams());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cappielloantonio.tempo.subsonic.api.system;
|
||||
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface SystemService {
|
||||
@GET("ping")
|
||||
Call<ApiResponse> ping(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getLicense")
|
||||
Call<ApiResponse> getLicense(@QueryMap Map<String, String> params);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue