|
|
|
@ -55,5 +55,32 @@ public class Result |
|
|
|
|
return "Result{" + "link=" + link + ", artist=" + artist + ", album=" + album + ", title=" + title + '}'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setAlbumArtist(String field) |
|
|
|
|
{ |
|
|
|
|
// System.out.println("Parsing album-artist: " + field);
|
|
|
|
|
String fieldLower = field.toLowerCase(); |
|
|
|
|
if (fieldLower.contains("from") || field.toLowerCase().contains("by")) |
|
|
|
|
{ |
|
|
|
|
artist = ""; |
|
|
|
|
album = ""; |
|
|
|
|
String[] words = field.split("\\s+"); |
|
|
|
|
boolean readingArtist = false; |
|
|
|
|
for (String word: words) |
|
|
|
|
{ |
|
|
|
|
if (word.equals("from")) |
|
|
|
|
readingArtist = false; |
|
|
|
|
else if (word.equals("by")) |
|
|
|
|
readingArtist = true; |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (readingArtist) |
|
|
|
|
artist += word + " "; |
|
|
|
|
else |
|
|
|
|
album += word + " "; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|