Skip to content

Commit

Permalink
fix shuffle in release edit
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed Apr 26, 2024
1 parent 9ed615f commit c5e9930
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions rose/releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ class MetadataRelease:
originaldate: RoseDate | None
compositiondate: RoseDate | None
artists: list[MetadataArtist]
labels: list[str]
edition: str | None
catalognumber: str | None
labels: list[str]
genres: list[str]
secondary_genres: list[str]
descriptors: list[str]
Expand All @@ -259,8 +259,8 @@ def from_cache(cls, release: CachedRelease, tracks: list[CachedTrack]) -> Metada
releasedate=release.releasedate,
originaldate=release.originaldate,
compositiondate=release.compositiondate,
edition=release.catalognumber,
catalognumber=release.edition,
edition=release.edition,
catalognumber=release.catalognumber,
labels=release.labels,
genres=release.genres,
secondary_genres=release.secondary_genres,
Expand All @@ -278,13 +278,12 @@ def from_cache(cls, release: CachedRelease, tracks: list[CachedTrack]) -> Metada
)

def serialize(self) -> str:
# LOL TOML DOESN'T HAVE A NULL TYPE. Use -9999 as sentinel. If your music is legitimately
# released in -9999, you should probably lay off the shrooms.
# TOML does not have a Null Type.
data = asdict(self)
data["releasedate"] = str(self.releasedate) if self.releasedate else ""
data["originaldate"] = str(self.originaldate) if self.originaldate else ""
data["compositiondate"] = str(self.compositiondate) if self.compositiondate else ""
data["edition"] = self.edition or -9999
data["edition"] = self.edition or ""
data["catalognumber"] = self.catalognumber or ""
return tomli_w.dumps(data)

Expand Down

0 comments on commit c5e9930

Please sign in to comment.