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:
The pack list in /texture.
Pack tags can be used to automatically generate /compare selections.
Renaming a pack can easily be done with the new /packs/rename/{old}/{new} endpoint.
The Faithful gallery pack list.
The pack list in the webapp contribution page.
A new web app page for adding new packs with ease.
Facilitating #39 by having pack IDs actually mean something.
More configurable and modular submission bot.
Fully featured search by resolution, display name, tags, etc
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.
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
andsubmissions.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 ofpacks.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:
/texture
./compare
selections./packs/rename/{old}/{new}
endpoint.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