Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Jun 7, 2024
1 parent f3b0b1f commit 1bcc278
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/FMBot.Bot/Services/GameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Npgsql;
using Serilog;

namespace FMBot.Bot.Services;

Expand Down Expand Up @@ -62,13 +63,16 @@ public static (string artist, long userPlaycount) PickArtistForJumble(List<TopAr
_ => 50
};

minPlaycount *= multiplier;
var finalMinPlaycount = minPlaycount * multiplier;
if (jumblesPlayedToday.Count > 500)
{
minPlaycount = 1;
finalMinPlaycount = 1;
}

var total = topArtists.Count(w => w.UserPlaycount >= minPlaycount);
var total = topArtists.Count(w => w.UserPlaycount >= finalMinPlaycount);
Log.Information("PickArtistForJumble: {topArtistCount} top artists - {jumblesPlayedTodayCount} jumbles played today - " +
"{multiplier} multiplier - {minPlaycount} min playcount - {finalMinPlaycount} final min playcount",
topArtists.Count, jumblesPlayedToday.Count, multiplier, minPlaycount, finalMinPlaycount);

if (total == 0)
{
Expand Down

0 comments on commit 1bcc278

Please sign in to comment.