Recent Releases of trakt
trakt - tRakt 0.17.0
This is been well over a year of "hobby project staleness days what?", but alas, it is done(ish).
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.
- R
Published by jemus42 over 1 year ago
trakt - 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 snakecase and drop the trakt. prefix.
This results in (most) functions mapping directly to API endpoints in the form `sectionmethod,
e.g. the API endpointmovies/collectedis handled by functionmovies_collected()`.
Search
trakt.search->search_query()trakt.search.byid->search_id()
Dynamic Lists
trakt.popular- ->
movies_popular() - ->
shows_popular()
- ->
trakt.trending- ->
movies_trending() - ->
shows_trending()
- ->
trakt.anticipated- ->
movies_anticipated() - ->
shows_anticipated()
- ->
trakt.played- ->
movies_played() - ->
shows_played()
- ->
trakt.watched- ->
movies_watched() - ->
shows_watched()
- ->
trakt.collected()- ->
movies_collected() - ->
shows_collected()
- ->
trakt.updates()- ->
movies_updates() - ->
shows_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- ->
user_followers() - ->
user_following() - ->
user_friends()
- ->
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()
- R
Published by jemus42 almost 4 years ago
trakt - 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
- R
Published by jemus42 over 6 years ago
trakt - Is this thing still on?
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.
Starting to clean things up with some major housekeeping
usethis::use_*all the things, basically.- Add a
pkgdownsite and aREADME.Rmd - Use
codecov - Apply
styler::style_pkg() - Update documentation to use markdown
- Redo vignette
- Tests. So many tests.
Less plyr, more purrr
- Completely removed plyr dependency in favor of purrr
- R
Published by jemus42 over 7 years ago
trakt - Less camelCase for the Greater Good
- 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
- R
Published by jemus42 over 11 years ago
trakt - Vectorization, Generalization, Bugfixization
v0.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.
- R
Published by jemus42 over 11 years ago
trakt - v0.11.3
API changes, functional fixes
- Add
build_trakt_urlto ease trakt API URL assembly and reduce duplicate code. - Add
force_data_frameoption totrakt.*.summary: Forces unnesting. - Rename
trakt.show.statstotrakt.stats, will work with both movies and shows as soon as the API endpoint actually works.
Minor changes
- Expand
@familytags in docs a little
- R
Published by jemus42 over 11 years ago
trakt - Some New Stuff, Some Fixed Stuff
v0.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
convert_datetime(internal): improve reliability.
Minor changes
- Fix documentation error in
*.movie.*functions. - Added tests for new functions
- R
Published by jemus42 over 11 years ago
trakt - Moving Stuff Around and Calling it Progress
- 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
- R
Published by jemus42 over 11 years ago
trakt - The "People… and also other stuff"-Update
- 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
- R
Published by jemus42 over 11 years ago
trakt - Consistency is Good. Right?
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
- R
Published by jemus42 over 11 years ago
trakt - Oh Search, You Silly Goose
- 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
- R
Published by jemus42 over 11 years ago
trakt - Use Tests. Tests are Good.
- 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
- R
Published by jemus42 over 11 years ago
trakt - Well, I Should Have Done that Last Week
- 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
Unfortunately, this and the previous release are kind of important if you start writing code with it, so it's kind of crappy that I have to wait a while to push an update to CRAN, but oh well. That's what GitHub is for.
- R
Published by jemus42 over 11 years ago
trakt - Barely Not Embarrassing Anymore
- 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
- R
Published by jemus42 over 11 years ago
trakt - More functions, more yay
At this point, the package includes the basic show-related functions, as well as a new group of functions for user-specific data: trakt.user.*
These can be used to access a users watched items, collection and stats.
Besides that, I tried my best to add a vignette, to illustrate the basic functionality as I intended it to be used.
I hope it doesn't break horribly now.
- R
Published by jemus42 over 11 years ago
trakt - Well, at least it doesn't blow up anymore! Probably!
As of now, all the functions are APIv2 ready.
The package is able to consistently (I hope) output the data provided by the trakt.tv API, and it also provides a generic wrapper function which can be used to query any APIv2 endpoint.
As far as authentication is concerned, no OAuth2 methods are supported, but the package uses your credentials (see Readme for details) to make proper queries to the API.
Since the goal of this function is to collect data about tv shows, user-specific methods which require OAauth2 are not a priority.
The next step is to implement more API methods. Maybe I'll tip my toe into movie data, too.
- R
Published by jemus42 over 11 years ago
trakt - It barely works!
After a lot of back and forth on JSON dependencies, this version only needs one JSON package dependency, namely jsonlite, and it circumvents the UTF-8 issues by manually pumping some stuff through iconv, so technically it should be stable and spit out decent data structures.
Long story short: It's kind of functional, but there's still a lot to do.
- R
Published by jemus42 almost 12 years ago