Skip to content

Commit

Permalink
added clearViewingHistory(movieID,seriesAll,callback) addressing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
orgicus committed Mar 8, 2019
1 parent bc3af45 commit 555c23d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/netflix2.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,33 @@ Netflix.prototype.__getViewingHistory = function (page, callback) {
})
}

/**
* Clears viewhing history for a specific movie or series
* @param movieID - the ID of the movie (e.g. 80057281 for "Stranger Things")
* @param seriesAll - true if you want to clear the whole series, false otherwise
*/
Netflix.prototype.clearViewingHistory = function (movieID, seriesAll, callback) {
this.__clearViewingHistory(movieID, seriesAll, callback);
}

Netflix.prototype.__clearViewingHistory = function (movieID, seriesAll, callback) {
var options = {
body: {
movieID: movieID,
seriesAll: seriesAll,
authURL: this.authUrls[constants.yourAccountUrl]
},
method: 'POST'
}
var endpoint = constants.viewingActivity
this.__apiRequest(endpoint, options, function (error, response, json) {
if (error) {
return callback(error)
}
callback(null, json)
})
}

Netflix.prototype.__setRating = function (isThumbRating, titleId, rating, callback) {
var endpoint = isThumbRating ? constants.setThumbRatingEndpointUrl : constants.setVideoRatindEndpointUrl
var options = {
Expand Down

0 comments on commit 555c23d

Please sign in to comment.