Add backend support for users to follow series

Introduces a UserSeriesFollow model with a dedicated join table so users
can follow/unfollow series and receive socket notifications when new
books are added to followed series. The user JSON response now includes a
seriesFollowing array, and three new API endpoints are available under
/api/me/follows/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul DeVito 2026-03-22 20:29:11 -04:00
parent 8b89b27654
commit 37b95582a2
9 changed files with 744 additions and 5 deletions

View file

@ -162,6 +162,11 @@ class Database {
return this.models.device
}
/** @type {typeof import('./models/UserSeriesFollow')} */
get userSeriesFollowModel() {
return this.models.userSeriesFollow
}
/**
* Check if db file exists
* @returns {boolean}
@ -345,6 +350,7 @@ class Database {
require('./models/Setting').init(this.sequelize)
require('./models/CustomMetadataProvider').init(this.sequelize)
require('./models/MediaItemShare').init(this.sequelize)
require('./models/UserSeriesFollow').init(this.sequelize)
return this.sequelize.sync({ force, alter: false })
}