mrmBot-Matrix/utils
adroitwhiz 3de4858b5a
Clean up image API code paths (#49)
* Document image.js a bit

* Close image.js sockets in all code paths

I'm not sure whether sockets get GC'd when the function returns

* Remove getFormat

It was only called from one place, and the object property names were
quite confusing

* Clean up image.js conditional a bit

I had to write out an entire truth table for this and work it all out
Thinking hard

* Move actual ImageMagick calling into separate file

This gets rid of the weird, brain-melting ouroboros of code that
recurses across threads and processes.

* Reduce amount of getType wrangling

This amounted to an awful lot of dead conditionals after the image
commands were all modified to pass in image types anyway. This has also
led to two different implementations diverging, which causes bugs like
GIF commands applied to non-GIFs erroring instead of providing a
user-friendly message.

* Unify image-runner return type, clarify image type

This allows us to remove the fromAPI parameter from image-runner, and
helps greatly clarify the behavior around image types.

* Deduplicate GIF code, fix "not a GIF" handling

The special "nogif" value is now stored as the image type instead of its
value, as the value must always be a Buffer now--no loosely-typed
shenanigans.
2021-01-09 19:50:29 -06:00
..
database Made image API node chooser sort by job amount instead of CPU usage, added soundreload 2021-01-08 12:08:10 -06:00
pagination Fixed compatibility with Eris 0.13, get patron list dynamically 2020-10-06 10:18:33 -05:00
screenshot Fixed characters not being properly encoded, fixed images not being properly appended, more fixes 2020-09-09 21:36:20 -05:00
awaitrejoin.js Added initial music commands and category, moved lavalink node config to separate file 2020-07-06 15:19:30 -05:00
client.js Simplified and fixed image API, updated packages 2020-10-06 14:48:22 -05:00
collections.js More caching stuff, changed info command a bit 2020-12-18 14:46:59 -06:00
convertdb.js Final fixes 2020-12-29 20:33:51 -06:00
database.js Moved database driver-specific code to their own files 2020-12-18 18:50:25 -06:00
dbl.js Added leak and exec, moved from a config.json file to a .env file, other changes 2019-11-12 18:09:06 -06:00
handler.js Automatically disable voice commands if Lavalink is missing 2020-06-27 16:34:31 -05:00
help.js Fixed help page generator still attempting to register moderation commands 2021-01-04 14:35:24 -06:00
image-runner.js Clean up image API code paths (#49) 2021-01-09 19:50:29 -06:00
image.js Clean up image API code paths (#49) 2021-01-09 19:50:29 -06:00
imagedetect.js The image API no longer uses a unique thread for each job (due to image processing using its own thread anyway), added dummy DB driver 2021-01-06 16:10:31 -06:00
logger.js Removed extra image request for image commands, various other tweaks 2019-11-11 14:54:19 -06:00
misc.js Attempt to fix clean replacing empty text 2020-09-05 16:33:21 -05:00
parseCommand.js add parseCommand so it shows me on the esmbot github (#34) 2020-12-25 18:14:10 -06:00
soundplayer.js Made image API node chooser sort by job amount instead of CPU usage, added soundreload 2021-01-08 12:08:10 -06:00
twitter.js Migrated database to PostgreSQL, updated packages 2020-07-10 12:07:24 -05:00
urlcheck.js Reject feedback messages if they contain links, increased image request timeout, some other fixes 2020-08-13 08:47:41 -05:00
wrap.js Initial commit 2019-09-13 15:02:41 -05:00