Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15476] queryMusicLibrary "grouping" property has no effect.

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
LabelsSupportTeam
ReporterColton Arabsky
AssigneeUnknown
Created2013-10-13T12:47:07.000+0000
Updated2018-02-28T20:03:52.000+0000

Description

var win = Ti.UI.createWindow();

var tableView = Ti.UI.createTableView();

var query = Ti.Media.queryMusicLibrary({
	grouping:Ti.Media.MUSIC_MEDIA_GROUP_PLAYLIST,
	//grouping:Ti.Media.MUSIC_MEDIA_GROUP_GENRE,
	//grouping:Ti.Media.MUSIC_MEDIA_GROUP_COMPOSER,
	//grouping:Ti.Media.MUSIC_MEDIA_GROUP_ALBUM,
	//grouping:Ti.Media.MUSIC_MEDIA_GROUP_ALBUM_ARTIST,
	mediaType:Ti.Media.MUSIC_MEDIA_TYPE_MUSIC
});

if (query.length > 0) {
	for (var i=0;i<query.length;i++) {
		var tableRow = Ti.UI.createTableViewRow();

		var songTitle = Ti.UI.createLabel({
			text:query[i].title,
			left:10
		});

		tableRow.add(songTitle);

		tableView.appendRow(tableRow);
	};
} else {
	Ti.API.info('No results.');
}

win.add(tableView);

win.open();
This code has to be tested on a device with music in the device's "iPod". To successfully test the code and find that it's not working, comment out the first "grouping" and uncomment the next one, and you will see the results printed are the exact same, no matter the grouping used. [Q&A Link](http://developer.appcelerator.com/question/158348)

Comments

No comments

JSON Source