| Crates.io | allfeat-music-genres |
| lib.rs | allfeat-music-genres |
| version | 0.2.9 |
| created_at | 2025-06-12 16:35:49.565793+00 |
| updated_at | 2025-08-09 23:42:40.375317+00 |
| description | Flat genre enum for the Allfeat blockchain with frontend-backend compatibility |
| homepage | https://allfeat.com |
| repository | https://github.com/allfeat/music-genres |
| max_upload_size | |
| id | 1709995 |
| size | 56,371 |
music-genres — Allfeat Genre RegistryRust crate that exposes a unified taxonomy of musical genres and subgenres for use on the Allfeat blockchain.
This crate provides a flat GenreId enum that includes all standardized music genres and subgenres. It is auto-generated from a central genres.json file.
It enables:
GenreId on-chain in Substrate pallets (Allfeat blockchain)genres.json: the central taxonomy file (main genres and subgenres)src/generated.rs: auto-generated Rust enum GenreIdbuild.rs: generates generated.rs from genres.jsonbuild.rs)Run the following to trigger generation (in dev only):
BUILD_GENRES=1 cargo build
This produces src/generated.rs, which includes:
GenreId enum (main + subgenres)Clone, Copy, PartialEq, Eq, PartialOrd, Ord, RuntimeDebug, Encode, Decode, DecodeWithMemTracking, TypeInfo, MaxEncodedLen🔒 This file is committed to version control and must not be edited manually.
// Generated enum:
GenreId::Rock
GenreId::HardRock
GenreId::Trap
// All genres (main or sub) are equal from the blockchain's perspective
// Used in the UI/SDK as hierarchical structure
{
id: "rock",
name: "Rock",
subgenres: [
{ id: "hard_rock", name: "Hard Rock" },
{ id: "classic_rock", name: "Classic Rock" },
]
}
The SDK is responsible for displaying and validating hierarchical logic. On-chain, only a flat GenreId is stored.
Modify genres.json
Regenerate the Rust file:
BUILD_GENRES=1 cargo build
Review and commit the changes to src/generated.rs
Do not manually edit generated.rs