No documented way to get folder structure of MPMediaItem

Originator:jay.whitsitt
Number:rdar://29521032 Date Originated:05-Dec-2016
Status:Duplicate/8950024 Resolved:Open
Product:iOS SDK Product Version:10.1.1
Classification:UI/Usability Reproducible:Always
 
Area:
Music

Summary:
When adding a folder to the media library, there's no documented way to discern between a regular playlist and a playlist folder. There's also no documented way to get the parent folder of a playlist or children of a folder.

There do seem to be an undocumented keys available on the MPMediaPlaylist class.
1. @"isFolder" which is a BOOL, 0 if not a folder or 1 if the object is a folder
2. @"parentPersistentID" which is the persistentID of the objects parent folder

Please add these to the documented keys and properties.

Steps to Reproduce:
Create a folder in your media library
Create some playlists in that folder

MPMediaQuery *query = [MPMediaQuery playlistsQuery];
NSArray *collections = query.collections;
[collections enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            MPMediaPlaylist *playlist = obj;
            NSLog(@"playlist name = %@", playlist.name);
            NSLog(@"playlist isFolder = %@", [playlist valueForProperty:@"isFolder"]);
            NSLog(@"playlist parentPersistentID = %@", [playlist valueForProperty:@"parentPersistentID"]);
    }];

Expected Results:
MPMediaPlaylistPropertyIsFolder and MPMediaPlaylistPropertyParentPersistentID

Actual Results:
No documented keys or properties for these values but it is possible to retrieve them

Version:
iOS 10.1.1 & 9.3.5

Notes:
Xcode 8.1

Configuration:
iPhone 7 Plus 10.1.1, iPhone 6 9.3.5

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!