[PR #3546] [MERGED] API PATCH /me/progress/:id - allow providing createdAt and respect provided finishedAt when syncing progress #4012

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3546
Author: @justcallmelarry
Created: 10/23/2024
Status: Merged
Merged: 3/1/2025
Merged by: @advplyr

Base: masterHead: master


📝 Commits (2)

  • 9b01d11 allow setting createdAt and respect set finishedAt when syncing progress
  • 2fdab39 Merge branch 'advplyr:master' into master

📊 Changes

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

View changed files

📝 server/models/User.js (+2 -1)

📄 Description

I was trying to make a script to set some of my old read books to done, but to avoid screwing up the stats i wanted to set them on a previous year.

I noticed some issues however, and during my research I found that there are some issues when creating and updating mediaProgress

  • createdAt (or startedAt, as the api documentation states) was not respected at all at either during creation or update.
  • finishedAt was not respected during creation, but can be updated after the initial call.

For the first issue, this allows createdAt to be set on creation but I could not figure out how to let it be updatable. My suspicion is that there is some magic going on which disallows the field createdAt to be updated due to sequelize default timestamps on their models.

For the second issue I just found where the finishedAt timestamp was overwritten on creation, and fixed the issue.


🔄 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/3546 **Author:** [@justcallmelarry](https://github.com/justcallmelarry) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 3/1/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`9b01d11`](https://github.com/advplyr/audiobookshelf/commit/9b01d11b27fa0e56debac8610dd02b1cea3aeecc) allow setting createdAt and respect set finishedAt when syncing progress - [`2fdab39`](https://github.com/advplyr/audiobookshelf/commit/2fdab39e27baf22c38e03f339376270eb8afc9ac) Merge branch 'advplyr:master' into master ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/models/User.js` (+2 -1) </details> ### 📄 Description I was trying to make a script to set some of my old read books to done, but to avoid screwing up the stats i wanted to set them on a previous year. I noticed some issues however, and during my research I found that there are some issues when creating and updating `mediaProgress` * `createdAt` (or `startedAt`, as the api documentation states) was not respected at all at either during creation or update. * `finishedAt` was not respected during creation, but can be updated after the initial call. For the first issue, this allows `createdAt` to be set on _creation_ but I could not figure out how to let it be updatable. My suspicion is that there is some magic going on which disallows the field `createdAt` to be updated due to [sequelize default timestamps on their models](https://sequelize.org/docs/v6/core-concepts/model-basics/#timestamps). For the second issue I just found where the `finishedAt` timestamp was overwritten on creation, and fixed the issue. --- <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:17:57 +02:00
adam closed this issue 2026-04-25 00:17:57 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4012