use blurhash for most objects
This commit is contained in:
parent
5085bbc1e7
commit
a66f0d5fcd
24 changed files with 85 additions and 61 deletions
|
|
@ -20,6 +20,7 @@ public class Album implements Parcelable {
|
|||
public String artistName;
|
||||
|
||||
public String primary;
|
||||
public String blurHash;
|
||||
|
||||
public Album(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
|
|
@ -35,6 +36,9 @@ public class Album implements Parcelable {
|
|||
}
|
||||
|
||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
|
||||
this.songs = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,16 @@ public class Artist implements Parcelable {
|
|||
public String name;
|
||||
|
||||
public String primary;
|
||||
public String blurHash;
|
||||
|
||||
public Artist(BaseItemDto itemDto) {
|
||||
this.id = itemDto.getId();
|
||||
this.name = itemDto.getName();
|
||||
|
||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
|
||||
this.genres = new ArrayList<>();
|
||||
this.albums = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.os.Parcelable;
|
|||
|
||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||
import org.jellyfin.apiclient.model.dto.MediaSourceInfo;
|
||||
import org.jellyfin.apiclient.model.entities.ImageType;
|
||||
import org.jellyfin.apiclient.model.entities.MediaStream;
|
||||
|
||||
public class Song implements Parcelable {
|
||||
|
|
@ -24,6 +25,7 @@ public class Song implements Parcelable {
|
|||
public String artistName;
|
||||
|
||||
public String primary;
|
||||
public String blurHash;
|
||||
public boolean favorite;
|
||||
|
||||
public String path;
|
||||
|
|
@ -59,6 +61,10 @@ public class Song implements Parcelable {
|
|||
this.primary = itemDto.getAlbumPrimaryImageTag() != null ? albumId : null;
|
||||
this.favorite = itemDto.getUserData() != null && itemDto.getUserData().getIsFavorite();
|
||||
|
||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||
}
|
||||
|
||||
if (itemDto.getMediaSources() != null && itemDto.getMediaSources().get(0) != null) {
|
||||
MediaSourceInfo source = itemDto.getMediaSources().get(0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue