tRakt 0.19.0.9000 (development version)
Refreshed the bundled reference datasets (
trakt_networks,trakt_genres,trakt_languages,trakt_countries,trakt_certifications) from the API.trakt_networksno longer contains blank or duplicate network names, so looking up networks and filtering bynetworksis more reliable.New
movies_updates()andshows_updates()return media recently updated on trakt.tv since astart_date(default yesterday). The trakt.tv API only serves updates from the last 30 days; olderstart_dates warn. These endpoints do not support filters.New filter builders
filters_movies(),filters_shows(), andfilters_episodes()assemble a validatedtrakt_filtersobject to pass to thefiltersargument of the dynamic-list functions (movies_popular(),shows_trending(), …) andsearch_query(). This centralizes and documents filtering, adds the filters the trakt.tv API gained over time —subgenres,studio_ids,votes,tmdb_ratings/tmdb_votes,imdb_ratings/imdb_votes,rt_meters,rt_user_meters,metascores,network_ids,episode_types— and expands thestatusvocabulary to all eight API values. Values are validated up front (unknown vocabulary warns and is dropped; out-of-range numbers warn and are ignored). (#36)Passing filters as individual arguments to the dynamic-list functions and
search_query()(genres,years,networks, …) is soft-deprecated in favour of thefiltersargument. The individual arguments keep working for now; if both afiltersobject and individual arguments are supplied,filterswins and a warning is emitted.
tRakt 0.19.0
-
lists_popular()/lists_trending()gain atypeargument ("personal"or"official", default"personal") and now send it as a required path segment. The trakt.tv API changed: the barelists/popular/lists/trendingendpoints now return an empty HTTP 204 response, and the listtypemust be specified explicitly (lists/popular/:type). Previously these functions silently returned an empty tibble. - Fix an error in the
networks(and other fixed-vocabulary) filter validation used by the dynamic-list functions (shows_anticipated(),movies_popular(), etc.): a filter value that matched several entries differing only in case or duplicated in the API’s lookup data (e.g."Netflix"/"NETFLIX") aborted with “Result must be length 1, not 2”. Such values now resolve to a single canonical spelling. -
trakt_get()now retries transient server errors (HTTP 500, 502, 503, 504) and connection failures, not just the httr2 defaults (429, 503). The trakt.tv API intermittently returns gateway errors (502/504) that succeed on a retry; previously these surfaced as hard failures. - New
trakt_api_available(): a lightweight, non-erroring check of whether the API is reachable (returnsTRUE/FALSE). It is used to guard runnable documentation examples so they execute when the API is up but are skipped (rather than failing) during outages or when offline. - Documentation examples for public (non-authenticated) endpoints now run conditionally via
@examplesIf trakt_api_available()instead of being hidden in\dontrun{}. They are exercised byR CMD checkandexample()when the API is reachable, and skipped otherwise, so upstream flakiness no longer produces spurious example failures. Examples that genuinely require authentication remain in\dontrun{}. - Tests: vcr cassettes are now replay-only. The previous
re_record_intervalof 30 days caused CI to make live API calls (and fail on any upstream hiccup or drift) once cassettes aged past the interval. Re-record cassettes deliberately and locally instead. - Vignettes (
Getting Started,Show Analysis: 24) are now pre-computed: they are authored invignettes/*.Rmd.orig(with live API code) and knitted into staticvignettes/*.Rmdviavignettes/precompile.R. The shipped vignettes contain baked-in output and make no API calls at check/build time, so an upstream outage no longer breaksR CMD checkor the pkgdown site. Regenerate them deliberately withmake vignettes(orRscript vignettes/precompile.R).
tRakt 0.18.0
- The
guest_starsargument ofshows_people()/seasons_people()/episodes_people()is now deprecated (vialifecycle::deprecate_warn()). The trakt.tv API stopped returning a separateguest_starsarray — guest cast is now included incast. The argument is a no-op pending removal in a future release. - Fix vectorisation bug in
movies_related()/shows_related(): when called with multiple IDs, the internal recursion forwarded theextendedargument positionally aslimit, producing malformed?limit=minURLs and empty responses for non-first IDs (subsequently erroring in column-flattening). -
seasons_ratings()adapts to the new multi-source rating response shape. The API now returns separate sub-objects per source (trakt,tmdb,imdb,metascore,rotten_tomatoes). Thetraktsource is promoted to the top level (preserving the existingrating/votes/distributioncolumns), and external scores are surfaced as<source>_<field>columns (tmdb_rating,imdb_link,metascore_rating,rotten_tomatoes_state, etc.). Missing values are returned asNA. -
unpack_user()now renames the user’s owntraktid touser_traktto avoid colliding with the media or listtraktid when an unpacked user isbind_cols()’d alongside other identifiers. Previously this produced auto-repaired column names such astrakt...17. Affects all functions that embed user data:*_lists(),user_lists(),user_list(),user_comments(),user_summary(), comments,media_watching(), and list-popular endpoints. -
user_list()no longer errors on single-list responses where the embedded user profile containsNULLfields (e.g.age,vip_cover_image); these are now coerced toNAbefore tibble conversion. -
shows_people()/seasons_people()/episodes_people()no longer return a separateguest_starstable when called withguest_stars = TRUE, because the trakt API stopped returning that array. Guest cast is now mixed intocast. Theguest_starsargument is currently a no-op pending a deprecation decision. - Adapt to trakt.tv API response changes:
- Show results now include
plex_guidandplex_slugID columns,subgenresas a list column, and new fieldstaglineandoriginal_title. - Nested
imagesandcolorsobjects are dropped from show data as they don’t fit tabular output. -
search_query()andsearch_id()now return properly structured show data for bothextended = "min"andextended = "full".
- Show results now include
- Token refresh failures (e.g. expired or revoked refresh tokens) now fall back to device authentication instead of erroring.
- Catch up with inconsistent API endpoints:
-
seasons_season()was renamed toseasons_episodes(), wrapping endpoint shows/:id/seasons/:season?translations=. -
seasons_season()now wraps new(?) endpoint shows/:id/seasons/:season/info.
-
- Start using {vcr} for recording API responses.
- Bump testthat dependency to
>=3.0.0, which had been necessary since adopting 3e. - Modernize interal purrr usage
- Swap purrr-style anonymous functions
~ .xwith base-R\(x) x-style ones - Substitute
map_df()withmap()+list_rbind()
- Swap purrr-style anonymous functions
- Overhaul the
extendedparameter across all API functions:-
"min"no longer sends?extended=minto the API (which was never a valid API value). Instead, the query parameter is omitted entirely, matching the API’s documented behavior. - New values
"images","metadata", and combinations likec("full", "images")or"full,images"are now supported. - When
extendedincludes"images", image data is preserved as a list-column instead of being dropped. - All functions now use
validate_extended()internally instead ofmatch.arg(), providing clearer error messages for invalid values.
-
tRakt 0.17.0
Switch from {httr} to {httr2}
This should have been a small under the hood change, but it also enabled major changes in the way I’m handling API secrets, allowing me to include my encrypted client secret with the package directly. This should make it more convenient for users to make authenticated requests without having to register their own app on trakt.tv.
The main user-facing highlight however should probably be more stable API interactions including
- Automatic retries in case of errors (up to 3, currently not cofnigurable)
- Caching of API results to
getOption("tRakt_cache_dir"), which is pruned- after 1 week by default (option
tRakt_cache_max_age) - after exceeding a total of 100MB (option
tRakt_cache_max_size)
- after 1 week by default (option
Minor changes
- Remove
magrittrimport and use|>internally, hence bumping the R dependency to>= 4.1. - Clean up unused package imports.
-
tRakt_sitrep()is now available to check general settings and API credentials. - Switch to testthat 3e.
tRakt 0.16.0
- Add GitHub actions via
usethis::use_github_actions() - Use the tidy CI setup via
usethis::use_tidy_ci(), this bumps the R dependency to>= 3.2.
Authenticated requests
By default, all requests to the API are now made using authentication if a trakt_client_secret is set. See ?trakt_credentials() for details on how to set your credentials.
If no secret is available, unauthenticated requests are made as in previous versions. In this case, you still need either the built-in or your own trakt_client_id.
OAuth2 support comes with the need to handle secrets, i.e. .httr-oauth files. This can be a pain with headless/automated setups, which is why I am trying to keep “no auth needed” as the default, as most (implemented) endpoints don’t strictly require authentication.
See vignette("Implemented-API-methods", package = "tRakt") for an overview of implemented methods with an indicator on whether authentication is required (it usually isn’t).
New functions
-
episodes_summary()[shows/:id/seasons/:season/episodes/:episode]: Whatseasons_season()andseasons_summary()do, but for a single episode. Only really implemented for completeness’ sake. Wraps this method. -
user_profile()[user/:id]: Get a user’s profile. -
user_lists()[users/:id/lists]: Get all user lists. -
user_list()[users/:id/lists/:list_id]: Get a single list. -
user_list_items()[users/:id/lists/:list_id/items/:type]: Get the items in said lists.
The Renamingering
Rename all the things to snake_case and drop the trakt. prefix.
This results in (most) functions mapping directly to API endpoints in the form section_method, e.g. the API endpoint movies/collected is handled by function movies_collected().
Search
-
trakt.search->search_query() -
trakt.search.byid->search_id()
Dynamic Lists
-
trakt.popular -
trakt.trending -
trakt.anticipated -
trakt.played -
trakt.watched -
trakt.collected() -
trakt.updates()
Movies
-
trakt.movies.summary->movies_summary() -
trakt.movies.boxoffice->movies_boxoffice() -
trakt.movies.releases->movies_releases() -
trakt.movies.people->movies_people()
Shows
-
trakt.shows.summary->shows_summary() -
trakt.shows.people->shows_people()
Seasons
-
trakt.seasons.summary->seasons_summary() -
trakt.seasons.season->seasons_season()(It’s silly, I know, but oh well)
Ratings
-
trakt.movies.ratings->movies_ratings() -
trakt.shows.ratings->shows_ratings() -
trakt.seasons.ratings->seasons_ratings() -
trakt.episodes.ratings->episodes_ratings()
Related
-
trakt.movies.related->movies_related() -
trakt.shows.related->shows_related()
Stats
-
trakt.movies.stats->movies_stats() -
trakt.shows.stats->shows_stats() -
trakt.seasons.stats->seasons_stats() -
trakt.episodes.stats->episodes_stats()
People
-
trakt.people.summary->people_summary() -
trakt.people.movies->people_movies() -
trakt.people.shows->people_shows()
User functions
-
trakt.user.network -
trakt.user.collection->user_collection() -
trakt.user.history->user_history() -
trakt.user.ratings->user_ratings() -
trakt.user.stats->user_stats() -
trakt.user.watched->user_watched() -
trakt.user.watchlist->user_watchlist()
tRakt 0.15.0
This is a big one, but not 1.0.0 big one I guess.
This is a consolidation release with lots of internal improvements, but for the 1.0.0 I decided to overhaul the structure of the package again, so before I completely break any kind of backwards compatiblity, I thought I’d get this one out.
Consolidation for the people
Major refactor of the docs. Sadly, the user will only notice a little more consistency.
Consolidate related functions into the same Rd page
Centrally document common parameters and reuse them where needed
Also consolidate many similar functions by factoring out the relevant bits into more flexible helper functions. In some cases those are exported as well.
In the process, some functions where partially renamed (
.show.->.shows.,.movie.->.movies.) for consistency.Rename
get_trakt_credentials->trakt_credentialsMany functions now return much flatter output, notably
*people*functions. They return alistwithcastandcrewobjects, which in turn are both flattibbles.
Features
- Improved search function (
trakt.search).- If the result has a
yearthat isNAbut a searchscore == 1000, that’s probably bad and dropped.
- If the result has a
- Added more of the automated list methods, like most anticipated, most played and most watched items.
- Added
trakt.user.historyfor user/:id/history methods
tRakt 0.14.0
Many functions were refactored, which in some cases changes the output.
Not only do most functions return a tibble now, but some additionally computed variables have been removed as well.
tRakt 0.13.0
-
Rename
trakt.getEpisodeData->trakt.get_all_episodes- Expand handling of
season_numsargument to make it easier to get all episodes of a show. - Vectorize to enable multiple target input
- Expand handling of
-
Rename
trakt.getFullShowData->trakt.get_full_showdata
tRakt 0.12.0
API changes, functional fixes
-
Add
dropunairedparam totrakt.seasons.summary(defaults toTRUE).- Requires
extendedto be more thanminsince the requiredaired_episodesfield is only present with higher levels of detail.
- Requires
-
Add
extendedparam totrakt.user.f* -
Fix
trakt.user.f*now returnNULLwhen the user is private instead of failing.
Internal changes
- User internal, generalized functions to reduce duplicate code for the following:
trakt.*.populartrakt.*.relatedtrakt.*.trendingtrakt.*.summarytrakt.*.ratings
Vectorization improvements
-
Add multiple target input support (vectorization) for:
-
trakt.user.f*functions: Results will berbinded together and asource_usercolumn is appended. -
trakt.seasons.season: Soon to maketrakt.getEpisodeDataobsolete. -
trakt.*.summary: Forcesforce_data_frametoTRUEto enablerbinding. -
trakt.*.related: Appendssourcecolumn containing respective inputid. -
trakt.*.ratings: Returns result as alistwith each entry containing data for each show or movie to accommodate thedistributionvariable (data.frame) -
trakt.people.summary: Appendspersoncolumn withtargetid. -
trakt.*.watching: Returnsdata.framewithsourcecolumn containing eachtarget.
-
tRakt 0.11.3
tRakt 0.11.2
API changes, functional fixes
-
Add
trakt.movie.watchingandtrakt.show.watching: Get trakt.tv users watching. -
Add
trakt.movie.releases: Gets release dates & certifications per movie. -
Fix
trakt.search.byid: Used to only work on shows, now actually works on movies. -
Fix
fix_datetime(internal): improve reliability.
tRakt 0.11.1
- Internal restructuring (moving functionally similar functions together)
- TODO: Create generic functions for both movie and show functions to reduce duplicate code
-
Add
extendedparam totrakt.user.watchlist - Improve consistency between
trakt.user.watchedandtrakt.user.collection- Rename
slugtoid.slug - Ensure proper datetime conversion
- Rename
-
Fix error in
trakt.user.watchlistwhentype = showswas ignored by accident
tRakt 0.11.0
-
Rename
trakt.getSeasons -> trakt.seasons.summaryfor consistency with the trakt API. -
Rename
trakt.show.season -> trakt.seasons.seasonfor consistency with the trakt API. -
Rename
getNameFromUrl -> parse_trakt_urlto be more descriptive. Also, de-camelCasezation. - Update vignette to reflect the above changes
-
Add some
peoplefunctions:trakt.people.summarytrakt.people.moviestrakt.people.shows
- Unify output of
trakt.show.peopleandtrakt.movie.people -
Add
extendedargument totrakt.movies.relatedandtrakt.shows.related(defaults tomin) -
Add
pageparam to paginated functions:trakt.shows.populartrakt.shows.trendingtrakt.movies.populartrakt.movies.trending
- The usual bug fixes
tRakt 0.10.3
-
trakt.user.stats:- Tidy up rating distribution
-
Remove
to.data.frameoption because the output is too messy
- Add another
@familytag to docs for aggregation functions (.popular,.trending,.related) - Individual functions don’t have to warn about missing headers, that’s
trakt.api.call’s job. -
trakt.getEpisodeData:- Explicitly drop episodes with
NAfirstaired fields - The
episode_absfield is usuallyNA, so let’s dumpepnumon it
- Explicitly drop episodes with
- Use
extended = "min"as default across functions for consistency with the trakt API
tRakt 0.10.2
- Add
yearparameter totrakt.search - If
queryintrakt.searchends with a 4 digit number, this will be used asyearparameter and stripped from the originalquery - Minor internal fixes
tRakt 0.10.1
- Add
testthattests - Internal changes to how/where datetime variables are converted (user doesn’t see any of that)
- If
lubridate::parse_date_timefails,as.POSIXctis used as a fallback
- If
- Various bug fixes
tRakt 0.10.0
-
Add movie functions:
-
trakt.movies.popular: Analogous totrakt.shows.popular -
trakt.movies.trending: Analogous totrakt.shows.trending -
trakt.movie.summary: Get a single movie’s details, analogous totrakt.show.summary -
trakt.movies.related: Get related movies -
trakt.movie.people: Analogous totrakt.show.people
-
-
Add both
trakt.show.ratingsandtrakt.movie.ratingsto receive just the ratings and distribution for a single show or movie -
Rename
trakt.show.related->trakt.shows.relatedfor consistency with.trendingand.popular - Expand allowed
targetparams in accordance with changed trakt API docs
tRakt 0.9.0
- Specified more exclusive package version requirements to avoid unforseen errors
- Add
trakt.user.ratings: Currently supported types:shows,movies,episodes - Add
extendedoption totrakt.shows.popularand.trending - Make code in vignette a little more robust
tRakt 0.8.1
- Fix a whole bunch of typos I only found after the CRAN release, naturally
- Improve consistency across functions
- The date fields ending in
.posixhave been removed and the existing date fiels are now converted toPOSIXctto remove cluttering -
firstaired.posix->first_airedetc
- The date fields ending in
- Update vignette for the above change
tRakt 0.8.0
- Added more user-facing functions (
trakt.user.following/.followers/.friends) because maybe I want to throw networkD3 at my people - Improve consistency with date variables: The
.posixvariables should be removed and the existing date variables should just be properly converted toPOSIXct - Improve documentation: Added
@familytags to all functions to group them together - Add a package vignette
- Minor fixes and non-breaking additions
- Trying to keep things organized and all I got was this inconsistently header’d NEWS.md
tRakt 0.0.1
2015-02-16
I’ve been working on some user-specific methods, so you can now use the trakt.user.* family of functions to get a user’s…
- Collection:
trakt.user.collection() - Watched items:
trakt.user.watched() - Stats:
trakt.user.stats()
All of them default to the username set in getOption("trakt.username"), but any publicly viewable user should work. Note that OAuth2 is not implemented, so private users can’t be accessed.
2015-02-11
As of today, all the functions are updated to use the new APIv2, except for trakt.show.stats, which is currently not yet implemented at trakt.tv, see their docs
Now the package is usable again, and I can continue to work on bug fixes and enhancements. Yay.
2015-02-10
I am now trying to migrate everything to the new trakt.tv APIv2. Since I mostly don’t know what I’m doing, I have to make this up as I go along, but oh well. Now the search function trakt.search should be working fine, as it is the only function that is tested/built with the new API in mind. Others to come.
