Update the output to be in alphabetical order
All checks were successful
Test / build (push) Successful in 11s
All checks were successful
Test / build (push) Successful in 11s
This commit is contained in:
parent
91c88b1180
commit
ee8bffa7ae
4 changed files with 10 additions and 7 deletions
|
@ -26,6 +26,7 @@ $ random-bunny
|
||||||
Archived = false
|
Archived = false
|
||||||
Author = Rabbit_Owner
|
Author = Rabbit_Owner
|
||||||
Downvotes = 0
|
Downvotes = 0
|
||||||
|
Gallery = https://i.redd.it/sfz0srdrimjc1.png, https://i.redd.it/sfz0srdrimjc1.png
|
||||||
Hidden = false
|
Hidden = false
|
||||||
Permalink = /r/Rabbits/comments/1av1rg9/cute_baby_bun/
|
Permalink = /r/Rabbits/comments/1av1rg9/cute_baby_bun/
|
||||||
Subreddit = Rabbits
|
Subreddit = Rabbits
|
||||||
|
@ -33,7 +34,6 @@ Subreddit Subscribers = 486084
|
||||||
Title = Cute baby bun
|
Title = Cute baby bun
|
||||||
Upvotes = 211
|
Upvotes = 211
|
||||||
Url = https://i.redd.it/sfz0srdrimjc1.png
|
Url = https://i.redd.it/sfz0srdrimjc1.png
|
||||||
Gallery = https://i.redd.it/sfz0srdrimjc1.png, https://i.redd.it/sfz0srdrimjc1.png
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- The `Gallery` field is only shown when there is more than 1 image returned, which then the `Url` field is the first image of that list.
|
- The `Gallery` field is only shown when there is more than 1 image returned, which then the `Url` field is the first image of that list.
|
||||||
|
|
|
@ -2,6 +2,7 @@ export default interface IRedditResult {
|
||||||
Archived: boolean,
|
Archived: boolean,
|
||||||
Author: string,
|
Author: string,
|
||||||
Downs: number,
|
Downs: number,
|
||||||
|
Gallery: string[],
|
||||||
Hidden: boolean,
|
Hidden: boolean,
|
||||||
Permalink: string,
|
Permalink: string,
|
||||||
Subreddit: string,
|
Subreddit: string,
|
||||||
|
@ -9,5 +10,4 @@ export default interface IRedditResult {
|
||||||
Title: string,
|
Title: string,
|
||||||
Ups: number,
|
Ups: number,
|
||||||
Url: string,
|
Url: string,
|
||||||
Gallery: string[],
|
|
||||||
}
|
}
|
|
@ -14,7 +14,13 @@ export default class OutputHelper {
|
||||||
outputLines.push(`Archived = ${result.Archived}`);
|
outputLines.push(`Archived = ${result.Archived}`);
|
||||||
outputLines.push(`Author = ${result.Author}`);
|
outputLines.push(`Author = ${result.Author}`);
|
||||||
outputLines.push(`Downvotes = ${result.Downs}`);
|
outputLines.push(`Downvotes = ${result.Downs}`);
|
||||||
|
|
||||||
|
if (result.Gallery.length > 1) {
|
||||||
|
outputLines.push(`Gallery = ${result.Gallery.join(", ")}`);
|
||||||
|
}
|
||||||
|
|
||||||
outputLines.push(`Hidden = ${result.Hidden}`);
|
outputLines.push(`Hidden = ${result.Hidden}`);
|
||||||
|
|
||||||
outputLines.push(`Permalink = ${result.Permalink}`);
|
outputLines.push(`Permalink = ${result.Permalink}`);
|
||||||
outputLines.push(`Subreddit = ${result.Subreddit}`);
|
outputLines.push(`Subreddit = ${result.Subreddit}`);
|
||||||
outputLines.push(`Subreddit Subscribers = ${result.SubredditSubscribers}`);
|
outputLines.push(`Subreddit Subscribers = ${result.SubredditSubscribers}`);
|
||||||
|
@ -22,9 +28,6 @@ export default class OutputHelper {
|
||||||
outputLines.push(`Upvotes = ${result.Ups}`);
|
outputLines.push(`Upvotes = ${result.Ups}`);
|
||||||
outputLines.push(`Url = ${result.Url}`);
|
outputLines.push(`Url = ${result.Url}`);
|
||||||
|
|
||||||
if (result.Gallery.length > 1) {
|
|
||||||
outputLines.push(`Gallery = ${result.Gallery.join(", ")}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.queryMetadata != null) {
|
if (options.queryMetadata != null) {
|
||||||
outputLines.push(`Query.Subreddit = ${response.Query.subreddit}`);
|
outputLines.push(`Query.Subreddit = ${response.Query.subreddit}`);
|
||||||
|
|
|
@ -35,12 +35,12 @@ exports[`GenerateOutput GIVEN the Gallery input has more than 1 item, EXPECT Gal
|
||||||
"Archived = false
|
"Archived = false
|
||||||
Author = author
|
Author = author
|
||||||
Downvotes = 0
|
Downvotes = 0
|
||||||
|
Gallery = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d, https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d
|
||||||
Hidden = false
|
Hidden = false
|
||||||
Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/
|
Permalink = /r/Rabbits/comments/1dj8pbt/this_is_my_ms_bear/
|
||||||
Subreddit = Rabbits
|
Subreddit = Rabbits
|
||||||
Subreddit Subscribers = 654751
|
Subreddit Subscribers = 654751
|
||||||
Title = This is my Ms Bear!
|
Title = This is my Ms Bear!
|
||||||
Upvotes = 17
|
Upvotes = 17
|
||||||
Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d
|
Url = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
|
||||||
Gallery = https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d, https://preview.redd.it/d5yno653zf7d1.jpg?width=640&crop=smart&auto=webp&s=5064d1caec3c12ac2855eb57ff131d0b313d5e9d"
|
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in a new issue