[TIMOB-15627] iOS: Ti.Media.Item.artwork returns TiBlob even if it has no Artwork.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2017-04-26T14:50:09.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | n/a |
Components | iOS |
Labels | SupportTeam |
Reporter | Colton Arabsky |
Assignee | Eric Merriman |
Created | 2013-10-15T15:16:34.000+0000 |
Updated | 2017-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.
Not happening anymore, resolving!
Closing ticket with reference to the above comment.