Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Watchlist endpoints require pagination: deprecate the variants that don't accept page and limit parameters.
* Add warnings to `watchedAt()` setters, update existing warnings
that [Trakt already only stores and returns minute-precision timestamps](https://github.com/trakt/trakt-api/discussions/694).
* The 3D `Metadata` property of movies in a collection is now a number, so added `boolean is3D()` and deprecated
`Boolean is3d`.

## 6.17.0 - 2026-02-05

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ public class BaseEpisode {
/** progress */
public Boolean completed;

/**
* Only returned by collection endpoints.
*/
public Metadata metadata;
}
3 changes: 3 additions & 0 deletions src/main/java/com/uwetrottmann/trakt5/entities/BaseMovie.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class BaseMovie {
public OffsetDateTime listed_at;
public int plays;

/**
* Only returned by collection endpoints.
*/
public Metadata metadata;

}
36 changes: 35 additions & 1 deletion src/main/java/com/uwetrottmann/trakt5/entities/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,48 @@
import com.uwetrottmann.trakt5.enums.MediaType;
import com.uwetrottmann.trakt5.enums.Resolution;

/**
* Metadata of a collection item.
* <p>
* All but {@link #media_type} and {@link #resolution} are optional values.
*/
public class Metadata {

public MediaType media_type;
public Resolution resolution;
public Hdr hdr;
public Audio audio;
public AudioChannels audio_channels;
@SerializedName("3d")

/**
* Since 2026-03 the 3d property appears to be a number for movies.
* <p>
* This field is kept to avoid a breaking change, but its value will always be {@code null} for movies.
*
* @deprecated Use {@link #is3D()} instead.
*/
@Deprecated
public Boolean is3d;

/**
* Since 2026-03 appears to be 1 or null for movies. Or true and false for episodes.
*
* @see #is3D()
*/
@SerializedName("3d")
public Object _is3D;

public boolean is3D() {
if (_is3D != null) {
if (_is3D instanceof Boolean) {
return (Boolean) _is3D;
}
// Numbers are deserialized by default to Double
if (_is3D instanceof Double) {
return (Double) _is3D == 1.0;
}
}
return false;
}

}
9 changes: 7 additions & 2 deletions src/test/java/com/uwetrottmann/trakt5/services/SyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.uwetrottmann.trakt5.entities.SyncShow;
import com.uwetrottmann.trakt5.entities.WatchlistedEpisode;
import com.uwetrottmann.trakt5.entities.WatchlistedSeason;
import com.uwetrottmann.trakt5.enums.Extended;
import com.uwetrottmann.trakt5.enums.HistoryType;
import com.uwetrottmann.trakt5.enums.Rating;
import com.uwetrottmann.trakt5.enums.RatingsFilter;
Expand Down Expand Up @@ -186,13 +187,17 @@ private void assertLastActivityUpdated(LastActivityUpdated activity) {

@Test
public void test_collectionMovies() throws IOException {
List<BaseMovie> movies = executeCall(getTrakt().sync().collectionMovies(1, 1000, null));
// Get metadata to assert it can be parsed.
// On the test account, Star Wars: The Force Awakens has all properties set.
List<BaseMovie> movies = executeCall(getTrakt().sync().collectionMovies(1, 1000, Extended.METADATA));
assertSyncMovies(movies, "collection");
}

@Test
public void test_collectionShows() throws IOException {
List<BaseShow> shows = executeCall(getTrakt().sync().collectionShows(1, 1000, null));
// Get metadata to assert it can be parsed.
// On the test account, episode 1x08 of Start Trek: Starfleet Academy has all properties set.
List<BaseShow> shows = executeCall(getTrakt().sync().collectionShows(1, 1000, Extended.METADATA));
assertSyncShows(shows, "collection");
}

Expand Down