Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Published albums must have at least one track #156

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

floehopper
Copy link
Member

Publishing an album with no tracks doesn't make much sense and causes exceptions like this one, because the album has no preview to point the audio element at.

We'll also need to unpublish any published albums that have no tracks. These can be found by running Album.published.select { |a| a.tracks.count == 0 }.map(&:slug). Currently there is only this one. I plan to email any affected artists to explain why we've unpublished their album. I contemplated doing the unpublishing in a migration, but since there's only one at the moment, I plan to do it in a Rails console in production.

Fixes #148.

Publishing an album with no tracks doesn't make much sense and causes
exceptions like this one [1], because the album has no preview to point
the audio element at.

[1]: https://app.rollbar.com/a/gofreerange/fix/item/jam/49

Fixes #148.
Copy link
Member

@chrislo chrislo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 👍

@floehopper floehopper merged commit a66ef07 into main Jan 16, 2024
2 checks passed
@floehopper floehopper deleted the published-albums-must-have-at-least-one-track branch January 16, 2024 20:10
@floehopper
Copy link
Member Author

Currently there is only this one. I plan to email any affected artists to explain why we've unpublished their album.

There was still only this one when I deployed, so I've unpublished the album and emailed the artist. I noticed that they have added a future release date to the album title, so I wonder if the album was acting as a placeholder for a forthcoming album.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a requirement that an album must have at least one track before it is published
2 participants