mirror of https://github.com/Chocobozzz/PeerTube
Merge branch 'release/6.1.0' into develop
commit
9b5c7a8dc6
|
@ -1,6 +1,7 @@
|
||||||
import { CommonModule } from '@angular/common'
|
import { CommonModule } from '@angular/common'
|
||||||
import { Component, ElementRef, ViewChild } from '@angular/core'
|
import { Component, ElementRef, ViewChild } from '@angular/core'
|
||||||
import { FormsModule } from '@angular/forms'
|
import { FormsModule } from '@angular/forms'
|
||||||
|
import { RouterLink } from '@angular/router'
|
||||||
import { Notifier, ServerService, User, UserService } from '@app/core'
|
import { Notifier, ServerService, User, UserService } from '@app/core'
|
||||||
import { PeertubeCheckboxComponent } from '@app/shared/shared-forms/peertube-checkbox.component'
|
import { PeertubeCheckboxComponent } from '@app/shared/shared-forms/peertube-checkbox.component'
|
||||||
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
|
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
|
||||||
|
@ -13,7 +14,7 @@ import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage'
|
||||||
templateUrl: './account-setup-warning-modal.component.html',
|
templateUrl: './account-setup-warning-modal.component.html',
|
||||||
styleUrls: [ './account-setup-warning-modal.component.scss' ],
|
styleUrls: [ './account-setup-warning-modal.component.scss' ],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ CommonModule, GlobalIconComponent, PeertubeCheckboxComponent, FormsModule ]
|
imports: [ CommonModule, GlobalIconComponent, PeertubeCheckboxComponent, FormsModule, RouterLink ]
|
||||||
})
|
})
|
||||||
export class AccountSetupWarningModalComponent {
|
export class AccountSetupWarningModalComponent {
|
||||||
@ViewChild('modal', { static: true }) modal: ElementRef
|
@ViewChild('modal', { static: true }) modal: ElementRef
|
||||||
|
|
|
@ -390,7 +390,7 @@ body {
|
||||||
// RTL compatibility
|
// RTL compatibility
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
.modal .modal-header .modal-title {
|
:root[dir=rtl] .modal .modal-header .modal-title {
|
||||||
margin-inline-end: auto;
|
margin-inline-end: auto;
|
||||||
margin-right: unset;
|
margin-right: unset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,14 @@ describe('Test stats (excluding redundancy)', function () {
|
||||||
const { account } = await servers[0].users.create({ username: user.username, password: user.password })
|
const { account } = await servers[0].users.create({ username: user.username, password: user.password })
|
||||||
userAccountId = account.id
|
userAccountId = account.id
|
||||||
|
|
||||||
const { uuid } = await servers[0].videos.upload({ attributes: { fixture: 'video_short.webm' } })
|
{
|
||||||
|
const { uuid } = await servers[0].videos.quickUpload({ name: 'video', fixture: 'video_short.webm' })
|
||||||
|
await servers[0].views.simulateView({ id: uuid })
|
||||||
|
|
||||||
await servers[0].comments.createThread({ videoId: uuid, text: 'comment' })
|
await servers[0].comments.createThread({ videoId: uuid, text: 'comment' })
|
||||||
|
const toDelete = await servers[0].comments.createThread({ videoId: uuid, text: 'deleted' })
|
||||||
await servers[0].views.simulateView({ id: uuid })
|
await servers[0].comments.delete({ videoId: uuid, commentId: toDelete.id })
|
||||||
|
}
|
||||||
|
|
||||||
// Wait the video views repeatable job
|
// Wait the video views repeatable job
|
||||||
await wait(8000)
|
await wait(8000)
|
||||||
|
|
|
@ -10,15 +10,13 @@ import {
|
||||||
Column,
|
Column,
|
||||||
CreatedAt,
|
CreatedAt,
|
||||||
Default,
|
Default,
|
||||||
ForeignKey,
|
ForeignKey, Table,
|
||||||
Is, Table,
|
|
||||||
UpdatedAt
|
UpdatedAt
|
||||||
} from 'sequelize-typescript'
|
} from 'sequelize-typescript'
|
||||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
|
|
||||||
import { logger } from '../../helpers/logger.js'
|
import { logger } from '../../helpers/logger.js'
|
||||||
import { CONFIG } from '../../initializers/config.js'
|
import { CONFIG } from '../../initializers/config.js'
|
||||||
import { LAZY_STATIC_PATHS, MIMETYPES, WEBSERVER } from '../../initializers/constants.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'
|
import { ActorModel } from './actor.js'
|
||||||
|
|
||||||
@Table({
|
@Table({
|
||||||
|
@ -51,7 +49,6 @@ export class ActorImageModel extends SequelizeModel<ActorImageModel> {
|
||||||
width: number
|
width: number
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Is('ActorImageFileUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'fileUrl', true))
|
|
||||||
@Column
|
@Column
|
||||||
fileUrl: string
|
fileUrl: string
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
import {
|
||||||
|
ActivityVideoUrlObject,
|
||||||
|
CacheFileObject,
|
||||||
|
FileRedundancyInformation,
|
||||||
|
StreamingPlaylistRedundancyInformation,
|
||||||
|
VideoPrivacy,
|
||||||
|
VideoRedundanciesTarget,
|
||||||
|
VideoRedundancy,
|
||||||
|
VideoRedundancyStrategy,
|
||||||
|
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 sample from 'lodash-es/sample.js'
|
import sample from 'lodash-es/sample.js'
|
||||||
import { literal, Op, QueryTypes, Transaction, WhereOptions } from 'sequelize'
|
import { literal, Op, QueryTypes, Transaction, WhereOptions } from 'sequelize'
|
||||||
import {
|
import {
|
||||||
|
@ -12,21 +27,7 @@ import {
|
||||||
Table,
|
Table,
|
||||||
UpdatedAt
|
UpdatedAt
|
||||||
} from 'sequelize-typescript'
|
} from 'sequelize-typescript'
|
||||||
import {
|
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
|
||||||
ActivityVideoUrlObject,
|
|
||||||
CacheFileObject,
|
|
||||||
FileRedundancyInformation,
|
|
||||||
StreamingPlaylistRedundancyInformation,
|
|
||||||
VideoPrivacy,
|
|
||||||
VideoRedundanciesTarget,
|
|
||||||
VideoRedundancy,
|
|
||||||
VideoRedundancyStrategy,
|
|
||||||
VideoRedundancyStrategyWithManual
|
|
||||||
} from '@peertube/peertube-models'
|
|
||||||
import { isTestInstance } from '@peertube/peertube-node-utils'
|
|
||||||
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 { logger } from '../../helpers/logger.js'
|
import { logger } from '../../helpers/logger.js'
|
||||||
import { CONFIG } from '../../initializers/config.js'
|
import { CONFIG } from '../../initializers/config.js'
|
||||||
import { CONSTRAINTS_FIELDS } from '../../initializers/constants.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 { VideoFileModel } from '../video/video-file.js'
|
||||||
import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist.js'
|
import { VideoStreamingPlaylistModel } from '../video/video-streaming-playlist.js'
|
||||||
import { VideoModel } from '../video/video.js'
|
import { VideoModel } from '../video/video.js'
|
||||||
import { getVideoFileMimeType } from '@server/lib/video-file.js'
|
|
||||||
|
|
||||||
export enum ScopeNames {
|
export enum ScopeNames {
|
||||||
WITH_VIDEO = 'WITH_VIDEO'
|
WITH_VIDEO = 'WITH_VIDEO'
|
||||||
|
@ -102,7 +102,6 @@ export class VideoRedundancyModel extends SequelizeModel<VideoRedundancyModel> {
|
||||||
expiresOn: Date
|
expiresOn: Date
|
||||||
|
|
||||||
@AllowNull(false)
|
@AllowNull(false)
|
||||||
@Is('VideoRedundancyFileUrl', value => throwIfNotValid(value, isUrlValid, 'fileUrl'))
|
|
||||||
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS_REDUNDANCY.URL.max))
|
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS_REDUNDANCY.URL.max))
|
||||||
fileUrl: string
|
fileUrl: string
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,8 @@ export class UserNotificationModel extends SequelizeModel<UserNotificationModel>
|
||||||
userId,
|
userId,
|
||||||
id: {
|
id: {
|
||||||
[Op.in]: notificationIds
|
[Op.in]: notificationIds
|
||||||
}
|
},
|
||||||
|
read: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +299,7 @@ export class UserNotificationModel extends SequelizeModel<UserNotificationModel>
|
||||||
}
|
}
|
||||||
|
|
||||||
static markAllAsRead (userId: number) {
|
static markAllAsRead (userId: number) {
|
||||||
const query = { where: { userId } }
|
const query = { where: { userId, read: false } }
|
||||||
|
|
||||||
return UserNotificationModel.update({ read: true }, query)
|
return UserNotificationModel.update({ read: true }, query)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
import { pick } from '@peertube/peertube-core-utils'
|
||||||
|
import { ActivityTagObject, ActivityTombstoneObject, VideoComment, VideoCommentAdmin, VideoCommentObject } from '@peertube/peertube-models'
|
||||||
|
import { extractMentions } from '@server/helpers/mentions.js'
|
||||||
|
import { getServerActor } from '@server/models/application/application.js'
|
||||||
|
import { MAccount, MAccountId, MUserAccountId } from '@server/types/models/index.js'
|
||||||
import { Op, Order, QueryTypes, Sequelize, Transaction } from 'sequelize'
|
import { Op, Order, QueryTypes, Sequelize, Transaction } from 'sequelize'
|
||||||
import {
|
import {
|
||||||
AllowNull,
|
AllowNull,
|
||||||
|
@ -11,17 +16,12 @@ import {
|
||||||
Table,
|
Table,
|
||||||
UpdatedAt
|
UpdatedAt
|
||||||
} from 'sequelize-typescript'
|
} from 'sequelize-typescript'
|
||||||
import { pick } from '@peertube/peertube-core-utils'
|
|
||||||
import { ActivityTagObject, ActivityTombstoneObject, VideoComment, VideoCommentAdmin, VideoCommentObject } from '@peertube/peertube-models'
|
|
||||||
import { extractMentions } from '@server/helpers/mentions.js'
|
|
||||||
import { getServerActor } from '@server/models/application/application.js'
|
|
||||||
import { MAccount, MAccountId, MUserAccountId } from '@server/types/models/index.js'
|
|
||||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
|
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
|
||||||
import { CONSTRAINTS_FIELDS, USER_EXPORT_MAX_ITEMS } from '../../initializers/constants.js'
|
import { CONSTRAINTS_FIELDS, USER_EXPORT_MAX_ITEMS } from '../../initializers/constants.js'
|
||||||
import {
|
import {
|
||||||
MComment,
|
MComment,
|
||||||
MCommentAdminFormattable,
|
|
||||||
MCommentAP,
|
MCommentAP,
|
||||||
|
MCommentAdminFormattable,
|
||||||
MCommentExport,
|
MCommentExport,
|
||||||
MCommentFormattable,
|
MCommentFormattable,
|
||||||
MCommentId,
|
MCommentId,
|
||||||
|
@ -480,7 +480,12 @@ export class VideoCommentModel extends SequelizeModel<VideoCommentModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async getStats () {
|
static async getStats () {
|
||||||
|
const where = {
|
||||||
|
deletedAt: null
|
||||||
|
}
|
||||||
|
|
||||||
const totalLocalVideoComments = await VideoCommentModel.count({
|
const totalLocalVideoComments = await VideoCommentModel.count({
|
||||||
|
where,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
model: AccountModel.unscoped(),
|
model: AccountModel.unscoped(),
|
||||||
|
@ -497,7 +502,7 @@ export class VideoCommentModel extends SequelizeModel<VideoCommentModel> {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const totalVideoComments = await VideoCommentModel.count()
|
const totalVideoComments = await VideoCommentModel.count({ where })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
totalLocalVideoComments,
|
totalLocalVideoComments,
|
||||||
|
|
|
@ -26,7 +26,6 @@ import {
|
||||||
Is, Table,
|
Is, Table,
|
||||||
UpdatedAt
|
UpdatedAt
|
||||||
} from 'sequelize-typescript'
|
} from 'sequelize-typescript'
|
||||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc.js'
|
|
||||||
import { isArrayOf } from '../../helpers/custom-validators/misc.js'
|
import { isArrayOf } from '../../helpers/custom-validators/misc.js'
|
||||||
import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos.js'
|
import { isVideoFileInfoHashValid } from '../../helpers/custom-validators/videos.js'
|
||||||
import {
|
import {
|
||||||
|
@ -73,7 +72,6 @@ export class VideoStreamingPlaylistModel extends SequelizeModel<VideoStreamingPl
|
||||||
playlistFilename: string
|
playlistFilename: string
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Is('PlaylistUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'playlist url', true))
|
|
||||||
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.URL.max))
|
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.URL.max))
|
||||||
playlistUrl: string
|
playlistUrl: string
|
||||||
|
|
||||||
|
@ -91,7 +89,6 @@ export class VideoStreamingPlaylistModel extends SequelizeModel<VideoStreamingPl
|
||||||
segmentsSha256Filename: string
|
segmentsSha256Filename: string
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Is('VideoStreamingSegmentsSha256Url', value => throwIfNotValid(value, isActivityPubUrlValid, 'segments sha256 url', true))
|
|
||||||
@Column
|
@Column
|
||||||
segmentsSha256Url: string
|
segmentsSha256Url: string
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue