[PR #4770] [MERGED] Don't require listening today for 'Days in a row' stat #4343

Closed
opened 2026-04-25 00:19:22 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4770
Author: @jamerst
Created: 10/23/2025
Status: Merged
Merged: 11/20/2025
Merged by: @advplyr

Base: masterHead: days-in-a-row-today-optional


📝 Commits (2)

  • f77de17 Don't require listening today for 'Days in a row' stat
  • 39b8b9d Auto formatting

📊 Changes

1 file changed (+8 additions, -2 deletions)

View changed files

📝 client/components/stats/DailyListeningChart.vue (+8 -2)

📄 Description

Brief summary

Adjust logic for calculating 'Days in a row' stat to not require listening on the current day.

I usually listen at the end of the day, so this allows viewing the stat before you've listened for the day.

Which issue is fixed?

N/A - no associated issue currently

In-depth Description

Changes day counting logic to start counting from yesterday instead of today, so that there doesn't need to be any activity for the current day.

If there is activity for the current day this is counted at the end once the last day with no activity has been found.

How have you tested this?

Set some temporary test data in the ApiRouter.getUserListeningStatsHelpers method to mock appropriate activity on dates:
image

Screenshots

No visual changes, only change is to the value shown for "Days in a row".

With no activity on the current day:
image

With activity on the current day:
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4770 **Author:** [@jamerst](https://github.com/jamerst) **Created:** 10/23/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `days-in-a-row-today-optional` --- ### 📝 Commits (2) - [`f77de17`](https://github.com/advplyr/audiobookshelf/commit/f77de1743e2f764ba2d9b5b7fa8c3472d04624c4) Don't require listening today for 'Days in a row' stat - [`39b8b9d`](https://github.com/advplyr/audiobookshelf/commit/39b8b9df4f977e8b75814ac9e982e990659e2953) Auto formatting ### 📊 Changes **1 file changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/components/stats/DailyListeningChart.vue` (+8 -2) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary <!-- Please provide a brief summary of what your PR attempts to achieve. --> Adjust logic for calculating 'Days in a row' stat to not require listening on the current day. I usually listen at the end of the day, so this allows viewing the stat before you've listened for the day. ## Which issue is fixed? <!-- Which issue number does this PR fix? Ex: "Fixes #1234" --> N/A - no associated issue currently ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it solve a problem that affects multiple users or is this an edge case for your setup? --> Changes day counting logic to start counting from yesterday instead of today, so that there doesn't need to be any activity for the current day. If there is activity for the current day this is counted at the end once the last day with no activity has been found. ## How have you tested this? <!-- Please describe in detail with reproducible steps how you tested your changes. --> Set some temporary test data in the `ApiRouter.getUserListeningStatsHelpers` method to mock appropriate activity on dates: <img width="336" height="139" alt="image" src="https://github.com/user-attachments/assets/54917c49-0030-41d4-bea0-af10b37bbb5b" /> ## Screenshots <!-- If your PR includes any changes to the web client, please include screenshots or a short video from before and after your changes. --> No visual changes, only change is to the value shown for "Days in a row". With no activity on the current day: <img width="797" height="336" alt="image" src="https://github.com/user-attachments/assets/af81eff5-7cb3-4e0b-826c-7a71c71638c3" /> With activity on the current day: <img width="802" height="344" alt="image" src="https://github.com/user-attachments/assets/94b54bfa-b970-4816-ad3b-71b7c8596dc1" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:22 +02:00
adam closed this issue 2026-04-25 00:19:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4343