Faithful-Resource-Pack / API

A public API for Faithful Resource Pack textures, add-ons and more
https://api.faithfulpack.net
GNU Affero General Public License v3.0
0 stars 0 forks source link

Pack and Submission API #44

Closed 3vorp closed 7 months ago

3vorp commented 7 months ago

Currently, adding a new resource pack to Faithful involves manually editing several JSONs, some API interfaces, and there's little to no support for changing or deleting packs. The pack API aims to fix all of this with two new collections: packs.json and submissions.json.

Explanation

packs.json is the listing for every pack we use. This includes default packs, Classic Faithful, and the main Faithful packs. It contains a unified place for all the GitHub information, resolution, pack tags (new), display name, and more. Every pack can be guaranteed to have this information.

submissions.json is a subset of packs.json which stores all the packs that can be submitted to and have contributions generated for. Not all packs have a corresponding submission entry, but all submission entries have a corresponding pack. This is all the nitty-gritty information about submissions that the bot relies on — channel IDs, vote times, etc — and is also the one where the most editing can be done.

Okay, but how is this important?

By moving packs into their own collection and by ensuring every pack has an entry, many things can now be automated or no longer hardcoded. This includes:

Extra remarks

There are also endpoints to get or post submission and pack information at the same time, very similarly to how the texture collection merges uses, paths, and the textures themselves together.

The resolution field can be used in /compare by making sure that packs get sorted correctly.

You don't need a pack ID to make a pack — the API has an automatic serializer and returns the final key.

This PR closes #37