From ff351b848bfa0094a6e33073bcd05673d293a74f Mon Sep 17 00:00:00 2001 From: Sidd Date: Thu, 21 Jul 2022 00:07:43 -0500 Subject: [PATCH 1/2] feat: add vod offset to clips --- .../src/main/java/com/github/twitch4j/helix/domain/Clip.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/Clip.java b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/Clip.java index 3f4fd795a..03b2c55ca 100644 --- a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/Clip.java +++ b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/Clip.java @@ -64,6 +64,9 @@ public class Clip { /** Duration of the Clip in seconds (up to 0.1 precision). */ private Float duration; + /** The zero-based offset, in seconds, to where the clip starts in the video (VOD) or stream. */ + private Integer vodOffset; + /** * @return the timestamp for the clip's creation * @deprecated in favor of getCreatedAtInstant() From 65334de41e7b9fa7878daba05c285b94d2917142 Mon Sep 17 00:00:00 2001 From: Sidd Date: Thu, 21 Jul 2022 00:07:59 -0500 Subject: [PATCH 2/2] feat: add new creator goal types --- .../twitch4j/eventsub/domain/GoalType.java | 16 +++++++++++++++- .../twitch4j/helix/domain/CreatorGoal.java | 17 +++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/domain/GoalType.java b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/domain/GoalType.java index 59c962136..34c95b198 100644 --- a/eventsub-common/src/main/java/com/github/twitch4j/eventsub/domain/GoalType.java +++ b/eventsub-common/src/main/java/com/github/twitch4j/eventsub/domain/GoalType.java @@ -25,6 +25,20 @@ public enum GoalType { * This type shows only the net increase in subscriptions (it does not account for users that stopped subscribing since the goal's inception). */ @JsonAlias("new_subscription") - NEW_SUBSCRIPTIONS + NEW_SUBSCRIPTIONS, + + /** + * The goal is to increase subscriptions. + * This type shows the net increase or decrease in the number of subscriptions. + */ + @JsonAlias("subscription_count") + SUB_COUNT, + + /** + * The goal is to increase subscriptions. + * This type shows only the net increase in the number of subscriptions (it does not account for users that unsubscribed since the goal started). + */ + @JsonAlias("new_subscription_count") + NEW_SUB_COUNT } diff --git a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/CreatorGoal.java b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/CreatorGoal.java index b545cc5e2..d98c32a38 100644 --- a/rest-helix/src/main/java/com/github/twitch4j/helix/domain/CreatorGoal.java +++ b/rest-helix/src/main/java/com/github/twitch4j/helix/domain/CreatorGoal.java @@ -48,11 +48,20 @@ public class CreatorGoal { /** * The current value. *

- * If the goal is to increase followers, this field is set to the current number of followers. - * This number increases with new followers and decreases if users unfollow the channel. + * If type is {@link GoalType#FOLLOWERS}, this field is set to the broadcaster's current number of followers. + * This number increases with new followers and decreases when users unfollow the broadcaster. *

- * For subscriptions, current_amount is increased and decreased by the points value associated with the subscription tier. - * For example, if a tier-two subscription is worth 2 points, current_amount is increased or decreased by 2, not 1. + * If type is {@link GoalType#SUBSCRIPTIONS}, this field is increased and decreased by the points value associated with the subscription tier. + * For example, if a tier-two subscription is worth 2 points, this field is increased or decreased by 2, not 1. + *

+ * If type is {@link GoalType#SUB_COUNT}, this field is increased by 1 for each new subscription and decreased by 1 for each user that unsubscribes. + *

+ * If type is {@link GoalType#NEW_SUBSCRIPTIONS}, this field is increased by the points value associated with the subscription tier. + * For example, if a tier-two subscription is worth 2 points, this field is increased by 2, not 1. + *

+ * If type is {@link GoalType#NEW_SUB_COUNT}, this field is increased by 1 for each new subscription. + * + * @see #getType() */ private Integer currentAmount;