mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
Feed and Setting models
This commit is contained in:
parent
bed3758268
commit
c7f457da3e
10 changed files with 236 additions and 10 deletions
|
|
@ -35,6 +35,12 @@ module.exports = (sequelize) => {
|
|||
|
||||
const { Book, PodcastEpisode, User, Device } = sequelize.models
|
||||
|
||||
User.hasMany(PlaybackSession)
|
||||
PlaybackSession.belongsTo(User)
|
||||
|
||||
Device.hasMany(PlaybackSession)
|
||||
PlaybackSession.belongsTo(Device)
|
||||
|
||||
Book.hasMany(PlaybackSession, {
|
||||
foreignKey: 'mediaItemId',
|
||||
constraints: false,
|
||||
|
|
@ -69,11 +75,5 @@ module.exports = (sequelize) => {
|
|||
}
|
||||
})
|
||||
|
||||
User.hasMany(PlaybackSession)
|
||||
PlaybackSession.belongsTo(User)
|
||||
|
||||
Device.hasMany(PlaybackSession)
|
||||
PlaybackSession.belongsTo(Device)
|
||||
|
||||
return PlaybackSession
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue