BytewaveMLP / node-derpi

A (WIP) Derpibooru API wrapper for Node.js
MIT License
7 stars 2 forks source link

Tag names take precedence over IDs in tags.json #2

Closed BytewaveMLP closed 6 years ago

BytewaveMLP commented 6 years ago

Tags can be fetched at both tags/NAME.json and tags/ID.json, where tags/NAME.json takes priority

So, if I named a tag 12345, whatever tag ID 12345 is would no longer be fetchable by ID.

Looks like I'll have to update my tag fetching stuff to fetch by name instead. Which also means I'll need byte[]'s sluggify code.

new_name.gsub!('-', '-dash-')
new_name.gsub!('/', '-fwslash-')
new_name.gsub!('\\', '-bwslash-')
new_name.gsub!(':', '-colon-')
new_name.gsub!('.', '-dot-')
new_name.gsub!('+', '-plus-')

Thanks, Derpi.

BytewaveMLP commented 6 years ago

Closed in 89fd95f88faa41ccd09dc7cf8eeafd4335b43b7d.

Added fetchTagByID and fetchUserByID methods to Fetch.