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') {
|
if (resource === 'astronomyPictureOfTheDay') {
|
||||||
download = this.getNodeParameter('download', 0);
|
download = this.getNodeParameter('download', 0);
|
||||||
|
|
||||||
if (download) {
|
if (download && responseData?.media_type === 'image') {
|
||||||
const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
|
const binaryProperty = this.getNodeParameter('binaryPropertyName', i);
|
||||||
|
|
||||||
const data = await nasaApiRequest.call(
|
const data = await nasaApiRequest.call(
|
||||||
|
@ -1130,7 +1130,12 @@ export class Nasa implements INodeType {
|
||||||
|
|
||||||
if (resource === 'earthImagery' && operation === 'get') {
|
if (resource === 'earthImagery' && operation === 'get') {
|
||||||
return [items];
|
return [items];
|
||||||
} else if (resource === 'astronomyPictureOfTheDay' && operation === 'get' && download) {
|
} else if (
|
||||||
|
resource === 'astronomyPictureOfTheDay' &&
|
||||||
|
operation === 'get' &&
|
||||||
|
download &&
|
||||||
|
responseData?.media_type === 'image'
|
||||||
|
) {
|
||||||
return [items];
|
return [items];
|
||||||
} else {
|
} else {
|
||||||
return [returnData];
|
return [returnData];
|
||||||
|
|
Loading…
Reference in a new issue