mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-04 08:13:07 +00:00
Code cleanup
This commit is contained in:
@@ -264,26 +264,6 @@ public class Song implements Parcelable {
|
|||||||
this.rating = rating;
|
this.rating = rating;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
Log.i(TAG, "increasePlayCount: " + isIncreased);
|
|
||||||
* Incremento il numero di ascolti solo se ho ascoltato la canzone da più tempo di:
|
|
||||||
* tempo dell'ultimo ascolto - (durata_canzone / 2)
|
|
||||||
* Ritorno un booleano
|
|
||||||
* Se vero, allora SongRepository scriverà nd DB l'incremento dell'ascolto
|
|
||||||
* Se falso, SongRepository non scriverà nulla nel db
|
|
||||||
*/
|
|
||||||
public boolean nowPlaying() {
|
|
||||||
long startPlayTime = Instant.now().toEpochMilli();
|
|
||||||
|
|
||||||
if (startPlayTime - (getDuration() / 2) > getLastPlay()) {
|
|
||||||
this.playCount++;
|
|
||||||
this.lastPlay = startPlayTime;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user