|
@@ -66,7 +66,7 @@ export async function content_VideoCategoryUpdated(
|
|
|
|
|
|
// ensure video category exists
|
|
// ensure video category exists
|
|
if (!videoCategory) {
|
|
if (!videoCategory) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video category update requested', videoCategoryId)
|
|
}
|
|
}
|
|
|
|
|
|
// read metadata
|
|
// read metadata
|
|
@@ -103,7 +103,7 @@ export async function content_VideoCategoryDeleted(
|
|
|
|
|
|
// ensure video category exists
|
|
// ensure video category exists
|
|
if (!videoCategory) {
|
|
if (!videoCategory) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video category deletion requested', videoCategoryId)
|
|
}
|
|
}
|
|
|
|
|
|
// remove video category
|
|
// remove video category
|
|
@@ -161,7 +161,7 @@ export async function content_VideoUpdated(
|
|
|
|
|
|
// ensure video exists
|
|
// ensure video exists
|
|
if (!video) {
|
|
if (!video) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video update requested', videoId)
|
|
}
|
|
}
|
|
|
|
|
|
// prepare changed metadata
|
|
// prepare changed metadata
|
|
@@ -213,7 +213,7 @@ export async function content_VideoDeleted(
|
|
|
|
|
|
// ensure video exists
|
|
// ensure video exists
|
|
if (!video) {
|
|
if (!video) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video deletion requested', videoId)
|
|
}
|
|
}
|
|
|
|
|
|
// remove video
|
|
// remove video
|
|
@@ -236,7 +236,7 @@ export async function content_VideoCensored(
|
|
|
|
|
|
// ensure video exists
|
|
// ensure video exists
|
|
if (!video) {
|
|
if (!video) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video censoring requested', videoId)
|
|
}
|
|
}
|
|
|
|
|
|
// update video
|
|
// update video
|
|
@@ -262,7 +262,7 @@ export async function content_VideoUncensored(
|
|
|
|
|
|
// ensure video exists
|
|
// ensure video exists
|
|
if (!video) {
|
|
if (!video) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('Non-existing video uncensoring requested', videoId)
|
|
}
|
|
}
|
|
|
|
|
|
// update video
|
|
// update video
|
|
@@ -310,6 +310,9 @@ export async function content_FeaturedVideosSet(
|
|
|
|
|
|
// escape if no featured video needs to be added
|
|
// escape if no featured video needs to be added
|
|
if (!toAdd) {
|
|
if (!toAdd) {
|
|
|
|
+ // emit log event
|
|
|
|
+ logger.info('Featured videos unchanged')
|
|
|
|
+
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -317,7 +320,7 @@ export async function content_FeaturedVideosSet(
|
|
const videosToAdd = await db.getMany(Video, { where: { id: [toAdd] } })
|
|
const videosToAdd = await db.getMany(Video, { where: { id: [toAdd] } })
|
|
|
|
|
|
if (videosToAdd.length != toAdd.length) {
|
|
if (videosToAdd.length != toAdd.length) {
|
|
- return inconsistentState()
|
|
|
|
|
|
+ return inconsistentState('At least one non-existing video featuring requested', toAdd)
|
|
}
|
|
}
|
|
|
|
|
|
// mark previously not-featured videos as featured
|
|
// mark previously not-featured videos as featured
|