fix some issues with the model conversions
This commit is contained in:
parent
1c37428336
commit
baab43f89d
3 changed files with 8 additions and 8 deletions
|
|
@ -38,7 +38,7 @@ public class Album implements Parcelable {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class Artist implements Parcelable {
|
||||||
this.name = itemDto.getName();
|
this.name = itemDto.getName();
|
||||||
|
|
||||||
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
this.primary = itemDto.getImageTags().containsKey(ImageType.Primary) ? id : null;
|
||||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,22 +67,22 @@ public class Song implements Parcelable {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.primary = itemDto.getAlbumPrimaryImageTag() != null ? albumId : null;
|
this.primary = itemDto.getAlbumPrimaryImageTag() != null ? albumId : null;
|
||||||
this.favorite = itemDto.getUserData() != null && itemDto.getUserData().getIsFavorite();
|
if (itemDto.getImageBlurHashes() != null && itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
||||||
|
|
||||||
if (itemDto.getImageBlurHashes().get(ImageType.Primary) != null) {
|
|
||||||
this.blurHash = (String) itemDto.getImageBlurHashes().get(ImageType.Primary).values().toArray()[0];
|
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) {
|
if (itemDto.getMediaSources() != null && itemDto.getMediaSources().get(0) != null) {
|
||||||
MediaSourceInfo source = itemDto.getMediaSources().get(0);
|
MediaSourceInfo source = itemDto.getMediaSources().get(0);
|
||||||
|
|
||||||
this.path = source.getPath();
|
this.path = source.getPath();
|
||||||
this.size = source.getSize();
|
this.size = source.getSize() != null ? source.getSize() : 0;
|
||||||
|
|
||||||
this.container = source.getContainer();
|
this.container = source.getContainer();
|
||||||
this.bitRate = source.getBitrate();
|
this.bitRate = source.getBitrate() != null ? source.getBitrate() : 0;
|
||||||
|
|
||||||
if (source.getMediaStreams() != null && source.getMediaStreams().get(0) != null) {
|
if (source.getMediaStreams() != null && source.getMediaStreams().size() != 0) {
|
||||||
MediaStream stream = source.getMediaStreams().get(0);
|
MediaStream stream = source.getMediaStreams().get(0);
|
||||||
|
|
||||||
this.codec = stream.getCodec();
|
this.codec = stream.getCodec();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue