From cf66f727267483adfd1311d4d922c865831a343a Mon Sep 17 00:00:00 2001 From: blissful Date: Sat, 20 Apr 2024 18:37:35 -0400 Subject: [PATCH] add parent genres to templates --- docs/TEMPLATES.md | 10 ++++++---- rose/templates.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/TEMPLATES.md b/docs/TEMPLATES.md index 3a43e51..897dfe4 100644 --- a/docs/TEMPLATES.md +++ b/docs/TEMPLATES.md @@ -83,10 +83,11 @@ compositionyear: int | None # The year that the release was composed. M new: bool # The "new"-ness of the release. See RELEASES.md for documentation on this feature. disctotal: int # The number of discs in the release. genres: list[str] +parent_genres: list[str] # The parent genres of `genres`, excluding `genres`. labels: list[str] catalognumber: str | None -releaseartists: ArtistMapping # All release artists: an object with 6 properties, each corresponding to one role. -releaseartists.main: list[Artist] # The Artist object has a `name` property with the artist name. +releaseartists: ArtistMapping # All release artists: an object with 6 properties, each corresponding to one role. +releaseartists.main: list[Artist] # The Artist object has a `name` property with the artist name. releaseartists.guest: list[Artist] releaseartists.remixer: list[Artist] releaseartists.producer: list[Artist] @@ -120,10 +121,11 @@ releaseyear: int | None compositionyear: int | None # The year that the release was composed. Mainly of interest in classical music. new: bool # The "new"-ness of the track's release. genres: list[str] +parent_genres: list[str] # The parent genres of `genres`, excluding `genres`. labels: list[str] catalognumber: str | None -releaseartists: ArtistMapping # All release artists: an object with 6 properties, each corresponding to one role. -releaseartists.main: list[Artist] # The Artist object has a `name` property with the artist name. +releaseartists: ArtistMapping # All release artists: an object with 6 properties, each corresponding to one role. +releaseartists.main: list[Artist] # The Artist object has a `name` property with the artist name. releaseartists.guest: list[Artist] releaseartists.remixer: list[Artist] releaseartists.producer: list[Artist] diff --git a/rose/templates.py b/rose/templates.py index 04f7b48..2b68140 100644 --- a/rose/templates.py +++ b/rose/templates.py @@ -281,6 +281,7 @@ def _calc_release_variables(release: CachedRelease, position: str | None) -> dic "new": release.new, "disctotal": release.disctotal, "genres": release.genres, + "parent_genres": release.parent_genres, "labels": release.labels, "releaseartists": release.releaseartists, "position": position, @@ -304,6 +305,7 @@ def _calc_track_variables(track: CachedTrack, position: str | None) -> dict[str, "catalognumber": track.release.catalognumber, "new": track.release.new, "genres": track.release.genres, + "parent_genres": track.release.parent_genres, "labels": track.release.labels, "releaseartists": track.release.releaseartists, "position": position,