checkIn method
Used to check if a song(entity) was added to a specific room.
Parameters:
roomType
this will define which room will be checked.entityKey
this is the key of the song that will be checked.playlistKey
this will be the id/key of the playlist*
.
*
playlistKey
it's only required when using RoomType.PLAYLIST.
Return:
- If the song(entity) exist in the room, will return
true
, if not, will returnfalse
and if some problem occurred, will throw a error.
Throw:
- Will throw a error when some of the
entityKey
is null or when RoomType.PLAYLIST is called andplaylistKey
is null.
See too:
Implementation
Future<bool> checkIn(
RoomType roomType,
int entityKey, {
int? playlistKey,
}) async {
if (roomType == RoomType.PLAYLIST && playlistKey == null) {
throw Exception(
"Cannot add [entity] to a undefined [playlist]\n"
"Define the [playlistKey] parameter.",
);
}
return await _controller.checkController(
roomType,
entityKey,
playlistKey: playlistKey,
);
}