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

Calculate and emit missing artist IDs #151

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/com/bolsinga/site/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,23 @@ 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();
List<String> artistsMissingIDs = new ArrayList<String>();
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());
artistsMissingIDs.add(artist.getName());
}
}
boolean hasMissingArtistIDs = artistsMissingIDs.size() != 0;
if (hasMissingArtistIDs) {
int nextID = artists.size() - artistsMissingIDs.size();
System.out.println("--Artist Missing IDs--");
for (String artistName : artistsMissingIDs) {
System.out.println("ar" + nextID + "^" + artistName);
nextID++;
}
}
return displayed;
return hasMissingArtistIDs;
}

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