Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15627] iOS: Ti.Media.Item.artwork returns TiBlob even if it has no Artwork.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-04-26T14:50:09.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam
ReporterColton Arabsky
AssigneeEric Merriman
Created2013-10-15T15:16:34.000+0000
Updated2017-05-30T16:48:39.000+0000

Description

"Image for the item's artwork as a Blob object, or null if no artwork is available." - TiDoc Even if there is no artwork for the Item, this property will return a TiBlob, causing many problems if you are trying to filter for null or not.
var win = Ti.UI.createWindow();

var query = Ti.Media.queryMusicLibrary({
	title:{value:'', exact:false}
});

var tableView = Ti.UI.createTableView();

for (var i=0;i<query.length;i++) {
	var tableRow = Ti.UI.createTableViewRow({height:70});
	
	var songArtwork = Ti.UI.createImageView({
		left:10,
		height:64,
		width:64
	});
	if (query[i].artwork) {
		songArtwork.image = query[i].artwork;
	}
	var songTitle = Ti.UI.createLabel({
		text:query[i].title,
		left:75
	});
	
	tableRow.add(songArtwork);
	tableRow.add(songTitle);
	
	tableView.appendRow(tableRow);
};

win.add(tableView);

win.open();
Note that this code must be tested on an iOS Device with an iPod library full of songs, with both artwork and not. The simulator does not have the iPod installed on it.

Comments

  1. Hans Knöchel 2017-04-26

    Not happening anymore, resolving!
  2. Lee Morris 2017-05-30

    Closing ticket with reference to the above comment.

JSON Source