private void populateMoreInfoFromItem() { Res firstResource = content.getFirstResource(); this.resourceUri = firstResource.getValue(); this.mimeType = firstResource.getProtocolInfo().getContentFormatMimeType().toString(); this.subtitle = this.mimeType; setDuration(firstResource); if (getMusicItem()) { this.musicItem = new MusicTrack((Item) this.content); this.subtitle = this.musicItem.getFirstArtist().getName(); this.defaultResource = R.drawable.nocover_audio; this.type = "audio"; return; } if (isAudioItemOrDerivative()) { this.defaultResource = R.drawable.nocover_audio; this.type = "audio"; return; } if (isImageItemOrDerivative()) { this.defaultResource = R.drawable.ic_image_item; this.type = "image"; return; } if (isVideoItemOrDerivative()) { this.defaultResource = R.drawable.nocover_audio; this.type = "video"; return; } }
public ContentItem(Item item, Service service) { this.service = service; this.content = item; this.className = content.getClass().getName(); this.id = item.getId(); this.isContainer = false; populateMoreInfoFromItem(); }
public List<Res> getRes() { return content.getResources(); }
@Override public String toString() { return content.getTitle(); }
@Override public int hashCode() { return content.hashCode(); }