getUserPlaylists method
Retrieve a list of playlists for a given user.
Call this function again with the returned params to get the full list.
channelIdchannelIdof the user.paramsparamsobtained by getUser.
Returns List of user playlists in the format of getLibraryPlaylists. // TODO getLibraryPlaylists is currently missing
Implementation
Future<List> getUserPlaylists(String channelId, String params) async {
const endpoint = 'browse';
final body = {'browseId': channelId, 'params': params};
final response = await sendRequest(endpoint, body);
final results = nav(response, [
...SINGLE_COLUMN_TAB,
...SECTION_LIST_ITEM,
...GRID_ITEMS,
], nullIfAbsent: true);
if (results == null) return [];
return parseContentList(List<JsonMap>.from(results as List), parsePlaylist);
}