elliotjarnit / AlbumPosterGenerator

Creates a poster based on any album
https://postergen.elliotjarnit.dev/
MIT License
33 stars 5 forks source link

Automatic track removal if name & duration are blank #12

Closed ctrleo closed 6 months ago

ctrleo commented 6 months ago

Hi there! I was using ur app to make a poster and wanted to remove a track, but if I blanked it out, the app would throw the duration regex error, and if wrote it as 00:00 the image wouldnt generate at all. So heres the changes I made:

Changes

  1. tracklist declaration changed from block scoped to function scoped (line 268)
  2. added if statement to check if both name and duration are blank, and if so, remove that track from the array (lines 274-276)
  3. Changed duration error message to include track number (line 280)
  4. Added else if statement to check if name is blank (but tracklist populated) and display an error notification in that scenario (lines 287-297)
  5. Changed post request to api to use the array (tracklist) we verified earlier (line 321)

Hope this helps!

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
album-poster-generator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2024 1:58pm
elliotjarnit commented 6 months ago

Awesome changes, thank you! Code looks good, will test and then merge.