updateCount method
Used to update the count of listened songs.
Parameters:
key
this is the key of the song that will be updated.automatic
this will define if the count will be increased automatically.newCount
this will define the new count.
Important:
- If
automatic
is null, will be set totrue
. - If
automatic
isfalse
andnewCount
is null, will throw a error.
Return:
- If the song(entity) was updated, will return
true
, if not, will returnfalse
.
Implementation
Future<bool> updateCount(int key, {bool automatic = true, int? newCount}) {
if (automatic == false && newCount == null) return throw "";
return _MostPlayedDao().updateCount(key, automatic, newCount);
}