diff --git a/release.gradle b/release.gradle
index b53f0934..d35e6f4a 100644
--- a/release.gradle
+++ b/release.gradle
@@ -31,9 +31,9 @@ jacoco {
toolVersion = "0.7.1.201405082137"
}
-def coverageSourceDirs = ['src/main/java' ]
+def coverageSourceDirs = ['src/main/java']
-task jacocoTestReport(type:JacocoReport, dependsOn: "test") {
+task jacocoTestReport(type: JacocoReport, dependsOn: "test") {
group = "Reporting"
description = "Generate Jacoco coverage reports"
diff --git a/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java b/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java
index 5caedb70..ea3cb893 100644
--- a/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java
+++ b/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java
@@ -14,6 +14,7 @@
import kaaes.spotify.webapi.android.models.AudioFeaturesTracks;
import kaaes.spotify.webapi.android.models.CategoriesPager;
import kaaes.spotify.webapi.android.models.Category;
+import kaaes.spotify.webapi.android.models.CurrentlyPlaying;
import kaaes.spotify.webapi.android.models.FeaturedPlaylists;
import kaaes.spotify.webapi.android.models.NewReleases;
import kaaes.spotify.webapi.android.models.Pager;
@@ -1440,7 +1441,6 @@ public interface SpotifyService {
* Get the current user's followed artists.
*
* @param callback Callback method.
- * @return An empty result
* @see Get User's Followed Artists
*/
@GET("/me/following?type=artist")
@@ -1463,7 +1463,6 @@ public interface SpotifyService {
* @param options Optional parameters. For list of supported parameters see
* endpoint documentation
* @param callback Callback method.
- * @return An empty result
* @see Get User's Followed Artists
*/
@GET("/me/following?type=artist")
@@ -1810,4 +1809,23 @@ public interface SpotifyService {
@GET("/me/top/tracks")
void getTopTracks(@QueryMap Map options, Callback> callback);
+ /**
+ * Get the object currently being played on the user’s Spotify account.
+ *
+ * @param market Optional. An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.
+ * endpoint documentation
+ * @param callback Callback method
+ */
+ @GET("/me/player/currently-playing")
+ void getCurrentlyPlaying(@Query("market") String market, Callback callback);
+
+ /**
+ * Get the object currently being played on the user’s Spotify account.
+ *
+ * @param market Optional. An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.
+ * endpoint documentation
+ * @return Currently Playing Object
+ */
+ @GET("/me/player/currently-playing")
+ CurrentlyPlaying getCurrentlyPlaying(@Query("market") String market);
}
diff --git a/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlaying.java b/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlaying.java
new file mode 100644
index 00000000..03ff7b18
--- /dev/null
+++ b/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlaying.java
@@ -0,0 +1,51 @@
+package kaaes.spotify.webapi.android.models;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Created by sd2_rails on 9/13/17.
+ */
+
+public class CurrentlyPlaying implements Parcelable {
+
+ CurrentlyPlayingContext context;
+ public String timestamp;
+ public Integer progress_ms;
+ public boolean is_playing;
+ public Track item;
+
+ protected CurrentlyPlaying(Parcel in) {
+ context = in.readParcelable(CurrentlyPlayingContext.class.getClassLoader());
+ timestamp = in.readString();
+ progress_ms = (Integer) in.readValue(Integer.class.getClassLoader());
+ is_playing = in.readByte() != 0;
+ item = in.readParcelable(Track.class.getClassLoader());
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeParcelable(context, flags);
+ dest.writeString(timestamp);
+ dest.writeValue(progress_ms);
+ dest.writeByte((byte) (is_playing ? 1 : 0));
+ dest.writeParcelable(item, flags);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public CurrentlyPlaying createFromParcel(Parcel in) {
+ return new CurrentlyPlaying(in);
+ }
+
+ @Override
+ public CurrentlyPlaying[] newArray(int size) {
+ return new CurrentlyPlaying[size];
+ }
+ };
+}
diff --git a/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlayingContext.java b/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlayingContext.java
new file mode 100644
index 00000000..a307ac37
--- /dev/null
+++ b/spotify-api/src/main/java/kaaes/spotify/webapi/android/models/CurrentlyPlayingContext.java
@@ -0,0 +1,50 @@
+package kaaes.spotify.webapi.android.models;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.Map;
+
+/**
+ * Created by sd2_rails on 9/13/17.
+ */
+
+public class CurrentlyPlayingContext implements Parcelable {
+
+ public String uri;
+ public String href;
+ public Map external_urls;
+ public String type;
+
+ protected CurrentlyPlayingContext(Parcel in) {
+ uri = in.readString();
+ href = in.readString();
+ external_urls = in.readHashMap(Map.class.getClassLoader());
+ type = in.readString();
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(uri);
+ dest.writeString(href);
+ dest.writeMap(this.external_urls);
+ dest.writeString(type);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public CurrentlyPlayingContext createFromParcel(Parcel in) {
+ return new CurrentlyPlayingContext(in);
+ }
+
+ @Override
+ public CurrentlyPlayingContext[] newArray(int size) {
+ return new CurrentlyPlayingContext[size];
+ }
+ };
+}