Skip to content

Commit

Permalink
Merge pull request #52 from twitch4j/develop
Browse files Browse the repository at this point in the history
release(v0.11.1): Release v0.11.1
  • Loading branch information
PhilippHeuer committed Jul 19, 2018
2 parents 0b0353b + 1fc1947 commit 8f01839
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions build.gradle
Expand Up @@ -24,7 +24,7 @@ repositories {
// Artifact Info
group = "com.github.twitch4j"
description = "This is a api client for the Twitch API V5/IRC/PubSub. (And related services: Streamlabs, ...)"
version = "v0.11.0"
version = "v0.11.1"

// Doesn't matter, only so that spring doesn't fail
mainClassName = 'me.philippheuer.twitch4j.TwitchClient'
Expand Down Expand Up @@ -176,8 +176,8 @@ publishing {
* Bintray Upload
*/
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
user = findProperty("bintrayUser").toString() ?: System.getenv("BINTRAY_USER")
key = findProperty("bintrayApiKey").toString() ?: System.getenv("BINTRAY_API_KEY")
publications = ['mainProject']
dryRun = false
pkg {
Expand Down
21 changes: 18 additions & 3 deletions src/main/java/me/philippheuer/twitch4j/enums/Scope.java
Expand Up @@ -16,6 +16,10 @@
*/
@RequiredArgsConstructor
public enum Scope {
/**
* View analytics data for your extensions.
*/
ANALYTICS_READ_EXTENSION("analytics:read:extensions"),
/**
* View analytics data for your games.
*/
Expand All @@ -32,15 +36,22 @@ public enum Scope {
* Manage a user object.
*/
USER_EDIT("user:edit"),
/**
* Edit your channel’s broadcast configuration, including extension configuration. (This scope implies <code>{@link Scope#USER_READ_BROADCAST user:read:broadcast}</code> capability.)
*/
USER_EDIT_BROADCAST("user:edit:broadcast"),
/**
* View your broadcasting configuration, including extension configurations.
*/
USER_READ_BROADCAST("user:read:broadcast"),
/**
* Read authorized user’s email address.
*/
USER_READ_EMAIL("user:read:email"),

/**
* Read whether a user is subscribed to your channel.
*/
channel_check_subscription,
CHANNEL_CHECK_SUBSCRIPTION,
/**
* Trigger commercials on channel.
*/
Expand All @@ -51,11 +62,15 @@ public enum Scope {
CHANNEL_EDITOR,
/**
* Add posts and reactions to a channel feed.
* @deprecated <a href="https://discuss.dev.twitch.tv/t/how-the-removal-of-channel-feed-and-pulse-affects-the-twitch-api-v5/16540">Twitch removes Channel Feed and Pulse.</a>
*/
@Deprecated
CHANNEL_FEED_EDIT,
/**
* View a channel feed.
* @deprecated <a href="https://discuss.dev.twitch.tv/t/how-the-removal-of-channel-feed-and-pulse-affects-the-twitch-api-v5/16540">Twitch removes Channel Feed and Pulse.</a>
*/
@Deprecated
CHANNEL_FEED_READ,
/**
* Read nonpublic channel information, including email address and stream key.
Expand Down Expand Up @@ -122,7 +137,7 @@ public enum Scope {
private final String name;

Scope() {
this.name = name();
this.name = name().toLowerCase();
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/me/philippheuer/twitch4j/model/Video.java
@@ -1,9 +1,11 @@
package me.philippheuer.twitch4j.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.Date;
import java.util.Map;
import lombok.Data;
import me.philippheuer.util.conversion.VideoIdDeserializer;

/**
* Model representing a video.
Expand All @@ -16,6 +18,7 @@
public class Video {

@JsonProperty("_id")
@JsonDeserialize(using = VideoIdDeserializer.class)
private long id;

private String title;
Expand Down
@@ -0,0 +1,17 @@
package me.philippheuer.util.conversion;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import java.io.IOException;

public class VideoIdDeserializer extends JsonDeserializer<Long> {
@Override
public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
if (p.getValueAsString().startsWith("v")) {
return Long.parseLong(p.getValueAsString().substring(1));
}
else return ctxt.readValue(p, Long.class);
}
}

0 comments on commit 8f01839

Please sign in to comment.