mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[PR #3546] [MERGED] API PATCH /me/progress/:id - allow providing createdAt and respect provided finishedAt when syncing progress #4012
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
master← Head:master📝 Commits (2)
9b01d11allow setting createdAt and respect set finishedAt when syncing progress2fdab39Merge 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
mediaProgresscreatedAt(orstartedAt, as the api documentation states) was not respected at all at either during creation or update.finishedAtwas not respected during creation, but can be updated after the initial call.For the first issue, this allows
createdAtto 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 fieldcreatedAtto be updated due to sequelize default timestamps on their models.For the second issue I just found where the
finishedAttimestamp 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.