generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the listen history JSON format a lot
- Loading branch information
Showing
21 changed files
with
306 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...it-tunes-api/src/main/java/net/pixaurora/kit_tunes/api/music/history/ListenDurations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.pixaurora.kit_tunes.api.music.history; | ||
|
||
import java.time.Duration; | ||
|
||
public interface ListenDurations { | ||
public Duration progress(); | ||
|
||
public Duration full(); | ||
} |
52 changes: 52 additions & 0 deletions
52
...s/kit-tunes-api/src/main/java/net/pixaurora/kit_tunes/api/music/history/ListenRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package net.pixaurora.kit_tunes.api.music.history; | ||
|
||
import java.time.Instant; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import net.pixaurora.kit_tunes.api.music.Album; | ||
import net.pixaurora.kit_tunes.api.music.Track; | ||
import net.pixaurora.kit_tunes.api.scrobble.ScrobblerId; | ||
|
||
public class ListenRecord { | ||
private final Track track; | ||
private final Optional<Album> album; | ||
private final Instant timestamp; | ||
|
||
private final ListenDurations durations; | ||
|
||
private final List<ScrobblerId> succeededScrobblers; | ||
|
||
public ListenRecord(Track track, Optional<Album> album, Instant timestamp, ListenDurations durations, | ||
List<ScrobblerId> succeededScrobblers) { | ||
this.track = track; | ||
this.album = album; | ||
this.timestamp = timestamp; | ||
this.durations = durations; | ||
this.succeededScrobblers = succeededScrobblers; | ||
} | ||
|
||
public Track track() { | ||
return this.track; | ||
} | ||
|
||
public Optional<Album> album() { | ||
return this.album; | ||
} | ||
|
||
public Instant timestamp() { | ||
return this.timestamp; | ||
} | ||
|
||
public ListenDurations durations() { | ||
return this.durations; | ||
} | ||
|
||
public List<ScrobblerId> succeededScrobblers() { | ||
return this.succeededScrobblers; | ||
} | ||
|
||
public void succeededFor(ScrobblerId scrobbler) { | ||
this.succeededScrobblers.add(scrobbler); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...tten_heart/impl/scrobble/ScrobblerId.java → ...a/kit_tunes/api/scrobble/ScrobblerId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...src/main/java/net/pixaurora/kitten_heart/impl/music/history/ImmutableListenDurations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.pixaurora.kitten_heart.impl.music.history; | ||
|
||
import java.time.Duration; | ||
|
||
import net.pixaurora.kit_tunes.api.music.history.ListenDurations; | ||
|
||
public class ImmutableListenDurations implements ListenDurations { | ||
private final Duration progress; | ||
private final Duration full; | ||
|
||
public ImmutableListenDurations(Duration progress, Duration full) { | ||
this.progress = progress; | ||
this.full = full; | ||
} | ||
|
||
@Override | ||
public Duration progress() { | ||
return this.progress; | ||
} | ||
|
||
@Override | ||
public Duration full() { | ||
return this.full; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.