mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(NASA Node): Astronomy-Picture-Of-The-Day fails when it's YouTube video (#11046)
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
This commit is contained in:
parent
f124687b01
commit
c70969da2b
|
@ -1069,7 +1069,7 @@ export class Nasa implements INodeType {
|
|||
if (resource === 'astronomyPictureOfTheDay') {
|
||||
download = this.getNodeParameter('download', 0);
|
||||
|
||||
if (download) {
|
||||
if (download && responseData?.media_type === 'image') {
|
||||
const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
|
||||
|
||||
const data = await nasaApiRequest.call(
|
||||
|
@ -1130,7 +1130,12 @@ export class Nasa implements INodeType {
|
|||
|
||||
if (resource === 'earthImagery' && operation === 'get') {
|
||||
return [items];
|
||||
} else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
|
||||
} else if (
|
||||
resource === 'astronomyPictureOfTheDay' &&
|
||||
operation === 'get' &&
|
||||
download &&
|
||||
responseData?.media_type === 'image'
|
||||
) {
|
||||
return [items];
|
||||
} else {
|
||||
return [returnData];
|
||||
|
|
Loading…
Reference in a new issue