Skip to content

Commit

Permalink
trakttvv2: handle error 420
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Jan 31, 2025
1 parent 8fc3b43 commit 71ae5e6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions js/services/TraktTVv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ DuckieTV.factory('TraktTVv2', ['$q', '$http', 'SceneNameResolver',
return promiseRequest(type, param, param2, promise)
}

if (err.status == 420) {
// limit exceeded
console.error('Trakt 420: Limit exceeded, see https://github.com/SchizoDuckie/DuckieTV/issues/1447 for more details.')
return
}

if (err.status == 429) {
// rate limited, look at headers to see when we should try again otherwise just wait for a few seconds
var headers = err && err.headers ? err.headers() : {}
Expand Down Expand Up @@ -262,6 +268,11 @@ DuckieTV.factory('TraktTVv2', ['$q', '$http', 'SceneNameResolver',
// restart request and return original promise
return performPost(type, param)
}
if (err.status == 420) {
// limit exceeded
console.error('Trakt 420: Limit exceeded, see https://github.com/SchizoDuckie/DuckieTV/issues/1447 for more details.')
return
}
if (err.status == 429) {
// rate limited
var headers = err && err.headers ? err.headers() : {}
Expand Down

0 comments on commit 71ae5e6

Please sign in to comment.