Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Remove invalid db value checker

Chocobozzz74b62dcb850a
diff --git a/server/core/models/actor/actor-image.ts b/server/core/models/actor/actor-image.ts
index 782578ca1c..d7e7b163e6 100644
--- a/server/core/models/actor/actor-image.ts
+++ b/server/core/models/actor/actor-image.ts
@@ -10,15 +10,13 @@ import {
Column,
CreatedAt,
Default,
- ForeignKey,
- Is, Table,
+ ForeignKey, Table,
UpdatedAt
} from 'sequelize-typescript'
-import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
import { logger } from '../../helpers/logger.js'
import { CONFIG } from '../../initializers/config.js'
import { LAZY_STATIC_PATHS, MIMETYPES, WEBSERVER } from '../../initializers/constants.js'
-import { SequelizeModel, buildSQLAttributes, throwIfNotValid } from '../shared/index.js'
+import { SequelizeModel, buildSQLAttributes } from '../shared/index.js'
import { ActorModel } from './actor.js'
@Table({
@@ -51,7 +49,6 @@ export class ActorImageModel extends SequelizeModel<ActorImageModel> {
width: number
@AllowNull(true)
- @Is('ActorImageFileUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'fileUrl', true))
@Column
fileUrl: string
diff --git a/server/core/models/redundancy/video-redundancy.ts b/server/core/models/redundancy/video-redundancy.ts
index 3e44caf5f8..aa0126cd5e 100644
--- a/server/core/models/redundancy/video-redundancy.ts
+++ b/server/core/models/redundancy/video-redundancy.ts
@@ -1,17 +1,3 @@
-import sample from 'lodash-es/sample.js'
-import { literal, Op, QueryTypes, Transaction, WhereOptions } from 'sequelize'
-import {
- AllowNull,
- BeforeDestroy,
- BelongsTo,
- Column,
- CreatedAt,
- DataType,
- ForeignKey,
- Is, Scopes,
- Table,
- UpdatedAt
-} from 'sequelize-typescript'
import {
ActivityVideoUrlObject,
CacheFileObject,
@@ -24,9 +10,24 @@ import {
VideoRedundancyStrategyWithManual
} from '@peertube/peertube-models'
import { isTestInstance } from '@peertube/peertube-node-utils'
+import { getVideoFileMimeType } from '@server/lib/video-file.js'
import { getServerActor } from '@server/models/application/application.js'
import { MActor, MVideoForRedundancyAPI, MVideoRedundancy, MVideoRedundancyAP, MVideoRedundancyVideo } from '@server/types/models/index.js'
-import { isActivityPubUrlValid, isUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
+import sample from 'lodash-es/sample.js'
+import { literal, Op, QueryTypes, Transaction, WhereOptions } from 'sequelize'
+import {
+ AllowNull,
+ BeforeDestroy,
+ BelongsTo,
+ Column,
+ CreatedAt,
+ DataType,
+ ForeignKey,
+ Is, Scopes,
+ Table,
+ UpdatedAt
+} from 'sequelize-typescript'
+import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
import { logger } from '../../helpers/logger.js'
import { CONFIG } from '../../initializers/config.js'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants.js'
@@ -38,7 +39,6 @@ import { VideoChannelModel } from '../video/video-channel.js'
import { VideoFileModel } from '../video/video-file.js'
import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist.js'
import { VideoModel } from '../video/video.js'
-import { getVideoFileMimeType } from '@server/lib/video-file.js'
export enum ScopeNames {
WITH_VIDEO = 'WITH_VIDEO'
@@ -102,7 +102,6 @@ export class VideoRedundancyModel extends SequelizeModel<VideoRedundancyModel> {
expiresOn: Date
@AllowNull(false)
- @Is('VideoRedundancyFileUrl', value => throwIfNotValid(value, isUrlValid, 'fileUrl'))
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS_REDUNDANCY.URL.max))
fileUrl: string
diff --git a/server/core/models/video/video-streaming-playlist.ts b/server/core/models/video/video-streaming-playlist.ts
index 4f4cfbee87..c5d107e23d 100644
--- a/server/core/models/video/video-streaming-playlist.ts
+++ b/server/core/models/video/video-streaming-playlist.ts
@@ -26,7 +26,6 @@ import {
Is, Table,
UpdatedAt
} from 'sequelize-typescript'
-import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
import { isArrayOf } from '../../helpers/custom-validators/misc.js'
import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos.js'
import {
@@ -73,7 +72,6 @@ export class VideoStreamingPlaylistModel extends SequelizeModel<VideoStreamingPl
playlistFilename: string
@AllowNull(true)
- @Is('PlaylistUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'playlist url', true))
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.URL.max))
playlistUrl: string
@@ -91,7 +89,6 @@ export class VideoStreamingPlaylistModel extends SequelizeModel<VideoStreamingPl
segmentsSha256Filename: string
@AllowNull(true)
- @Is('VideoStreamingSegmentsSha256Url', value => throwIfNotValid(value, isActivityPubUrlValid, 'segments sha256 url', true))
@Column
segmentsSha256Url: string