aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-11-15 15:00:19 +0100
committerChocobozzz <me@florianbigard.com>2022-11-15 15:00:23 +0100
commit99b757488c077cee7d0ab89eeec181a7ee6290eb (patch)
tree307a3f39285f899e3ed616d92aae1bdd181178e0 /server/models
parent4638cd713dcdd007cd7f49b9a95fa62ac7823e7c (diff)
downloadPeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.gz
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.zst
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.zip
Fix server lint
Diffstat (limited to 'server/models')
-rw-r--r--server/models/abuse/abuse.ts2
-rw-r--r--server/models/server/plugin.ts4
-rw-r--r--server/models/video/formatter/video-format-utils.ts2
-rw-r--r--server/models/video/sql/video/shared/abstract-video-query-builder.ts2
4 files changed, 5 insertions, 5 deletions
diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts
index f85f48e86..4c6a96a86 100644
--- a/server/models/abuse/abuse.ts
+++ b/server/models/abuse/abuse.ts
@@ -436,7 +436,7 @@ export class AbuseModel extends Model<Partial<AttributesOnly<AbuseModel>>> {
436 436
437 buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) { 437 buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) {
438 // Associated video comment could have been destroyed if the video has been deleted 438 // Associated video comment could have been destroyed if the video has been deleted
439 if (!this.VideoCommentAbuse || !this.VideoCommentAbuse.VideoComment) return null 439 if (!this.VideoCommentAbuse?.VideoComment) return null
440 440
441 const entity = this.VideoCommentAbuse.VideoComment 441 const entity = this.VideoCommentAbuse.VideoComment
442 442
diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts
index 6a5d80182..71c205ffa 100644
--- a/server/models/server/plugin.ts
+++ b/server/models/server/plugin.ts
@@ -122,7 +122,7 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> {
122 122
123 return PluginModel.findOne(query) 123 return PluginModel.findOne(query)
124 .then(p => { 124 .then(p => {
125 if (!p || !p.settings || p.settings === undefined) { 125 if (!p?.settings || p.settings === undefined) {
126 const registered = registeredSettings.find(s => s.name === settingName) 126 const registered = registeredSettings.find(s => s.name === settingName)
127 if (!registered || registered.default === undefined) return undefined 127 if (!registered || registered.default === undefined) return undefined
128 128
@@ -152,7 +152,7 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> {
152 const result: SettingEntries = {} 152 const result: SettingEntries = {}
153 153
154 for (const name of settingNames) { 154 for (const name of settingNames) {
155 if (!p || !p.settings || p.settings[name] === undefined) { 155 if (!p?.settings || p.settings[name] === undefined) {
156 const registered = registeredSettings.find(s => s.name === name) 156 const registered = registeredSettings.find(s => s.name === name)
157 157
158 if (registered?.default !== undefined) { 158 if (registered?.default !== undefined) {
diff --git a/server/models/video/formatter/video-format-utils.ts b/server/models/video/formatter/video-format-utils.ts
index 240619f69..f285db477 100644
--- a/server/models/video/formatter/video-format-utils.ts
+++ b/server/models/video/formatter/video-format-utils.ts
@@ -58,7 +58,7 @@ export type VideoFormattingJSONOptions = {
58} 58}
59 59
60function guessAdditionalAttributesFromQuery (query: VideosCommonQueryAfterSanitize): VideoFormattingJSONOptions { 60function guessAdditionalAttributesFromQuery (query: VideosCommonQueryAfterSanitize): VideoFormattingJSONOptions {
61 if (!query || !query.include) return {} 61 if (!query?.include) return {}
62 62
63 return { 63 return {
64 additionalAttributes: { 64 additionalAttributes: {
diff --git a/server/models/video/sql/video/shared/abstract-video-query-builder.ts b/server/models/video/sql/video/shared/abstract-video-query-builder.ts
index 3c74b0ea6..f0ce69501 100644
--- a/server/models/video/sql/video/shared/abstract-video-query-builder.ts
+++ b/server/models/video/sql/video/shared/abstract-video-query-builder.ts
@@ -302,7 +302,7 @@ export class AbstractVideoQueryBuilder extends AbstractRunQuery {
302 } 302 }
303 303
304 protected buildAttributesObject (prefixKey: string, attributeKeys: string[]) { 304 protected buildAttributesObject (prefixKey: string, attributeKeys: string[]) {
305 const result: { [id: string]: string} = {} 305 const result: { [id: string]: string } = {}
306 306
307 const prefixValue = prefixKey.replace(/->/g, '.') 307 const prefixValue = prefixKey.replace(/->/g, '.')
308 308