mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 09:33:33 +00:00
Sync libraries, artist, album, genre, song, playlist, playlist song
This commit is contained in:
parent
3a91ee68db
commit
304a5f078a
30 changed files with 716 additions and 1699 deletions
|
|
@ -86,6 +86,7 @@ dependencies {
|
|||
implementation 'com.tickaroo.tikxml:annotation:0.9.0_11-SNAPSHOT'
|
||||
implementation 'com.tickaroo.tikxml:core:0.9.0_11-SNAPSHOT'
|
||||
annotationProcessor 'com.tickaroo.tikxml:processor:0.9.0_11-SNAPSHOT'
|
||||
implementation 'com.tickaroo.tikxml:converter-date-rfc3339:0.9.0_11-SNAPSHOT'
|
||||
|
||||
// implementation 'net.beardbot:subsonic-client:0.2.0'
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.cappielloantonio.play.helper;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class ErrorHelper {
|
||||
public static void handle(Context context, int code, String message) {
|
||||
Toast.makeText(context, code + " - " + message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cappielloantonio.play.model;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
|
@ -10,6 +11,8 @@ import androidx.room.Entity;
|
|||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.models.Child;
|
||||
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
import org.jellyfin.apiclient.model.dto.MediaSourceInfo;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
|
|
@ -17,6 +20,7 @@ import org.jellyfin.apiclient.model.entities.MediaStream;
|
|||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -54,16 +58,6 @@ public class Song implements Parcelable {
|
|||
@Ignore
|
||||
public static final String RADIO = "RADIO";
|
||||
|
||||
/*
|
||||
* TODO: Da capire chi tra albumArtist e artistItems sono i compositori e suonatori dell'album, oppure le comparse
|
||||
* In teoria AlbumArtist sono i creatori, mentre ArtistItems le comparse
|
||||
*/
|
||||
@Ignore
|
||||
public List<Artist> albumArtists;
|
||||
|
||||
@Ignore
|
||||
public List<Artist> artistItems;
|
||||
|
||||
@NonNull
|
||||
@PrimaryKey
|
||||
@ColumnInfo(name = "id")
|
||||
|
|
@ -99,9 +93,6 @@ public class Song implements Parcelable {
|
|||
@ColumnInfo(name = "primary")
|
||||
private String primary;
|
||||
|
||||
@ColumnInfo(name = "blurHash")
|
||||
private String blurHash;
|
||||
|
||||
@ColumnInfo(name = "favorite")
|
||||
private boolean favorite;
|
||||
|
||||
|
|
@ -114,21 +105,9 @@ public class Song implements Parcelable {
|
|||
@ColumnInfo(name = "container")
|
||||
private String container;
|
||||
|
||||
@ColumnInfo(name = "codec")
|
||||
private String codec;
|
||||
|
||||
@ColumnInfo(name = "sampleRate")
|
||||
private int sampleRate;
|
||||
|
||||
@ColumnInfo(name = "bitRate")
|
||||
private int bitRate;
|
||||
|
||||
@ColumnInfo(name = "bitDepth")
|
||||
private int bitDepth;
|
||||
|
||||
@ColumnInfo(name = "channels")
|
||||
private int channels;
|
||||
|
||||
@ColumnInfo(name = "added")
|
||||
private long added;
|
||||
|
||||
|
|
@ -141,7 +120,7 @@ public class Song implements Parcelable {
|
|||
@ColumnInfo(name = "offline")
|
||||
private boolean offline;
|
||||
|
||||
public Song(@NonNull String id, String title, int trackNumber, int discNumber, int year, long duration, String albumId, String albumName, String artistId, String artistName, String primary, String blurHash, boolean favorite, String path, long size, String container, String codec, int sampleRate, int bitRate, int bitDepth, int channels, long added, int playCount, long lastPlay, boolean offline) {
|
||||
public Song(@NonNull String id, String title, int trackNumber, int discNumber, int year, long duration, String albumId, String albumName, String artistId, String artistName, String primary, boolean favorite, String path, long size, String container, int bitRate, long added, int playCount, long lastPlay, boolean offline) {
|
||||
this.id = id;
|
||||
this.title = title;
|
||||
this.trackNumber = trackNumber;
|
||||
|
|
@ -153,16 +132,11 @@ public class Song implements Parcelable {
|
|||
this.artistId = artistId;
|
||||
this.artistName = artistName;
|
||||
this.primary = primary;
|
||||
this.blurHash = blurHash;
|
||||
this.favorite = favorite;
|
||||
this.path = path;
|
||||
this.size = size;
|
||||
this.container = container;
|
||||
this.codec = codec;
|
||||
this.sampleRate = sampleRate;
|
||||
this.bitRate = bitRate;
|
||||
this.bitDepth = bitDepth;
|
||||
this.channels = channels;
|
||||
this.added = added;
|
||||
this.playCount = playCount;
|
||||
this.lastPlay = lastPlay;
|
||||
|
|
@ -175,64 +149,24 @@ public class Song implements Parcelable {
|
|||
}
|
||||
|
||||
@Ignore
|
||||
public Song(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
this.title = itemDto.getName();
|
||||
this.trackNumber = itemDto.getIndexNumber() != null ? itemDto.getIndexNumber() : 0;
|
||||
this.discNumber = itemDto.getParentIndexNumber() != null ? itemDto.getParentIndexNumber() : 0;
|
||||
this.year = itemDto.getProductionYear() != null ? itemDto.getProductionYear() : 0;
|
||||
this.duration = itemDto.getRunTimeTicks() != null ? itemDto.getRunTimeTicks() / 10000 : 0;
|
||||
|
||||
this.albumId = itemDto.getAlbumId();
|
||||
this.albumName = itemDto.getAlbum();
|
||||
|
||||
albumArtists = new ArrayList<>();
|
||||
artistItems = new ArrayList<>();
|
||||
|
||||
if (itemDto.getAlbumArtists().size() != 0) {
|
||||
this.artistId = itemDto.getAlbumArtists().get(0).getId();
|
||||
this.artistName = itemDto.getAlbumArtists().get(0).getName();
|
||||
|
||||
itemDto.getAlbumArtists().forEach(artist -> {
|
||||
albumArtists.add(new Artist(artist.getId(), artist.getName()));
|
||||
});
|
||||
}
|
||||
else if (itemDto.getArtistItems().size() != 0) {
|
||||
this.artistId = itemDto.getArtistItems().get(0).getId();
|
||||
this.artistName = itemDto.getArtistItems().get(0).getName();
|
||||
|
||||
itemDto.getArtistItems().forEach(artist -> {
|
||||
artistItems.add(new Artist(artist.getId(), artist.getName()));
|
||||
});
|
||||
}
|
||||
|
||||
this.primary = itemDto.getAlbumPrimaryImageTag() != null ? albumId : null;
|
||||
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
|
||||
this.favorite = itemDto.getUserData() != null && itemDto.getUserData().getIsFavorite();
|
||||
|
||||
if (itemDto.getMediaSources() != null && itemDto.getMediaSources().get(0) != null) {
|
||||
MediaSourceInfo source = itemDto.getMediaSources().get(0);
|
||||
|
||||
this.path = source.getPath();
|
||||
this.size = source.getSize() != null ? source.getSize() : 0;
|
||||
|
||||
this.container = source.getContainer();
|
||||
this.bitRate = source.getBitrate() != null ? source.getBitrate() : 0;
|
||||
|
||||
if (source.getMediaStreams() != null && source.getMediaStreams().size() != 0) {
|
||||
MediaStream stream = source.getMediaStreams().get(0);
|
||||
|
||||
this.codec = stream.getCodec();
|
||||
this.sampleRate = stream.getSampleRate() != null ? stream.getSampleRate() : 0;
|
||||
this.bitDepth = stream.getBitDepth() != null ? stream.getBitDepth() : 0;
|
||||
this.channels = stream.getChannels() != null ? stream.getChannels() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
this.added = Instant.now().toEpochMilli();
|
||||
public Song(Child child) {
|
||||
this.id = child.getId();
|
||||
this.title = child.getTitle();
|
||||
this.trackNumber = child.getTrack();
|
||||
this.discNumber = child.getDiscNumber();
|
||||
this.year = child.getYear();
|
||||
this.duration = child.getDuration();
|
||||
this.albumId = child.getAlbumId();
|
||||
this.albumName = child.getAlbum();
|
||||
this.artistId = child.getArtistId();
|
||||
this.artistName = child.getArtist();
|
||||
this.primary = child.getCoverArtId();
|
||||
this.favorite = child.getStarred() != null;
|
||||
this.path = child.getPath();
|
||||
this.size = child.getSize();
|
||||
this.container = child.getContentType();
|
||||
this.bitRate = child.getBitRate();
|
||||
this.added = child.getCreated().getTime();
|
||||
this.playCount = 0;
|
||||
this.lastPlay = 0;
|
||||
this.offline = false;
|
||||
|
|
@ -283,10 +217,6 @@ public class Song implements Parcelable {
|
|||
return primary;
|
||||
}
|
||||
|
||||
public String getBlurHash() {
|
||||
return blurHash;
|
||||
}
|
||||
|
||||
public boolean isFavorite() {
|
||||
return favorite;
|
||||
}
|
||||
|
|
@ -303,26 +233,10 @@ public class Song implements Parcelable {
|
|||
return container;
|
||||
}
|
||||
|
||||
public String getCodec() {
|
||||
return codec;
|
||||
}
|
||||
|
||||
public int getSampleRate() {
|
||||
return sampleRate;
|
||||
}
|
||||
|
||||
public int getBitRate() {
|
||||
return bitRate;
|
||||
}
|
||||
|
||||
public int getBitDepth() {
|
||||
return bitDepth;
|
||||
}
|
||||
|
||||
public int getChannels() {
|
||||
return channels;
|
||||
}
|
||||
|
||||
public long getAdded() {
|
||||
return added;
|
||||
}
|
||||
|
|
@ -383,10 +297,6 @@ public class Song implements Parcelable {
|
|||
this.primary = primary;
|
||||
}
|
||||
|
||||
public void setBlurHash(String blurHash) {
|
||||
this.blurHash = blurHash;
|
||||
}
|
||||
|
||||
public void setFavorite(boolean favorite) {
|
||||
this.favorite = favorite;
|
||||
}
|
||||
|
|
@ -403,26 +313,10 @@ public class Song implements Parcelable {
|
|||
this.container = container;
|
||||
}
|
||||
|
||||
public void setCodec(String codec) {
|
||||
this.codec = codec;
|
||||
}
|
||||
|
||||
public void setSampleRate(int sampleRate) {
|
||||
this.sampleRate = sampleRate;
|
||||
}
|
||||
|
||||
public void setBitRate(int bitRate) {
|
||||
this.bitRate = bitRate;
|
||||
}
|
||||
|
||||
public void setBitDepth(int bitDepth) {
|
||||
this.bitDepth = bitDepth;
|
||||
}
|
||||
|
||||
public void setChannels(int channels) {
|
||||
this.channels = channels;
|
||||
}
|
||||
|
||||
public void setAdded(long added) {
|
||||
this.added = added;
|
||||
}
|
||||
|
|
@ -481,6 +375,7 @@ public class Song implements Parcelable {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.id);
|
||||
|
|
@ -495,21 +390,17 @@ public class Song implements Parcelable {
|
|||
dest.writeString(this.artistName);
|
||||
dest.writeString(this.primary);
|
||||
dest.writeString(Boolean.toString(favorite));
|
||||
dest.writeString(this.blurHash);
|
||||
dest.writeString(this.path);
|
||||
dest.writeLong(this.size);
|
||||
dest.writeString(this.container);
|
||||
dest.writeString(this.codec);
|
||||
dest.writeInt(this.sampleRate);
|
||||
dest.writeInt(this.bitRate);
|
||||
dest.writeInt(this.bitDepth);
|
||||
dest.writeInt(this.channels);
|
||||
dest.writeLong(this.added);
|
||||
dest.writeInt(this.playCount);
|
||||
dest.writeLong(this.lastPlay);
|
||||
dest.writeBoolean(this.offline);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
protected Song(Parcel in) {
|
||||
this.id = in.readString();
|
||||
this.title = in.readString();
|
||||
|
|
@ -523,15 +414,10 @@ public class Song implements Parcelable {
|
|||
this.artistName = in.readString();
|
||||
this.primary = in.readString();
|
||||
this.favorite = Boolean.parseBoolean(in.readString());
|
||||
this.blurHash = in.readString();
|
||||
this.path = in.readString();
|
||||
this.size = in.readLong();
|
||||
this.container = in.readString();
|
||||
this.codec = in.readString();
|
||||
this.sampleRate = in.readInt();
|
||||
this.bitRate = in.readInt();
|
||||
this.bitDepth = in.readInt();
|
||||
this.channels = in.readInt();
|
||||
this.added = in.readLong();
|
||||
this.playCount = in.readInt();
|
||||
this.lastPlay = in.readLong();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
package com.cappielloantonio.play.subsonic;
|
||||
|
||||
import com.cappielloantonio.play.subsonic.api.albumsonglist.AlbumSongListClient;
|
||||
import com.cappielloantonio.play.subsonic.api.browsing.BrowsingClient;
|
||||
import com.cappielloantonio.play.subsonic.api.mediaretrieval.MediaRetrievalClient;
|
||||
import com.cappielloantonio.play.subsonic.api.playlist.PlaylistClient;
|
||||
import com.cappielloantonio.play.subsonic.api.searching.SearchingClient;
|
||||
import com.cappielloantonio.play.subsonic.api.system.SystemClient;
|
||||
import com.cappielloantonio.play.subsonic.base.Version;
|
||||
import com.cappielloantonio.play.subsonic.models.Playlist;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -14,6 +20,11 @@ public class Subsonic {
|
|||
private Version apiVersion = API_MAX_VERSION;
|
||||
|
||||
private SystemClient systemClient;
|
||||
private BrowsingClient browsingClient;
|
||||
private MediaRetrievalClient mediaRetrievalClient;
|
||||
private PlaylistClient playlistClient;
|
||||
private SearchingClient searchingClient;
|
||||
private AlbumSongListClient albumSongListClient;
|
||||
|
||||
public Subsonic(SubsonicPreferences preferences) {
|
||||
this.preferences = preferences;
|
||||
|
|
@ -34,6 +45,41 @@ public class Subsonic {
|
|||
return systemClient;
|
||||
}
|
||||
|
||||
public BrowsingClient getBrowsingClient() {
|
||||
if (browsingClient == null) {
|
||||
browsingClient = new BrowsingClient(this);
|
||||
}
|
||||
return browsingClient;
|
||||
}
|
||||
|
||||
public MediaRetrievalClient getMediaRetrievalClient() {
|
||||
if (mediaRetrievalClient == null) {
|
||||
mediaRetrievalClient = new MediaRetrievalClient(this);
|
||||
}
|
||||
return mediaRetrievalClient;
|
||||
}
|
||||
|
||||
public PlaylistClient getPlaylistClient() {
|
||||
if (playlistClient == null) {
|
||||
playlistClient = new PlaylistClient(this);
|
||||
}
|
||||
return playlistClient;
|
||||
}
|
||||
|
||||
public SearchingClient getSearchingClient() {
|
||||
if (searchingClient == null) {
|
||||
searchingClient = new SearchingClient(this);
|
||||
}
|
||||
return searchingClient;
|
||||
}
|
||||
|
||||
public AlbumSongListClient getAlbumSongListClient() {
|
||||
if (albumSongListClient == null) {
|
||||
albumSongListClient = new AlbumSongListClient(this);
|
||||
}
|
||||
return albumSongListClient;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return preferences.getServerUrl() + "/rest/";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ public class AlbumSongListClient {
|
|||
this.albumSongListService = retrofit.create(AlbumSongListService.class);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumList() {
|
||||
public Call<SubsonicResponse> getAlbumList(String type, int size, int offset) {
|
||||
Log.d(TAG, "getAlbumList()");
|
||||
return albumSongListService.getAlbumList(subsonic.getParams());
|
||||
return albumSongListService.getAlbumList(subsonic.getParams(), type, size, offset);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getAlbumList2() {
|
||||
public Call<SubsonicResponse> getAlbumList2(String type, int size, int offset) {
|
||||
Log.d(TAG, "getAlbumList2()");
|
||||
return albumSongListService.getAlbumList2(subsonic.getParams());
|
||||
return albumSongListService.getAlbumList2(subsonic.getParams(), type, size, offset);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getRandomSongs(int size) {
|
||||
|
|
@ -45,9 +45,9 @@ public class AlbumSongListClient {
|
|||
return albumSongListService.getRandomSongs(subsonic.getParams(), size);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getSongsByGenre(String genre, int count) {
|
||||
public Call<SubsonicResponse> getSongsByGenre(String genre, int count, int offset) {
|
||||
Log.d(TAG, "getSongsByGenre()");
|
||||
return albumSongListService.getSongsByGenre(subsonic.getParams(), genre, count);
|
||||
return albumSongListService.getSongsByGenre(subsonic.getParams(), genre, count, offset);
|
||||
}
|
||||
|
||||
public Call<SubsonicResponse> getNowPlaying() {
|
||||
|
|
|
|||
|
|
@ -6,20 +6,21 @@ import java.util.Map;
|
|||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface AlbumSongListService {
|
||||
@GET("getAlbumList?type=random")
|
||||
Call<SubsonicResponse> getAlbumList(@QueryMap Map<String, String> params);
|
||||
@GET("getAlbumList")
|
||||
Call<SubsonicResponse> getAlbumList(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset);
|
||||
|
||||
@GET("getAlbumList2?type=random")
|
||||
Call<SubsonicResponse> getAlbumList2(@QueryMap Map<String, String> params);
|
||||
@GET("getAlbumList2")
|
||||
Call<SubsonicResponse> getAlbumList2(@QueryMap Map<String, String> params, @Query("type") String type, @Query("size") int size, @Query("offset") int offset);
|
||||
|
||||
@GET("getRandomSongs?size={size}")
|
||||
Call<SubsonicResponse> getRandomSongs(@QueryMap Map<String, String> params, int size);
|
||||
@GET("getRandomSongs")
|
||||
Call<SubsonicResponse> getRandomSongs(@QueryMap Map<String, String> params, @Query("size") int size);
|
||||
|
||||
@GET("getSongsByGenre?genre={genre}?count={count}")
|
||||
Call<SubsonicResponse> getSongsByGenre(@QueryMap Map<String, String> params, String genre, int count);
|
||||
@GET("getSongsByGenre")
|
||||
Call<SubsonicResponse> 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);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface BrowsingService {
|
||||
|
|
@ -15,8 +16,8 @@ public interface BrowsingService {
|
|||
@GET("getIndexes")
|
||||
Call<SubsonicResponse> getIndexes(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getMusicDirectory?id={id}")
|
||||
Call<SubsonicResponse> getMusicDirectory(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getMusicDirectory")
|
||||
Call<SubsonicResponse> getMusicDirectory(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getGenres")
|
||||
Call<SubsonicResponse> getGenres(@QueryMap Map<String, String> params);
|
||||
|
|
@ -24,39 +25,39 @@ public interface BrowsingService {
|
|||
@GET("getArtists")
|
||||
Call<SubsonicResponse> getArtists(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getArtist?id={id}")
|
||||
Call<SubsonicResponse> getArtist(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getArtist")
|
||||
Call<SubsonicResponse> getArtist(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbum?id={id}")
|
||||
Call<SubsonicResponse> getAlbum(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getAlbum")
|
||||
Call<SubsonicResponse> getAlbum(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSong?id={id}")
|
||||
Call<SubsonicResponse> getSong(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getSong")
|
||||
Call<SubsonicResponse> getSong(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getVideos")
|
||||
Call<SubsonicResponse> getVideos(@QueryMap Map<String, String> params);
|
||||
|
||||
@GET("getVideoInfo?id={id}")
|
||||
Call<SubsonicResponse> getVideoInfo(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getVideoInfo")
|
||||
Call<SubsonicResponse> getVideoInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo?id={id}")
|
||||
Call<SubsonicResponse> getArtistInfo(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getArtistInfo")
|
||||
Call<SubsonicResponse> getArtistInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getArtistInfo2?id={id}")
|
||||
Call<SubsonicResponse> getArtistInfo2(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getArtistInfo2")
|
||||
Call<SubsonicResponse> getArtistInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo?id={id}")
|
||||
Call<SubsonicResponse> getAlbumInfo(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getAlbumInfo")
|
||||
Call<SubsonicResponse> getAlbumInfo(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getAlbumInfo2?id={id}")
|
||||
Call<SubsonicResponse> getAlbumInfo2(@QueryMap Map<String, String> params, String id);
|
||||
@GET("getAlbumInfo2")
|
||||
Call<SubsonicResponse> getAlbumInfo2(@QueryMap Map<String, String> params, @Query("id") String id);
|
||||
|
||||
@GET("getSimilarSongs?id={id}?count={count}")
|
||||
Call<SubsonicResponse> getSimilarSongs(@QueryMap Map<String, String> params, String id, int count);
|
||||
@GET("getSimilarSongs")
|
||||
Call<SubsonicResponse> getSimilarSongs(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getSimilarSongs2?id={id}?count={count}")
|
||||
Call<SubsonicResponse> getSimilarSongs2(@QueryMap Map<String, String> params, String id, int count);
|
||||
@GET("getSimilarSongs2")
|
||||
Call<SubsonicResponse> getSimilarSongs2(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
|
||||
@GET("getTopSongs?id={id}?count={count}")
|
||||
Call<SubsonicResponse> getTopSongs(@QueryMap Map<String, String> params, String id, int count);
|
||||
@GET("getTopSongs")
|
||||
Call<SubsonicResponse> getTopSongs(@QueryMap Map<String, String> params, @Query("id") String id, @Query("count") int count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,247 +1,132 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Xml(name = "album")
|
||||
public class AlbumID3 {
|
||||
@Attribute
|
||||
protected String id;
|
||||
@Attribute
|
||||
protected String name;
|
||||
@Attribute
|
||||
protected String artist;
|
||||
@Attribute
|
||||
protected String artistId;
|
||||
@Attribute
|
||||
protected String coverArtId;
|
||||
@Attribute
|
||||
protected int songCount;
|
||||
@Attribute
|
||||
protected int duration;
|
||||
@Attribute
|
||||
protected Long playCount;
|
||||
protected LocalDateTime created;
|
||||
protected LocalDateTime starred;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date created;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date starred;
|
||||
@Attribute
|
||||
protected Integer year;
|
||||
@Attribute
|
||||
protected String genre;
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artist property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artist property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtist(String value) {
|
||||
this.artist = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artistId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtistId() {
|
||||
return artistId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artistId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtistId(String value) {
|
||||
this.artistId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the coverArtId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getCoverArtId() {
|
||||
return coverArtId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the coverArtId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCoverArtId(String value) {
|
||||
this.coverArtId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the songCount property.
|
||||
*/
|
||||
public int getSongCount() {
|
||||
return songCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the songCount property.
|
||||
*/
|
||||
public void setSongCount(int value) {
|
||||
this.songCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the duration property.
|
||||
*/
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the duration property.
|
||||
*/
|
||||
public void setDuration(int value) {
|
||||
this.duration = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the playCount property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public Long getPlayCount() {
|
||||
return playCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the playCount property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public void setPlayCount(Long value) {
|
||||
this.playCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the created property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getCreated() {
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the created property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCreated(LocalDateTime value) {
|
||||
public void setCreated(Date value) {
|
||||
this.created = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the starred property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getStarred() {
|
||||
public Date getStarred() {
|
||||
return starred;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the starred property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setStarred(LocalDateTime value) {
|
||||
public void setStarred(Date value) {
|
||||
this.starred = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the year property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the year property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setYear(Integer value) {
|
||||
this.year = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the genre property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the genre property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setGenre(String value) {
|
||||
this.genre = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class AlbumList2 {
|
||||
@Element
|
||||
protected List<AlbumID3> albums;
|
||||
|
||||
/**
|
||||
* Gets the value of the albums property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the albums property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAlbums().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link AlbumID3 }
|
||||
*/
|
||||
public List<AlbumID3> getAlbums() {
|
||||
if (albums == null) {
|
||||
albums = new ArrayList<AlbumID3>();
|
||||
albums = new ArrayList<>();
|
||||
}
|
||||
return this.albums;
|
||||
}
|
||||
|
||||
public void setAlbums(List<AlbumID3> albums) {
|
||||
this.albums = albums;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class AlbumWithSongsID3 extends AlbumID3 {
|
||||
@Element(name = "song")
|
||||
protected List<Child> songs;
|
||||
|
||||
/**
|
||||
* Gets the value of the songs property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the songs property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getSongs().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Child }
|
||||
*/
|
||||
|
||||
public List<Child> getSongs() {
|
||||
if (songs == null) {
|
||||
songs = new ArrayList<Child>();
|
||||
songs = new ArrayList<>();
|
||||
}
|
||||
return this.songs;
|
||||
}
|
||||
|
||||
public void setSongs(List<Child> songs) {
|
||||
this.songs = songs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,105 +1,65 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Xml
|
||||
public class ArtistID3 {
|
||||
@Attribute
|
||||
protected String id;
|
||||
@Attribute
|
||||
protected String name;
|
||||
@Attribute(name = "coverArt")
|
||||
protected String coverArtId;
|
||||
@Attribute
|
||||
protected int albumCount;
|
||||
protected LocalDateTime starred;
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date starred;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the coverArtId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getCoverArtId() {
|
||||
return coverArtId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the coverArtId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setCoverArtId(String value) {
|
||||
this.coverArtId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the albumCount property.
|
||||
*/
|
||||
|
||||
public int getAlbumCount() {
|
||||
return albumCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the albumCount property.
|
||||
*/
|
||||
|
||||
public void setAlbumCount(int value) {
|
||||
this.albumCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the starred property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getStarred() {
|
||||
public Date getStarred() {
|
||||
return starred;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the starred property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setStarred(LocalDateTime value) {
|
||||
public void setStarred(Date value) {
|
||||
this.starred = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,55 +1,32 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class ArtistsID3 {
|
||||
@Element(name = "index")
|
||||
protected List<IndexID3> indices;
|
||||
protected String ignoredArticles;
|
||||
|
||||
/**
|
||||
* Gets the value of the indices property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the indices property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getIndices().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link IndexID3 }
|
||||
*/
|
||||
public List<IndexID3> getIndices() {
|
||||
if (indices == null) {
|
||||
indices = new ArrayList<IndexID3>();
|
||||
indices = new ArrayList<>();
|
||||
}
|
||||
return this.indices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the ignoredArticles property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setIndices(List<IndexID3> indices) {
|
||||
this.indices = indices;
|
||||
}
|
||||
|
||||
public String getIgnoredArticles() {
|
||||
return ignoredArticles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the ignoredArticles property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setIgnoredArticles(String value) {
|
||||
this.ignoredArticles = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,650 +1,322 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Xml
|
||||
public class Child {
|
||||
@Attribute
|
||||
protected String id;
|
||||
@Attribute(name = "parent")
|
||||
protected String parentId;
|
||||
@Attribute(name = "isDir")
|
||||
protected boolean dir;
|
||||
@Attribute
|
||||
protected String title;
|
||||
@Attribute
|
||||
protected String album;
|
||||
@Attribute
|
||||
protected String artist;
|
||||
@Attribute
|
||||
protected Integer track;
|
||||
@Attribute
|
||||
protected Integer year;
|
||||
@Attribute(name = "genre")
|
||||
protected String genre;
|
||||
@Attribute(name = "coverArt")
|
||||
protected String coverArtId;
|
||||
@Attribute
|
||||
protected Long size;
|
||||
@Attribute
|
||||
protected String contentType;
|
||||
@Attribute
|
||||
protected String suffix;
|
||||
@Attribute
|
||||
protected String transcodedContentType;
|
||||
@Attribute
|
||||
protected String transcodedSuffix;
|
||||
@Attribute
|
||||
protected Integer duration;
|
||||
@Attribute
|
||||
protected Integer bitRate;
|
||||
@Attribute
|
||||
protected String path;
|
||||
@Attribute(name = "isVideo")
|
||||
protected Boolean video;
|
||||
@Attribute
|
||||
protected Integer userRating;
|
||||
@Attribute
|
||||
protected Double averageRating;
|
||||
@Attribute
|
||||
protected Long playCount;
|
||||
@Attribute
|
||||
protected Integer discNumber;
|
||||
protected LocalDateTime created;
|
||||
protected LocalDateTime starred;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date created;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date starred;
|
||||
@Attribute
|
||||
protected String albumId;
|
||||
@Attribute
|
||||
protected String artistId;
|
||||
@Element
|
||||
protected MediaType type;
|
||||
@Attribute
|
||||
protected Long bookmarkPosition;
|
||||
@Attribute
|
||||
protected Integer originalWidth;
|
||||
@Attribute
|
||||
protected Integer originalHeight;
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
@Attribute
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the parentId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the parentId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setParentId(String value) {
|
||||
this.parentId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the dir property.
|
||||
*/
|
||||
public boolean isDir() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the dir property.
|
||||
*/
|
||||
public void setDir(boolean value) {
|
||||
this.dir = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the title property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the title property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setTitle(String value) {
|
||||
this.title = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the album property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getAlbum() {
|
||||
return album;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the album property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setAlbum(String value) {
|
||||
this.album = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artist property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtist() {
|
||||
return artist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artist property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtist(String value) {
|
||||
this.artist = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the track property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getTrack() {
|
||||
return track;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the track property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setTrack(Integer value) {
|
||||
this.track = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the year property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the year property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setYear(Integer value) {
|
||||
this.year = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the genre property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the genre property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setGenre(String value) {
|
||||
this.genre = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the coverArtId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getCoverArtId() {
|
||||
return coverArtId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the coverArtId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCoverArtId(String value) {
|
||||
this.coverArtId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the size property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public Long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the size property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public void setSize(Long value) {
|
||||
this.size = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the contentType property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the contentType property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setContentType(String value) {
|
||||
this.contentType = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the suffix property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the suffix property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setSuffix(String value) {
|
||||
this.suffix = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the transcodedContentType property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getTranscodedContentType() {
|
||||
return transcodedContentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the transcodedContentType property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setTranscodedContentType(String value) {
|
||||
this.transcodedContentType = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the transcodedSuffix property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getTranscodedSuffix() {
|
||||
return transcodedSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the transcodedSuffix property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setTranscodedSuffix(String value) {
|
||||
this.transcodedSuffix = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the duration property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the duration property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setDuration(Integer value) {
|
||||
this.duration = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the bitRate property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getBitRate() {
|
||||
return bitRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the bitRate property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setBitRate(Integer value) {
|
||||
this.bitRate = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the path property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the path property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setPath(String value) {
|
||||
this.path = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the video property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Boolean }
|
||||
*/
|
||||
public Boolean isVideo() {
|
||||
return video;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the video property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Boolean }
|
||||
*/
|
||||
public void setVideo(Boolean value) {
|
||||
this.video = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the userRating property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getUserRating() {
|
||||
return userRating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the userRating property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setUserRating(Integer value) {
|
||||
this.userRating = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the averageRating property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Double }
|
||||
*/
|
||||
public Double getAverageRating() {
|
||||
return averageRating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the averageRating property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Double }
|
||||
*/
|
||||
public void setAverageRating(Double value) {
|
||||
this.averageRating = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the playCount property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public Long getPlayCount() {
|
||||
return playCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the playCount property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public void setPlayCount(Long value) {
|
||||
this.playCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the discNumber property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getDiscNumber() {
|
||||
return discNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the discNumber property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setDiscNumber(Integer value) {
|
||||
this.discNumber = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the created property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getCreated() {
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the created property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCreated(LocalDateTime value) {
|
||||
public void setCreated(Date value) {
|
||||
this.created = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the starred property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getStarred() {
|
||||
public Date getStarred() {
|
||||
return starred;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the starred property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setStarred(LocalDateTime value) {
|
||||
public void setStarred(Date value) {
|
||||
this.starred = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the albumId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getAlbumId() {
|
||||
return albumId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the albumId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setAlbumId(String value) {
|
||||
this.albumId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the artistId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getArtistId() {
|
||||
return artistId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the artistId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtistId(String value) {
|
||||
this.artistId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the type property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link MediaType }
|
||||
*/
|
||||
public MediaType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the type property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link MediaType }
|
||||
*/
|
||||
public void setType(MediaType value) {
|
||||
this.type = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the bookmarkPosition property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public Long getBookmarkPosition() {
|
||||
return bookmarkPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the bookmarkPosition property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Long }
|
||||
*/
|
||||
public void setBookmarkPosition(Long value) {
|
||||
this.bookmarkPosition = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the originalWidth property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getOriginalWidth() {
|
||||
return originalWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the originalWidth property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setOriginalWidth(Integer value) {
|
||||
this.originalWidth = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the originalHeight property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public Integer getOriginalHeight() {
|
||||
return originalHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the originalHeight property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Integer }
|
||||
*/
|
||||
public void setOriginalHeight(Integer value) {
|
||||
this.originalHeight = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,54 +1,38 @@
|
|||
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
|
||||
public class Genre {
|
||||
protected String name;
|
||||
@TextContent
|
||||
protected String genre;
|
||||
@Attribute
|
||||
protected int songCount;
|
||||
@Attribute
|
||||
protected int albumCount;
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
public void setGenre(String value) {
|
||||
this.genre = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the songCount property.
|
||||
*/
|
||||
public int getSongCount() {
|
||||
return songCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the songCount property.
|
||||
*/
|
||||
public void setSongCount(int value) {
|
||||
this.songCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the albumCount property.
|
||||
*/
|
||||
public int getAlbumCount() {
|
||||
return albumCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the albumCount property.
|
||||
*/
|
||||
public void setAlbumCount(int value) {
|
||||
this.albumCount = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class Genres {
|
||||
@Element
|
||||
protected List<Genre> genres;
|
||||
|
||||
/**
|
||||
* Gets the value of the genres property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the genres property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getGenres().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Genre }
|
||||
*/
|
||||
public List<Genre> getGenres() {
|
||||
if (genres == null) {
|
||||
genres = new ArrayList<Genre>();
|
||||
genres = new ArrayList<>();
|
||||
}
|
||||
return this.genres;
|
||||
}
|
||||
|
||||
public void setGenres(List<Genre> genres) {
|
||||
this.genres = genres;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,32 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class IndexID3 {
|
||||
@Element(name = "artist")
|
||||
protected List<ArtistID3> artists;
|
||||
protected String name;
|
||||
|
||||
/**
|
||||
* Gets the value of the artists property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the artists property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getArtists().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link ArtistID3 }
|
||||
*/
|
||||
public List<ArtistID3> getArtists() {
|
||||
if (artists == null) {
|
||||
artists = new ArrayList<ArtistID3>();
|
||||
artists = new ArrayList<>();
|
||||
}
|
||||
return this.artists;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setArtists(List<ArtistID3> artists) {
|
||||
this.artists = artists;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,23 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
public enum MediaType {
|
||||
MUSIC("music"),
|
||||
PODCAST("podcast"),
|
||||
AUDIOBOOK("audiobook"),
|
||||
VIDEO("video");
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
private final String value;
|
||||
@Xml
|
||||
public class MediaType {
|
||||
public static String MUSIC = "music";
|
||||
public static String PODCAST = "podcast";
|
||||
public static String AUDIOBOOK = "audiobook";
|
||||
public static String VIDEO = "video";
|
||||
|
||||
MediaType(String v) {
|
||||
value = v;
|
||||
}
|
||||
@Attribute
|
||||
private String value;
|
||||
|
||||
public String value() {
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static MediaType fromValue(String v) {
|
||||
for (MediaType c : MediaType.values()) {
|
||||
if (c.value.equals(v)) {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException(v);
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,27 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
public class MusicFolder {
|
||||
protected int id;
|
||||
protected String name;
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*/
|
||||
@Xml
|
||||
public class MusicFolder {
|
||||
@Attribute
|
||||
protected int id;
|
||||
@Attribute
|
||||
protected String name;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*/
|
||||
public void setId(int value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class MusicFolders {
|
||||
@Element
|
||||
protected List<MusicFolder> musicFolders;
|
||||
|
||||
/**
|
||||
* Gets the value of the musicFolders property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the musicFolders property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getMusicFolders().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link MusicFolder }
|
||||
*/
|
||||
public List<MusicFolder> getMusicFolders() {
|
||||
if (musicFolders == null) {
|
||||
musicFolders = new ArrayList<MusicFolder>();
|
||||
musicFolders = new ArrayList<>();
|
||||
}
|
||||
return this.musicFolders;
|
||||
}
|
||||
|
||||
public void setMusicFolders(List<MusicFolder> musicFolders) {
|
||||
this.musicFolders = musicFolders;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,233 +1,126 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Attribute;
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
import com.tickaroo.tikxml.converters.date.rfc3339.DateRfc3339TypeConverter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class Playlist {
|
||||
protected List<String> allowedUsers;
|
||||
@Attribute
|
||||
protected String id;
|
||||
@Attribute
|
||||
protected String name;
|
||||
@Attribute
|
||||
protected String comment;
|
||||
@Attribute
|
||||
protected String owner;
|
||||
protected Boolean _public;
|
||||
@Attribute(name = "public")
|
||||
protected Boolean universal;
|
||||
@Attribute
|
||||
protected int songCount;
|
||||
@Attribute
|
||||
protected int duration;
|
||||
protected LocalDateTime created;
|
||||
protected LocalDateTime changed;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date created;
|
||||
@Attribute(converter = DateRfc3339TypeConverter.class)
|
||||
protected Date changed;
|
||||
@Attribute
|
||||
protected String coverArtId;
|
||||
|
||||
/**
|
||||
* Gets the value of the allowedUsers property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the allowedUsers property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getAllowedUsers().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public List<String> getAllowedUsers() {
|
||||
if (allowedUsers == null) {
|
||||
allowedUsers = new ArrayList<String>();
|
||||
allowedUsers = new ArrayList<>();
|
||||
}
|
||||
return this.allowedUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the id property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setAllowedUsers(List<String> allowedUsers) {
|
||||
this.allowedUsers = allowedUsers;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the id property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setId(String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the name property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the name property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setName(String value) {
|
||||
this.name = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the comment property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the comment property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setComment(String value) {
|
||||
this.comment = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the owner property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the owner property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
|
||||
public void setOwner(String value) {
|
||||
this.owner = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the public property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link Boolean }
|
||||
*/
|
||||
public Boolean isPublic() {
|
||||
return _public;
|
||||
public Boolean isUniversal() {
|
||||
return universal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the public property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link Boolean }
|
||||
*/
|
||||
public void setPublic(Boolean value) {
|
||||
this._public = value;
|
||||
public void setUniversal(Boolean value) {
|
||||
this.universal = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the songCount property.
|
||||
*/
|
||||
public int getSongCount() {
|
||||
return songCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the songCount property.
|
||||
*/
|
||||
|
||||
public void setSongCount(int value) {
|
||||
this.songCount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the duration property.
|
||||
*/
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the duration property.
|
||||
*/
|
||||
|
||||
public void setDuration(int value) {
|
||||
this.duration = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the created property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getCreated() {
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the created property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCreated(LocalDateTime value) {
|
||||
public void setCreated(Date value) {
|
||||
this.created = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the changed property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public LocalDateTime getChanged() {
|
||||
|
||||
public Date getChanged() {
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the changed property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setChanged(LocalDateTime value) {
|
||||
public void setChanged(Date value) {
|
||||
this.changed = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the coverArtId property.
|
||||
*
|
||||
* @return possible object is
|
||||
* {@link String }
|
||||
*/
|
||||
public String getCoverArtId() {
|
||||
return coverArtId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the coverArtId property.
|
||||
*
|
||||
* @param value allowed object is
|
||||
* {@link String }
|
||||
*/
|
||||
public void setCoverArtId(String value) {
|
||||
this.coverArtId = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class PlaylistWithSongs extends Playlist {
|
||||
@Element(name = "entry")
|
||||
protected List<Child> entries;
|
||||
|
||||
/**
|
||||
* Gets the value of the entries property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the entries property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getEntries().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Child }
|
||||
*/
|
||||
public List<Child> getEntries() {
|
||||
if (entries == null) {
|
||||
entries = new ArrayList<Child>();
|
||||
entries = new ArrayList<>();
|
||||
}
|
||||
return this.entries;
|
||||
}
|
||||
|
||||
public void setEntries(List<Child> entries) {
|
||||
this.entries = entries;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,24 @@
|
|||
package com.cappielloantonio.play.subsonic.models;
|
||||
|
||||
import com.tickaroo.tikxml.annotation.Element;
|
||||
import com.tickaroo.tikxml.annotation.Xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Xml
|
||||
public class Playlists {
|
||||
@Element
|
||||
protected List<Playlist> playlists;
|
||||
|
||||
/**
|
||||
* Gets the value of the playlists property.
|
||||
*
|
||||
* <p>
|
||||
* This accessor method returns a reference to the live list,
|
||||
* not a snapshot. Therefore any modification you make to the
|
||||
* returned list will be present inside the JAXB object.
|
||||
* This is why there is not a <CODE>set</CODE> method for the playlists property.
|
||||
*
|
||||
* <p>
|
||||
* For example, to add a new item, do as follows:
|
||||
* <pre>
|
||||
* getPlaylists().add(newItem);
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* Objects of the following type(s) are allowed in the list
|
||||
* {@link Playlist }
|
||||
*/
|
||||
public List<Playlist> getPlaylists() {
|
||||
if (playlists == null) {
|
||||
playlists = new ArrayList<Playlist>();
|
||||
playlists = new ArrayList<>();
|
||||
}
|
||||
return this.playlists;
|
||||
}
|
||||
|
||||
public void setPlaylists(List<Playlist> playlists) {
|
||||
this.playlists = playlists;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class SubsonicResponse {
|
|||
private Lyrics lyrics;
|
||||
private Songs songsByGenre;
|
||||
private Songs randomSongs;
|
||||
@Element
|
||||
private AlbumList2 albumList2;
|
||||
private AlbumList albumList;
|
||||
private ChatMessages chatMessages;
|
||||
|
|
@ -35,7 +36,9 @@ public class SubsonicResponse {
|
|||
private License license;
|
||||
private JukeboxPlaylist jukeboxPlaylist;
|
||||
private JukeboxStatus jukeboxStatus;
|
||||
@Element
|
||||
private PlaylistWithSongs playlist;
|
||||
@Element
|
||||
private Playlists playlists;
|
||||
private SearchResult3 searchResult3;
|
||||
private SearchResult2 searchResult2;
|
||||
|
|
@ -44,12 +47,16 @@ public class SubsonicResponse {
|
|||
private VideoInfo videoInfo;
|
||||
private Videos videos;
|
||||
private Child song;
|
||||
@Element(name = "album")
|
||||
private AlbumWithSongsID3 album;
|
||||
private ArtistWithAlbumsID3 artist;
|
||||
@Element(name = "artists")
|
||||
private ArtistsID3 artists;
|
||||
@Element
|
||||
private Genres genres;
|
||||
private Directory directory;
|
||||
private Indexes indexes;
|
||||
@Element
|
||||
private MusicFolders musicFolders;
|
||||
@Attribute(converter = ResponseStatusConverter.class)
|
||||
private ResponseStatus status;
|
||||
|
|
|
|||
|
|
@ -217,11 +217,11 @@ public class MainActivity extends BaseActivity {
|
|||
setBottomSheetVisibility(false);
|
||||
|
||||
if (Objects.requireNonNull(navController.getCurrentDestination()).getId() == R.id.loginFragment) {
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true, true);
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true);
|
||||
navController.navigate(R.id.action_loginFragment_to_syncFragment, bundle);
|
||||
}
|
||||
else if (Objects.requireNonNull(navController.getCurrentDestination()).getId() == R.id.landingFragment) {
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true, true);
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true);
|
||||
navController.navigate(R.id.action_landingFragment_to_syncFragment, bundle);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,11 +14,16 @@ import androidx.fragment.app.Fragment;
|
|||
|
||||
import com.cappielloantonio.play.App;
|
||||
import com.cappielloantonio.play.databinding.FragmentLoginBinding;
|
||||
import com.cappielloantonio.play.helper.ErrorHelper;
|
||||
import com.cappielloantonio.play.subsonic.models.Genre;
|
||||
import com.cappielloantonio.play.subsonic.models.ResponseStatus;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.PreferenceUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
|
|
@ -91,21 +96,22 @@ public class LoginFragment extends Fragment {
|
|||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
int code = response.body().getError().getCode().getValue();
|
||||
String message = response.body().getError().getMessage();
|
||||
Toast.makeText(requireContext(), code + " - " + message, Toast.LENGTH_LONG).show();
|
||||
ErrorHelper.handle(requireContext(), response.body().getError().getCode().getValue(), response.body().getError().getMessage());
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
Toast.makeText(requireContext(), response.body().getStatus().getValue(), Toast.LENGTH_LONG).show();
|
||||
enter();
|
||||
} else {
|
||||
Toast.makeText(requireContext(), "Empty response", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
Log.d(TAG, "+++ " + t.getMessage());
|
||||
Log.e(TAG, t.getMessage());
|
||||
Toast.makeText(requireContext(), t.getMessage(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void enter() {
|
||||
activity.goFromLogin();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
|||
PreferenceUtil.getInstance(requireContext()).setSync(false);
|
||||
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(false);
|
||||
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true, true);
|
||||
Bundle bundle = SyncUtil.getSyncBundle(true, true, true, true, true);
|
||||
activity.goFromSettingsToSync(bundle);
|
||||
})
|
||||
.show();
|
||||
|
|
@ -78,7 +78,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
|
|||
.setTitle("Force sync playlist")
|
||||
.setNegativeButton(R.string.ignore, null)
|
||||
.setPositiveButton("Sync", (dialog, id) -> {
|
||||
Bundle bundle = SyncUtil.getSyncBundle(false, false, false, true, false, false);
|
||||
Bundle bundle = SyncUtil.getSyncBundle(false, false, false, true, false);
|
||||
activity.goFromSettingsToSync(bundle);
|
||||
})
|
||||
.show();
|
||||
|
|
|
|||
|
|
@ -17,12 +17,10 @@ import com.cappielloantonio.play.interfaces.MediaCallback;
|
|||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.AlbumArtistCross;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Genre;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.PlaylistSongCross;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.SongArtistCross;
|
||||
import com.cappielloantonio.play.model.SongGenreCross;
|
||||
import com.cappielloantonio.play.repository.AlbumArtistRepository;
|
||||
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||
|
|
@ -32,6 +30,10 @@ import com.cappielloantonio.play.repository.PlaylistSongRepository;
|
|||
import com.cappielloantonio.play.repository.SongArtistRepository;
|
||||
import com.cappielloantonio.play.repository.SongGenreRepository;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||
import com.cappielloantonio.play.subsonic.models.ArtistID3;
|
||||
import com.cappielloantonio.play.subsonic.models.Child;
|
||||
import com.cappielloantonio.play.subsonic.models.Genre;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.DownloadUtil;
|
||||
import com.cappielloantonio.play.util.PreferenceUtil;
|
||||
|
|
@ -39,8 +41,6 @@ import com.cappielloantonio.play.util.SyncUtil;
|
|||
import com.cappielloantonio.play.util.Util;
|
||||
import com.cappielloantonio.play.viewmodel.SyncViewModel;
|
||||
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -56,9 +56,6 @@ public class SyncFragment extends Fragment {
|
|||
private ArtistRepository artistRepository;
|
||||
private PlaylistRepository playlistRepository;
|
||||
private GenreRepository genreRepository;
|
||||
private SongGenreRepository songGenreRepository;
|
||||
private SongArtistRepository songArtistRepository;
|
||||
private AlbumArtistRepository albumArtistRepository;
|
||||
private PlaylistSongRepository playlistSongRepository;
|
||||
|
||||
private final int LIBRARIES = 0;
|
||||
|
|
@ -67,8 +64,7 @@ public class SyncFragment extends Fragment {
|
|||
private final int GENRES = 3;
|
||||
private final int PLAYLISTS = 4;
|
||||
private final int SONGS = 5;
|
||||
private final int SONG_X_GENRE = 6;
|
||||
private final int SONG_X_PLAYLIST = 7;
|
||||
private final int SONG_X_PLAYLIST = 6;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
|
@ -84,9 +80,6 @@ public class SyncFragment extends Fragment {
|
|||
artistRepository = new ArtistRepository(activity.getApplication());
|
||||
playlistRepository = new PlaylistRepository(activity.getApplication());
|
||||
genreRepository = new GenreRepository(activity.getApplication());
|
||||
songGenreRepository = new SongGenreRepository(activity.getApplication());
|
||||
songArtistRepository = new SongArtistRepository(activity.getApplication());
|
||||
albumArtistRepository = new AlbumArtistRepository(activity.getApplication());
|
||||
playlistSongRepository = new PlaylistSongRepository(activity.getApplication());
|
||||
|
||||
init();
|
||||
|
|
@ -105,7 +98,6 @@ public class SyncFragment extends Fragment {
|
|||
|
||||
private void init() {
|
||||
syncViewModel.setArguemnts(getArguments());
|
||||
|
||||
bind.syncingDateLabel.setText(Util.getDate());
|
||||
}
|
||||
|
||||
|
|
@ -116,8 +108,6 @@ public class SyncFragment extends Fragment {
|
|||
if (!syncViewModel.isSyncPlaylist()) bind.syncPlaylistsSector.setVisibility(View.GONE);
|
||||
if (!syncViewModel.isSyncPlaylist()) bind.syncSongXPlaylistSector.setVisibility(View.GONE);
|
||||
if (!syncViewModel.isSyncSong()) bind.syncSongsSector.setVisibility(View.GONE);
|
||||
if (!syncViewModel.isCrossSyncSongGenre())
|
||||
bind.syncSongXGenreSector.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void initButtonListeners() {
|
||||
|
|
@ -127,7 +117,7 @@ public class SyncFragment extends Fragment {
|
|||
});
|
||||
bind.syncAlbumsRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(ALBUMS);
|
||||
syncAlbums();
|
||||
syncAlbums(500, 0, 0);
|
||||
});
|
||||
bind.syncArtistsRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(ARTISTS);
|
||||
|
|
@ -141,18 +131,14 @@ public class SyncFragment extends Fragment {
|
|||
resetSectorInfo(PLAYLISTS);
|
||||
syncPlaylist();
|
||||
});
|
||||
bind.syncSongsRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(SONGS);
|
||||
syncSongs();
|
||||
});
|
||||
bind.syncSongXGenreRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(SONG_X_GENRE);
|
||||
syncSongsPerGenre(syncViewModel.getGenreList());
|
||||
});
|
||||
bind.syncSongXPlaylistRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(SONG_X_PLAYLIST);
|
||||
syncSongsPerPlaylist(syncViewModel.getPlaylistList());
|
||||
});
|
||||
bind.syncSongsRetryImageView.setOnClickListener(v -> {
|
||||
resetSectorInfo(SONGS);
|
||||
syncSongs();
|
||||
});
|
||||
bind.syncingGoHomeImageView.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
builder.setMessage("Make sure each category has been properly synchronized")
|
||||
|
|
@ -175,20 +161,12 @@ public class SyncFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
List<BaseItemDto> libraries = (List<BaseItemDto>) media;
|
||||
|
||||
for (BaseItemDto itemDto : libraries) {
|
||||
if (itemDto.getCollectionType().equals("music")) {
|
||||
PreferenceUtil.getInstance(requireContext()).setMusicLibraryID(itemDto.getId());
|
||||
}
|
||||
}
|
||||
|
||||
loadSectorInfo(LIBRARIES, "", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void syncAlbums() {
|
||||
private void syncAlbums(int size, int offset, int page) {
|
||||
SyncUtil.getAlbums(requireContext(), new MediaCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
|
|
@ -197,12 +175,15 @@ public class SyncFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.setAlbumList((ArrayList<Album>) media);
|
||||
albumRepository.insertAll(syncViewModel.getAlbumList());
|
||||
syncAlbumArtistCross(syncViewModel.getAlbumList());
|
||||
loadSectorInfo(ALBUMS, "Found " + syncViewModel.getAlbumList().size() + " elements", true);
|
||||
syncViewModel.addToAlbumList((List<AlbumID3>) media);
|
||||
|
||||
if (media.size() == size) {
|
||||
syncAlbums(size, size * (page + 1), page + 1);
|
||||
} else {
|
||||
loadSectorInfo(ALBUMS, "Found " + syncViewModel.getAlbumList().size() + " elements", true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, size, offset);
|
||||
}
|
||||
|
||||
private void syncArtists() {
|
||||
|
|
@ -214,8 +195,7 @@ public class SyncFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.setArtistList((ArrayList<Artist>) media);
|
||||
artistRepository.insertAll(syncViewModel.getArtistList());
|
||||
syncViewModel.setArtistList((ArrayList<ArtistID3>) media);
|
||||
loadSectorInfo(ARTISTS, "Found " + syncViewModel.getArtistList().size() + " elements", true);
|
||||
}
|
||||
});
|
||||
|
|
@ -231,8 +211,6 @@ public class SyncFragment extends Fragment {
|
|||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.setGenreList((ArrayList<Genre>) media);
|
||||
songGenreRepository.deleteAll();
|
||||
genreRepository.insertAll(syncViewModel.getGenreList());
|
||||
loadSectorInfo(GENRES, "Found " + syncViewModel.getGenreList().size() + " elements", true);
|
||||
}
|
||||
});
|
||||
|
|
@ -248,53 +226,13 @@ public class SyncFragment extends Fragment {
|
|||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.setPlaylistList((ArrayList<Playlist>) media);
|
||||
playlistSongRepository.deleteAll();
|
||||
playlistRepository.insertAll(syncViewModel.getPlaylistList());
|
||||
loadSectorInfo(PLAYLISTS, "Found " + syncViewModel.getPlaylistList().size() + " elements", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void syncSongs() {
|
||||
SyncUtil.getSongs(requireContext(), syncViewModel.getCatalogue(), new MediaCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
loadSectorInfo(SONGS, exception.getMessage(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.setSongList((ArrayList<Song>) media);
|
||||
songRepository.insertAll(syncViewModel.getSongList());
|
||||
syncSongArtistCross(syncViewModel.getSongList());
|
||||
syncDownloadedSong();
|
||||
loadSectorInfo(SONGS, "Found " + syncViewModel.getSongList().size() + " elements", true);
|
||||
PreferenceUtil.getInstance(requireContext()).setSongNumber(syncViewModel.getSongList().size());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void syncSongsPerGenre(List<Genre> genres) {
|
||||
for (Genre genre : genres) {
|
||||
SyncUtil.getSongsPerGenre(requireContext(), new MediaCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
loadSectorInfo(SONG_X_GENRE, exception.getMessage(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
songGenreRepository.insertAll((ArrayList<SongGenreCross>) media);
|
||||
loadSectorInfo(SONG_X_GENRE, "Genre processed: " + genre.getName(), true);
|
||||
}
|
||||
}, genre.id);
|
||||
}
|
||||
|
||||
PreferenceUtil.getInstance(requireContext()).setSongGenreSync(true);
|
||||
}
|
||||
|
||||
private void syncSongsPerPlaylist(List<Playlist> playlists) {
|
||||
for (Playlist playlist : playlists) {
|
||||
/* for (Playlist playlist : playlists) {
|
||||
SyncUtil.getSongsPerPlaylist(requireContext(), new MediaCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
|
|
@ -307,62 +245,30 @@ public class SyncFragment extends Fragment {
|
|||
loadSectorInfo(SONG_X_PLAYLIST, "Playlist processed: " + playlist.getName(), true);
|
||||
}
|
||||
}, playlist.getId());
|
||||
}
|
||||
} */
|
||||
|
||||
loadSectorInfo(SONG_X_PLAYLIST, "Playlist processed: SEI BRAVO", true);
|
||||
enableHomeButton(SONG_X_PLAYLIST);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
/*
|
||||
* Sincronizzazzione dell'album con gli artisti che lo hanno prodotto | isProduced = true
|
||||
* Sincronizzazzione dell'album con gli artisti che hanno collaborato per la sua produzione | isProduced = false
|
||||
*/
|
||||
private void syncAlbumArtistCross(ArrayList<Album> albums) {
|
||||
List<AlbumArtistCross> crosses = new ArrayList<>();
|
||||
private void syncSongs() {
|
||||
enableHomeButton(SONGS);
|
||||
|
||||
for (Album album : albums) {
|
||||
List<Artist> artists = new ArrayList<>();
|
||||
|
||||
if (album.albumArtists.size() > 0) {
|
||||
for (Artist artist : album.albumArtists) {
|
||||
artists.add(artist);
|
||||
crosses.add(new AlbumArtistCross(album.getId(), artist.getId(), true));
|
||||
for (AlbumID3 album : syncViewModel.getAlbumList()) {
|
||||
SyncUtil.getSongs(requireContext(), new MediaCallback() {
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
loadSectorInfo(SONGS, exception.getMessage(), false);
|
||||
}
|
||||
}
|
||||
|
||||
if (album.artistItems.size() > 0) {
|
||||
for (Artist artist : album.artistItems) {
|
||||
if (!artists.contains(artist)) {
|
||||
crosses.add(new AlbumArtistCross(album.getId(), artist.getId(), false));
|
||||
}
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
syncViewModel.addToChildList((ArrayList<Child>) media);
|
||||
|
||||
loadSectorInfo(SONGS, "Found " + syncViewModel.getChildList().size() + " elements", true);
|
||||
}
|
||||
}
|
||||
}, album);
|
||||
}
|
||||
|
||||
albumArtistRepository.insertAll(crosses);
|
||||
}
|
||||
|
||||
private void syncSongArtistCross(ArrayList<Song> songs) {
|
||||
List<SongArtistCross> crosses = new ArrayList<>();
|
||||
|
||||
for (Song song : songs) {
|
||||
List<Artist> artists = new ArrayList<>();
|
||||
|
||||
if (song.albumArtists.size() > 0) {
|
||||
for (Artist artist : song.albumArtists) {
|
||||
artists.add(artist);
|
||||
crosses.add(new SongArtistCross(song.getId(), artist.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
if (song.artistItems.size() > 0) {
|
||||
for (Artist artist : song.artistItems) {
|
||||
if (!artists.contains(artist)) {
|
||||
crosses.add(new SongArtistCross(song.getId(), artist.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
songArtistRepository.insertAll(crosses);
|
||||
}
|
||||
|
||||
private void syncDownloadedSong() {
|
||||
|
|
@ -402,8 +308,6 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncAlbumsDetailLabel.setText(message);
|
||||
bind.syncAlbumsRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
syncViewModel.increaseProggress();
|
||||
checkStep();
|
||||
syncNextSector(ALBUMS);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
|
|
@ -420,8 +324,6 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncArtistsDetailLabel.setText(message);
|
||||
bind.syncArtistsRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
syncViewModel.increaseProggress();
|
||||
checkStep();
|
||||
syncNextSector(ARTISTS);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
|
|
@ -438,8 +340,6 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncGenresDetailLabel.setText(message);
|
||||
bind.syncGenresRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
syncViewModel.increaseProggress();
|
||||
checkStep();
|
||||
syncNextSector(GENRES);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
|
|
@ -456,8 +356,6 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncPlaylistsDetailLabel.setText(message);
|
||||
bind.syncPlaylistsRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
syncViewModel.increaseProggress();
|
||||
checkStep();
|
||||
syncNextSector(PLAYLISTS);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
|
|
@ -467,40 +365,6 @@ public class SyncFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case SONGS:
|
||||
if (isSuccess) {
|
||||
if (bind != null) {
|
||||
bind.syncSongsStatusLabel.setText("Status: SUCCESS");
|
||||
bind.syncSongsDetailLabel.setText(message);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
syncViewModel.increaseProggress();
|
||||
checkStep();
|
||||
syncNextSector(SONGS);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
bind.syncSongsStatusLabel.setText("Status: ERROR");
|
||||
bind.syncSongsDetailLabel.setText(message);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SONG_X_GENRE:
|
||||
if (isSuccess) {
|
||||
if (bind != null) {
|
||||
bind.syncSongXGenreStatusLabel.setText("Status: SUCCESS");
|
||||
bind.syncSongXGenreDetailLabel.setText(message);
|
||||
bind.syncSongXGenreRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
checkStep();
|
||||
} else {
|
||||
if (bind != null) {
|
||||
bind.syncSongXGenreStatusLabel.setText("Status: ERROR");
|
||||
bind.syncSongXGenreDetailLabel.setText(message);
|
||||
bind.syncSongXGenreRetryImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SONG_X_PLAYLIST:
|
||||
if (isSuccess) {
|
||||
if (bind != null) {
|
||||
|
|
@ -508,7 +372,7 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncSongXPlaylistDetailLabel.setText(message);
|
||||
bind.syncSongXPlaylistRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
checkStep();
|
||||
syncNextSector(SONG_X_PLAYLIST);
|
||||
} else {
|
||||
if (bind != null) {
|
||||
bind.syncSongXPlaylistStatusLabel.setText("Status: ERROR");
|
||||
|
|
@ -517,6 +381,21 @@ public class SyncFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case SONGS:
|
||||
if (isSuccess) {
|
||||
if (bind != null) {
|
||||
bind.syncSongsStatusLabel.setText("Status: SUCCESS");
|
||||
bind.syncSongsDetailLabel.setText(message);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (bind != null) {
|
||||
bind.syncSongsStatusLabel.setText("Status: ERROR");
|
||||
bind.syncSongsDetailLabel.setText(message);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -549,21 +428,16 @@ public class SyncFragment extends Fragment {
|
|||
bind.syncPlaylistsDetailLabel.setText(R.string.label_placeholder);
|
||||
bind.syncPlaylistsRetryImageView.setVisibility(View.GONE);
|
||||
break;
|
||||
case SONGS:
|
||||
bind.syncSongsStatusLabel.setText("Loading...");
|
||||
bind.syncSongsDetailLabel.setText(R.string.label_placeholder);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.GONE);
|
||||
break;
|
||||
case SONG_X_GENRE:
|
||||
bind.syncSongXGenreStatusLabel.setText("Loading...");
|
||||
bind.syncSongXGenreDetailLabel.setText(R.string.label_placeholder);
|
||||
bind.syncSongXGenreRetryImageView.setVisibility(View.GONE);
|
||||
break;
|
||||
case SONG_X_PLAYLIST:
|
||||
bind.syncSongXPlaylistStatusLabel.setText("Loading...");
|
||||
bind.syncSongXPlaylistDetailLabel.setText(R.string.label_placeholder);
|
||||
bind.syncSongXPlaylistRetryImageView.setVisibility(View.GONE);
|
||||
break;
|
||||
case SONGS:
|
||||
bind.syncSongsStatusLabel.setText("Loading...");
|
||||
bind.syncSongsDetailLabel.setText(R.string.label_placeholder);
|
||||
bind.syncSongsRetryImageView.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -571,7 +445,7 @@ public class SyncFragment extends Fragment {
|
|||
private void syncNextSector(int sector) {
|
||||
switch (sector) {
|
||||
case LIBRARIES:
|
||||
if (syncViewModel.isSyncAlbum()) syncAlbums();
|
||||
if (syncViewModel.isSyncAlbum()) syncAlbums(500, 0, 0);
|
||||
else syncPlaylist();
|
||||
break;
|
||||
case ALBUMS:
|
||||
|
|
@ -584,21 +458,24 @@ public class SyncFragment extends Fragment {
|
|||
syncPlaylist();
|
||||
break;
|
||||
case PLAYLISTS:
|
||||
if (syncViewModel.isSyncSong()) syncSongs();
|
||||
else syncSongsPerPlaylist(syncViewModel.getPlaylistList());
|
||||
break;
|
||||
case SONGS:
|
||||
syncSongsPerGenre(syncViewModel.getGenreList());
|
||||
syncSongsPerPlaylist(syncViewModel.getPlaylistList());
|
||||
break;
|
||||
case SONG_X_GENRE | SONG_X_PLAYLIST:
|
||||
case SONG_X_PLAYLIST:
|
||||
if (syncViewModel.isSyncSong()) syncSongs();
|
||||
break;
|
||||
case SONGS:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStep() {
|
||||
if (syncViewModel.getStep() == syncViewModel.getProgress()) {
|
||||
bind.syncingGoHomeImageView.setVisibility(View.VISIBLE);
|
||||
private void enableHomeButton(int sector) {
|
||||
switch (sector) {
|
||||
case SONG_X_PLAYLIST:
|
||||
if (!syncViewModel.isSyncSong()) bind.syncingGoHomeImageView.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case SONGS:
|
||||
bind.syncingGoHomeImageView.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,34 +2,32 @@ package com.cappielloantonio.play.util;
|
|||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.cappielloantonio.play.App;
|
||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Genre;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.PlaylistSongCross;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.SongGenreCross;
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||
import com.cappielloantonio.play.subsonic.models.ArtistID3;
|
||||
import com.cappielloantonio.play.subsonic.models.Child;
|
||||
import com.cappielloantonio.play.subsonic.models.IndexID3;
|
||||
import com.cappielloantonio.play.subsonic.models.MusicFolder;
|
||||
import com.cappielloantonio.play.subsonic.models.ResponseStatus;
|
||||
import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
|
||||
|
||||
import org.jellyfin.apiclient.interaction.Response;
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemType;
|
||||
import org.jellyfin.apiclient.model.playlists.PlaylistItemQuery;
|
||||
import org.jellyfin.apiclient.model.querying.ArtistsQuery;
|
||||
import org.jellyfin.apiclient.model.querying.ItemFields;
|
||||
import org.jellyfin.apiclient.model.querying.ItemQuery;
|
||||
import org.jellyfin.apiclient.model.querying.ItemsByNameQuery;
|
||||
import org.jellyfin.apiclient.model.querying.ItemsResult;
|
||||
import org.jellyfin.apiclient.model.querying.SimilarItemsQuery;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
public class SyncUtil {
|
||||
private static final String TAG = "SyncUtil";
|
||||
|
||||
|
|
@ -38,182 +36,170 @@ public class SyncUtil {
|
|||
public static final String ARTIST = "artist";
|
||||
|
||||
public static void getLibraries(Context context, MediaCallback callback) {
|
||||
String id = App.getApiClientInstance(context).getCurrentUserId();
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getBrowsingClient()
|
||||
.getMusicFolders()
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
boolean musicFolderFound = false;
|
||||
|
||||
App.getApiClientInstance(context).GetUserViews(id, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
List<BaseItemDto> libraries = new ArrayList<>();
|
||||
libraries.addAll(Arrays.asList(result.getItems()));
|
||||
for (MusicFolder folder : response.body().getMusicFolders().getMusicFolders()) {
|
||||
if (folder.getName().equals("music")) {
|
||||
PreferenceUtil.getInstance(context).setMusicLibraryID(String.valueOf(folder.getId()));
|
||||
musicFolderFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
callback.onLoadMedia(libraries);
|
||||
}
|
||||
if (musicFolderFound) callback.onLoadMedia(null);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getSongs(Context context, Map<Integer, Song> currentCatalogue, MediaCallback callback) {
|
||||
ItemQuery query = new ItemQuery();
|
||||
public static void getSongs(Context context, MediaCallback callback, AlbumID3 album) {
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getBrowsingClient()
|
||||
.getAlbum(album.getId())
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
List<Child> childList = new ArrayList<>();
|
||||
childList.addAll(response.body().getAlbum().getSongs());
|
||||
callback.onLoadMedia(childList);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
query.setIncludeItemTypes(new String[]{"Audio"});
|
||||
query.setFields(new ItemFields[]{ItemFields.MediaSources});
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
|
||||
App.getApiClientInstance(context).GetItemsAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
ArrayList<Song> songs = new ArrayList<>();
|
||||
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
songs.add(updateSongData(currentCatalogue, new Song(itemDto)));
|
||||
}
|
||||
|
||||
callback.onLoadMedia(songs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
callback.onError(exception);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getAlbums(Context context, MediaCallback callback) {
|
||||
ItemQuery query = new ItemQuery();
|
||||
public static void getAlbums(Context context, MediaCallback callback, int size, int offset) {
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getAlbumSongListClient()
|
||||
.getAlbumList2("alphabeticalByName", size, offset)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
List<AlbumID3> albumList = new ArrayList<>();
|
||||
albumList.addAll(response.body().getAlbumList2().getAlbums());
|
||||
callback.onLoadMedia(albumList);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
query.setIncludeItemTypes(new String[]{"MusicAlbum"});
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
|
||||
App.getApiClientInstance(context).GetItemsAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
List<Album> albums = new ArrayList<>();
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
albums.add(new Album(itemDto));
|
||||
}
|
||||
|
||||
callback.onLoadMedia(albums);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getArtists(Context context, MediaCallback callback) {
|
||||
ArtistsQuery query = new ArtistsQuery();
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getBrowsingClient()
|
||||
.getArtists()
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
List<ArtistID3> artistList = new ArrayList<>();
|
||||
|
||||
query.setFields(new ItemFields[]{ItemFields.Genres});
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
for (IndexID3 index : response.body().getArtists().getIndices()) {
|
||||
artistList.addAll(index.getArtists());
|
||||
}
|
||||
|
||||
App.getApiClientInstance(context).GetAlbumArtistsAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
List<Artist> artists = new ArrayList<>();
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
artists.add(new Artist(itemDto));
|
||||
}
|
||||
callback.onLoadMedia(artistList);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
callback.onLoadMedia(artists);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getPlaylists(Context context, MediaCallback callback) {
|
||||
ItemQuery query = new ItemQuery();
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getPlaylistClient()
|
||||
.getPlaylists()
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
List<com.cappielloantonio.play.subsonic.models.Playlist> playlistList = new ArrayList<>();
|
||||
playlistList.addAll(response.body().getPlaylists().getPlaylists());
|
||||
callback.onLoadMedia(playlistList);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
query.setIncludeItemTypes(new String[]{"Playlist"});
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
|
||||
App.getApiClientInstance(context).GetItemsAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
List<Playlist> playlists = new ArrayList<>();
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
playlists.add(new Playlist(itemDto));
|
||||
}
|
||||
|
||||
callback.onLoadMedia(playlists);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getGenres(Context context, MediaCallback callback) {
|
||||
ItemsByNameQuery query = new ItemsByNameQuery();
|
||||
App.getSubsonicClientInstance(context, false)
|
||||
.getBrowsingClient()
|
||||
.getGenres()
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, retrofit2.Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.FAILED)) {
|
||||
String errorMessage = response.body().getError().getCode().getValue() + " - " + response.body().getError().getMessage();
|
||||
callback.onError(new Exception(errorMessage));
|
||||
} else if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
List<com.cappielloantonio.play.subsonic.models.Genre> genreList = new ArrayList<>();
|
||||
genreList.addAll(response.body().getGenres().getGenres());
|
||||
callback.onLoadMedia(genreList);
|
||||
} else {
|
||||
callback.onError(new Exception("Empty response"));
|
||||
}
|
||||
}
|
||||
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
|
||||
App.getApiClientInstance(context).GetGenresAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
List<Genre> genres = new ArrayList<>();
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
genres.add(new Genre(itemDto));
|
||||
}
|
||||
|
||||
callback.onLoadMedia(genres);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getSongsPerGenre(Context context, MediaCallback callback, String genreId) {
|
||||
ItemQuery query = new ItemQuery();
|
||||
|
||||
query.setIncludeItemTypes(new String[]{"Audio"});
|
||||
query.setFields(new ItemFields[]{ItemFields.MediaSources});
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
query.setRecursive(true);
|
||||
query.setParentId(PreferenceUtil.getInstance(context).getMusicLibraryID());
|
||||
query.setGenreIds(new String[]{genreId});
|
||||
|
||||
App.getApiClientInstance(context).GetItemsAsync(query, new Response<ItemsResult>() {
|
||||
@Override
|
||||
public void onResponse(ItemsResult result) {
|
||||
ArrayList<SongGenreCross> crosses = new ArrayList<>();
|
||||
|
||||
for (BaseItemDto itemDto : result.getItems()) {
|
||||
crosses.add(new SongGenreCross(itemDto.getId(), genreId));
|
||||
}
|
||||
|
||||
callback.onLoadMedia(crosses);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception exception) {
|
||||
callback.onError(exception);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
callback.onError(new Exception(t.getMessage()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getSongsPerPlaylist(Context context, MediaCallback callback, String playlistId) {
|
||||
|
|
@ -245,7 +231,7 @@ public class SyncUtil {
|
|||
}
|
||||
|
||||
public static void getInstantMix(Context context, MediaCallback callback, String resultType, String itemID, int limit) {
|
||||
SimilarItemsQuery query = new SimilarItemsQuery();
|
||||
/*SimilarItemsQuery query = new SimilarItemsQuery();
|
||||
|
||||
query.setId(itemID);
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
|
|
@ -274,11 +260,11 @@ public class SyncUtil {
|
|||
public void onError(Exception exception) {
|
||||
callback.onError(exception);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
public static void getSimilarItems(Context context, MediaCallback callback, String resultType, String itemID, int limit) {
|
||||
SimilarItemsQuery query = new SimilarItemsQuery();
|
||||
/*SimilarItemsQuery query = new SimilarItemsQuery();
|
||||
|
||||
query.setId(itemID);
|
||||
query.setUserId(App.getApiClientInstance(context).getCurrentUserId());
|
||||
|
|
@ -307,17 +293,16 @@ public class SyncUtil {
|
|||
public void onError(Exception exception) {
|
||||
callback.onError(exception);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
public static Bundle getSyncBundle(Boolean syncAlbum, Boolean syncArtist, Boolean syncGenres, Boolean syncPlaylist, Boolean syncSong, Boolean crossSyncSongGenre) {
|
||||
public static Bundle getSyncBundle(Boolean syncAlbum, Boolean syncArtist, Boolean syncGenres, Boolean syncPlaylist, Boolean syncSong) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("sync_album", syncAlbum);
|
||||
bundle.putBoolean("sync_artist", syncArtist);
|
||||
bundle.putBoolean("sync_genres", syncGenres);
|
||||
bundle.putBoolean("sync_playlist", syncPlaylist);
|
||||
bundle.putBoolean("sync_song", syncSong);
|
||||
bundle.putBoolean("cross_sync_song_genre", crossSyncSongGenre);
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,64 +6,66 @@ import android.os.Bundle;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.AndroidViewModel;
|
||||
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Genre;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||
import com.cappielloantonio.play.repository.GenreRepository;
|
||||
import com.cappielloantonio.play.repository.PlaylistRepository;
|
||||
import com.cappielloantonio.play.repository.PlaylistSongRepository;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||
import com.cappielloantonio.play.subsonic.models.ArtistID3;
|
||||
import com.cappielloantonio.play.subsonic.models.Child;
|
||||
import com.cappielloantonio.play.subsonic.models.Genre;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SyncViewModel extends AndroidViewModel {
|
||||
private static final String TAG = "SyncViewModel";
|
||||
|
||||
private SongRepository songRepository;
|
||||
|
||||
|
||||
private boolean syncAlbum = false;
|
||||
private boolean syncArtist = false;
|
||||
private boolean syncGenres = false;
|
||||
private boolean syncPlaylist = false;
|
||||
private boolean syncSong = false;
|
||||
private boolean crossSyncSongGenre = false;
|
||||
|
||||
private ArrayList<Album> albumList = new ArrayList<>();
|
||||
private ArrayList<Artist> artistList = new ArrayList<>();
|
||||
private ArrayList<AlbumID3> albumList = new ArrayList<>();
|
||||
private ArrayList<ArtistID3> artistList = new ArrayList<>();
|
||||
private ArrayList<Genre> genreList = new ArrayList<>();
|
||||
private ArrayList<Playlist> playlistList = new ArrayList<>();
|
||||
private ArrayList<Song> songList = new ArrayList<>();
|
||||
private ArrayList<Child> childList = new ArrayList<>();
|
||||
|
||||
private int step = 0;
|
||||
private int progress = 0;
|
||||
private SongRepository songRepository;
|
||||
private AlbumRepository albumRepository;
|
||||
private ArtistRepository artistRepository;
|
||||
private PlaylistRepository playlistRepository;
|
||||
private GenreRepository genreRepository;
|
||||
private PlaylistSongRepository playlistSongRepository;
|
||||
|
||||
public SyncViewModel(@NonNull Application application) {
|
||||
super(application);
|
||||
|
||||
songRepository = new SongRepository(application);
|
||||
albumRepository = new AlbumRepository(application);
|
||||
artistRepository = new ArtistRepository(application);
|
||||
playlistRepository = new PlaylistRepository(application);
|
||||
genreRepository = new GenreRepository(application);
|
||||
playlistSongRepository = new PlaylistSongRepository(application);
|
||||
}
|
||||
|
||||
public void setArguemnts(Bundle bundle) {
|
||||
step = 0;
|
||||
progress = 0;
|
||||
|
||||
syncAlbum = bundle.getBoolean("sync_album", false);
|
||||
syncArtist = bundle.getBoolean("sync_artist", false);
|
||||
syncGenres = bundle.getBoolean("sync_genres", false);
|
||||
syncPlaylist = bundle.getBoolean("sync_playlist", false);
|
||||
syncSong = bundle.getBoolean("sync_song", false);
|
||||
crossSyncSongGenre = bundle.getBoolean("cross_sync_song_genre", false);
|
||||
|
||||
countStep();
|
||||
}
|
||||
|
||||
private void countStep() {
|
||||
if (syncAlbum) step++;
|
||||
if (syncArtist) step++;
|
||||
if (syncGenres) step++;
|
||||
if (syncPlaylist) step++;
|
||||
if (syncSong) step++;
|
||||
}
|
||||
|
||||
public boolean isSyncAlbum() {
|
||||
|
|
@ -86,23 +88,19 @@ public class SyncViewModel extends AndroidViewModel {
|
|||
return syncSong;
|
||||
}
|
||||
|
||||
public boolean isCrossSyncSongGenre() {
|
||||
return crossSyncSongGenre;
|
||||
}
|
||||
|
||||
public ArrayList<Album> getAlbumList() {
|
||||
public ArrayList<AlbumID3> getAlbumList() {
|
||||
return albumList;
|
||||
}
|
||||
|
||||
public void setAlbumList(ArrayList<Album> albumList) {
|
||||
this.albumList = albumList;
|
||||
public void addToAlbumList(List<AlbumID3> albumList) {
|
||||
this.albumList.addAll(albumList);
|
||||
}
|
||||
|
||||
public ArrayList<Artist> getArtistList() {
|
||||
public ArrayList<ArtistID3> getArtistList() {
|
||||
return artistList;
|
||||
}
|
||||
|
||||
public void setArtistList(ArrayList<Artist> artistList) {
|
||||
public void setArtistList(ArrayList<ArtistID3> artistList) {
|
||||
this.artistList = artistList;
|
||||
}
|
||||
|
||||
|
|
@ -130,19 +128,14 @@ public class SyncViewModel extends AndroidViewModel {
|
|||
this.songList = songList;
|
||||
}
|
||||
|
||||
public void increaseProggress() {
|
||||
progress++;
|
||||
public ArrayList<Child> getChildList() {
|
||||
return childList;
|
||||
}
|
||||
|
||||
public int getStep() {
|
||||
return step;
|
||||
public void addToChildList(ArrayList<Child> childList) {
|
||||
this.childList.addAll(childList);
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, Song> getCatalogue() {
|
||||
Map<Integer, Song> map = new HashMap<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -360,124 +360,6 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/sync_playlists_status_label" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Songs -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sync_songs_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_label"
|
||||
style="@style/ItemTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sync songs"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_detail_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_status_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_detail_label" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sync_songs_retry_image_view"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/ic_refresh"
|
||||
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sync_songs_status_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/Divider"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_status_label" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Song x Genre -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sync_song_x_genre_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_song_x_genre_label"
|
||||
style="@style/ItemTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sync song x genre"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_song_x_genre_detail_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_song_x_genre_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_song_x_genre_status_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_song_x_genre_detail_label" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sync_song_x_genre_retry_image_view"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/ic_refresh"
|
||||
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sync_song_x_genre_status_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/Divider"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_song_x_genre_status_label" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Song x Playlist -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sync_song_x_playlist_sector"
|
||||
|
|
@ -536,5 +418,64 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_song_x_playlist_status_label" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- Songs -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sync_songs_sector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_label"
|
||||
style="@style/ItemTitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sync songs"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_detail_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sync_songs_status_label"
|
||||
style="@style/ItemSubtitleTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="4dp"
|
||||
android:text="@string/label_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_detail_label" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sync_songs_retry_image_view"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/ic_refresh"
|
||||
android:foreground="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sync_songs_status_label"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<View
|
||||
style="@style/Divider"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sync_songs_status_label" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
Loading…
Add table
Add a link
Reference in a new issue