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