diff --git a/src/com/bolsinga/music/data/raw/Artist.java b/src/com/bolsinga/music/data/raw/Artist.java index 90c5b19..cdd8e27 100644 --- a/src/com/bolsinga/music/data/raw/Artist.java +++ b/src/com/bolsinga/music/data/raw/Artist.java @@ -162,7 +162,6 @@ private Artist(final String name) { } public String getID() { - assert fID != null : "No ID for: " + fName; return fID; } diff --git a/src/com/bolsinga/site/Main.java b/src/com/bolsinga/site/Main.java index d80eca5..2ec7b50 100644 --- a/src/com/bolsinga/site/Main.java +++ b/src/com/bolsinga/site/Main.java @@ -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 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);