mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Code cleanup
This commit is contained in:
parent
bc6fc5be0f
commit
62f2723014
1 changed files with 0 additions and 20 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue