mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00: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:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user