Skip to content

Commit

Permalink
Fix netflix season.
Browse files Browse the repository at this point in the history
In some upcoming teleplay, netflix does not return the season info will cause the script error.
  • Loading branch information
NobyDa authored May 28, 2020
1 parent a6f5888 commit 365d6e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nf_rating_season.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const netflixTitleCacheKey = "NetflixTitleCacheKey"
const map = $tool.read(netflixTitleCacheKey)
const id = url.match(/id=(\d+)/)[1]
const title = map ? JSON.parse(map)[id] : null
const obj = JSON.parse(body)

if (title) {
if (title && obj.shows[id].seasons) {
const key = $tool.read(imdbApikeyCacheKey)
const obj = JSON.parse(body)
const seasons = obj.shows[id].seasons.map(item => item.season)
const promises = []
for (let index = 0; index < seasons.length; index++) {
Expand Down

0 comments on commit 365d6e2

Please sign in to comment.