mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 12:10:21 +00:00
[AB-xxx] fixing issues related to emote tracking
This commit is contained in:
@@ -28,9 +28,14 @@ public class UsedEmoteManagementServiceBean implements UsedEmoteManagementServic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UsedEmote createEmoteUsageForToday(TrackedEmote trackedEmote, Long count) {
|
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
|
UsedEmote usedEmote = UsedEmote
|
||||||
.builder()
|
.builder()
|
||||||
.emoteId(new UsedEmoteDay(trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), Instant.now()))
|
.emoteId(new UsedEmoteDay(trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), instant))
|
||||||
.amount(count)
|
.amount(count)
|
||||||
.build();
|
.build();
|
||||||
log.debug("Creating emote usage for emote {} in server {} with count {}.", trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), count);
|
log.debug("Creating emote usage for emote {} in server {} with count {}.", trackedEmote.getTrackedEmoteId().getId(), trackedEmote.getTrackedEmoteId().getServerId(), count);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
abstracto.featureFlags.assignableRole.featureName=assignableRole
|
abstracto.featureFlags.emoteTracking.featureName=emoteTracking
|
||||||
abstracto.featureFlags.assignableRole.enabled=false
|
abstracto.featureFlags.emoteTracking.enabled=false
|
||||||
|
|
||||||
|
|
||||||
abstracto.featureModes.emoteAutoTrack.featureName=emoteTracking
|
abstracto.featureModes.emoteAutoTrack.featureName=emoteTracking
|
||||||
|
|||||||
@@ -29,6 +29,15 @@ public interface UsedEmoteManagementService {
|
|||||||
*/
|
*/
|
||||||
UsedEmote createEmoteUsageForToday(TrackedEmote trackedEmote, Long count);
|
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}
|
* 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
|
* @param server The {@link AServer} to retrieve the {@link UsedEmote} for
|
||||||
|
|||||||
Reference in New Issue
Block a user