Skip to content

Commit

Permalink
galore ⭐
Browse files Browse the repository at this point in the history
  • Loading branch information
lacymorrow committed Feb 27, 2018
1 parent 2d1d1c7 commit ff2e94f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

}

if ( opts.output !== 'all' && opts.output !== 'backdrop' ) ) {
if ( opts.output !== 'all' && opts.output !== 'backdrop' ) {

opts.output = 'poster'

Expand Down Expand Up @@ -155,14 +155,18 @@

// Success
const size = sizes.indexOf( opts.size ) !== -1 ? opts.size : sizes[sizes.length - 1]
if( opts.output === 'all' ) {
if ( opts.output === 'all' ) {

return {
backdrop: encodeURI( baseURL + size + json.results[0].backdrop_path ),
poster: encodeURI( baseURL + size + json.results[0].poster_path )
}

} else {

const image = opts.output === 'backdrop' ? json.results[0].backdrop_path : json.results[0].poster_path
return encodeURI( baseURL + size + image)
return encodeURI( baseURL + size + image )

}

}
Expand Down

0 comments on commit ff2e94f

Please sign in to comment.