Skip to content

Commit

Permalink
Dump all missing artist IDs instead of asserting when first found. (#150
Browse files Browse the repository at this point in the history
)

This will allow clean up to occur more quickly.
  • Loading branch information
bolsinga authored Aug 5, 2024
1 parent 583e7a2 commit c078b07
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/com/bolsinga/music/data/raw/Artist.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ private Artist(final String name) {
}

public String getID() {
assert fID != null : "No ID for: " + fName;
return fID;
}

Expand Down
18 changes: 18 additions & 0 deletions src/com/bolsinga/site/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,28 @@ private void dumpSimilarArtists(final com.bolsinga.music.data.Music music) {
}
}

private boolean dumpMissingArtistIDs(final com.bolsinga.music.data.Music music) {
boolean displayed = false;
List<? extends com.bolsinga.music.data.Artist> artists = music.getArtists();
for (com.bolsinga.music.data.Artist artist : artists) {
if (artist.getID() == null) {
if (!displayed) {
System.out.println("--Artist Missing IDs--");
displayed = true;
}
System.out.println(artist.getName());
}
}
return displayed;
}

private void generateSite(final com.bolsinga.music.data.Music music, final com.bolsinga.diary.data.Diary diary, final String output) throws Exception {
CSS.install(output);

dumpSimilarArtists(music);
if (dumpMissingArtistIDs(music)) {
throw new com.bolsinga.web.WebException("Missing Artist IDs");
}

// Diary items
MainDocumentCreator.createDocuments(fBackgrounder, this, diary, output, music);
Expand Down

0 comments on commit c078b07

Please sign in to comment.