mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-23 12:25:04 +02:00
Update:Rename UserCollections to Collections
This commit is contained in:
parent
fdf67e17a0
commit
4cbc8676c6
11 changed files with 30 additions and 37 deletions
|
@ -1,11 +1,11 @@
|
|||
const Logger = require('../Logger')
|
||||
const UserCollection = require('../objects/UserCollection')
|
||||
const Collection = require('../objects/Collection')
|
||||
|
||||
class CollectionController {
|
||||
constructor() { }
|
||||
|
||||
async create(req, res) {
|
||||
var newCollection = new UserCollection()
|
||||
var newCollection = new Collection()
|
||||
req.body.userId = req.user.id
|
||||
var success = newCollection.setData(req.body)
|
||||
if (!success) {
|
||||
|
|
|
@ -105,13 +105,6 @@ class UserController {
|
|||
}
|
||||
var user = req.reqUser
|
||||
|
||||
// delete user collections
|
||||
var userCollections = this.db.collections.filter(c => c.userId === user.id)
|
||||
var collectionsToRemove = userCollections.map(uc => uc.id)
|
||||
for (let i = 0; i < collectionsToRemove.length; i++) {
|
||||
await this.db.removeEntity('collection', collectionsToRemove[i])
|
||||
}
|
||||
|
||||
// Todo: check if user is logged in and cancel streams
|
||||
|
||||
var userJson = user.toJSONForBrowser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue