Make statistics filter start at 00:00 (#6371)

This commit is contained in:
ByteHamster 2023-03-11 17:44:01 +01:00 committed by GitHub
parent 95b97b6f49
commit 835f007b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1193,7 +1193,7 @@ public class PodDBAdapter {
+ TABLE_NAME_FEED_MEDIA + "." + KEY_POSITION + "> 0";
}
final String timeFilter = lastPlayedTime + ">=" + timeFilterFrom
+ " AND " + lastPlayedTime + "<=" + timeFilterTo;
+ " AND " + lastPlayedTime + "<" + timeFilterTo;
String playedTime = TABLE_NAME_FEED_MEDIA + "." + KEY_PLAYED_DURATION;
if (includeMarkedAsPlayed) {
playedTime = "(CASE WHEN " + playedTime + " != 0"

View File

@ -107,6 +107,10 @@ public class StatisticsFilterDialog {
private Pair<String[], Long[]> makeMonthlyList(long oldestDate, boolean inclusive) {
Calendar date = Calendar.getInstance();
date.setTimeInMillis(oldestDate);
date.set(Calendar.HOUR_OF_DAY, 0);
date.set(Calendar.MINUTE, 0);
date.set(Calendar.SECOND, 0);
date.set(Calendar.MILLISECOND, 0);
date.set(Calendar.DAY_OF_MONTH, 1);
ArrayList<String> names = new ArrayList<>();
ArrayList<Long> timestamps = new ArrayList<>();