Skip to content

Commit

Permalink
add parent genres to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Apr 20, 2024
1 parent 9c2eb7e commit cf66f72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/TEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions rose/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit cf66f72

Please sign in to comment.