mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 23:20:05 +02:00
Update:Only load Users when needed
This commit is contained in:
parent
1d974375a0
commit
354e16e462
7 changed files with 151 additions and 50 deletions
|
@ -250,7 +250,8 @@ class Server {
|
|||
|
||||
// Remove user media progress with items that no longer exist & remove seriesHideFrom that no longer exist
|
||||
async cleanUserData() {
|
||||
for (const _user of Database.users) {
|
||||
const users = await Database.models.user.getOldUsers()
|
||||
for (const _user of users) {
|
||||
if (_user.mediaProgress.length) {
|
||||
for (const mediaProgress of _user.mediaProgress) {
|
||||
const libraryItem = Database.libraryItems.find(li => li.id === mediaProgress.libraryItemId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue