added album to scrobble
This commit is contained in:
parent
6b465e25fe
commit
e2cd31f242
@ -8,12 +8,19 @@ public class Scrobble {
|
|||||||
|
|
||||||
private LocalDateTime dateTime;
|
private LocalDateTime dateTime;
|
||||||
private Track track;
|
private Track track;
|
||||||
|
private Album album;
|
||||||
|
|
||||||
public Scrobble(long uts, Track track) {
|
public Scrobble(long uts, Track track) {
|
||||||
this.track = track;
|
this.track = track;
|
||||||
this.dateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(uts), ZoneId.systemDefault());
|
this.dateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(uts), ZoneId.systemDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Scrobble(long uts, Track track, Album album) {
|
||||||
|
this.track = track;
|
||||||
|
this.album = album;
|
||||||
|
this.dateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(uts), ZoneId.systemDefault());
|
||||||
|
}
|
||||||
|
|
||||||
public LocalDateTime getDateTime() {
|
public LocalDateTime getDateTime() {
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
@ -22,8 +29,25 @@ public class Scrobble {
|
|||||||
return track;
|
return track;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Album getAlbum() {
|
||||||
|
return album;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Artist getArtist() {
|
||||||
|
return track.getArtist();
|
||||||
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return dateTime + " " + track.toString();
|
|
||||||
|
String string = "Scrobble: " + dateTime + " " + track.getName();
|
||||||
|
|
||||||
|
if(album != null) {
|
||||||
|
string += " " + album.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
string += " " + track.getArtist().getName();
|
||||||
|
|
||||||
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user