[AB-xxx] fixing issues related to emote tracking

This commit is contained in:
Sheldan
2021-05-23 22:27:52 +02:00
parent 9dc1d73507
commit 1fbd494590
3 changed files with 17 additions and 3 deletions

View File

@@ -28,9 +28,14 @@ public class UsedEmoteManagementServiceBean implements UsedEmoteManagementServic
@Override
public UsedEmote createEmoteUsageForToday(TrackedEmote trackedEmote, Long count) {
return createEmoteUsageFor(trackedEmote, count, Instant.now());
}
@Override
public UsedEmote createEmoteUsageFor(TrackedEmote trackedEmote, Long count, Instant instant) {
UsedEmote usedEmote = UsedEmote
.builder()
.emoteId(new UsedEmoteDay(trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), Instant.now()))
.emoteId(new UsedEmoteDay(trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), instant))
.amount(count)
.build();
log.debug("Creating emote usage for emote {} in server {} with count {}.", trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), count);

View File

@@ -1,5 +1,5 @@
abstracto.featureFlags.assignableRole.featureName=assignableRole
abstracto.featureFlags.assignableRole.enabled=false
abstracto.featureFlags.emoteTracking.featureName=emoteTracking
abstracto.featureFlags.emoteTracking.enabled=false
abstracto.featureModes.emoteAutoTrack.featureName=emoteTracking

View File

@@ -29,6 +29,15 @@ public interface UsedEmoteManagementService {
*/
UsedEmote createEmoteUsageForToday(TrackedEmote trackedEmote, Long count);
/**
* Creates and persists and instance of {@link UsedEmote} from the given {@link TrackedEmote}, with the defined count and the given date.
* @param trackedEmote The {@link TrackedEmote} for which to create a {@link UsedEmote} for
* @param count The amount of usages for the {@link UsedEmote}
* @param instant The date to create the {@link UsedEmote emoteUsage} for
* @return The created {@link UsedEmote} instance int he database
*/
UsedEmote createEmoteUsageFor(TrackedEmote trackedEmote, Long count, Instant instant);
/**
* Loads {@link UsedEmote} for the {@link AServer} which are newer than the given {@link Instant}
* @param server The {@link AServer} to retrieve the {@link UsedEmote} for