ActivityPub-federated video streaming platform using P2P directly in your web browser
Add state info in manage page
Chocobozzz082c9e5b5001
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.tsindex e185c83721..553c8139a8 100644--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts@@ -61,7 +61,6 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {avatar: false,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.tsindex 087411e9aa..8369299cee 100644--- a/client/src/app/+my-library/my-history/my-history.component.ts+++ b/client/src/app/+my-library/my-history/my-history.component.ts@@ -59,7 +59,6 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook {by: true,privacyLabel: false,privacyText: true,- state: true,blacklistInfo: true}diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.tsindex ffaca09b50..911651ffec 100644--- a/client/src/app/+search/search.component.ts+++ b/client/src/app/+search/search.component.ts@@ -76,7 +76,6 @@ export class SearchComponent implements OnInit, OnDestroy {avatar: true,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.tsindex 7f6c20f6d3..8e66bf6a03 100644--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts@@ -35,7 +35,6 @@ export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDesavatar: false,privacyLabel: true,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/+video-watch/routes.ts b/client/src/app/+video-watch/routes.tsindex daa245f93c..8fd2339274 100644--- a/client/src/app/+video-watch/routes.ts+++ b/client/src/app/+video-watch/routes.ts@@ -12,6 +12,7 @@ import { OverviewService } from '../+video-list'import { VideoRecommendationService } from './shared'import { VideoWatchComponent } from './video-watch.component'import { BulkService } from '@app/shared/shared-moderation/bulk.service'+import { VideoStateMessageService } from '@app/shared/shared-video/video-state-message.service'export default [{@@ -28,7 +29,8 @@ export default [SearchService,AbuseService,UserAdminService,- BulkService+ BulkService,+ VideoStateMessageService],children: [{diff --git a/client/src/app/+video-watch/shared/information/video-alert.component.html b/client/src/app/+video-watch/shared/information/video-alert.component.htmlindex 67010a411e..aee8e490bc 100644--- a/client/src/app/+video-watch/shared/information/video-alert.component.html+++ b/client/src/app/+video-watch/shared/information/video-alert.component.html@@ -10,8 +10,14 @@This live has ended.</my-alert>-<my-alert rounded="false" type="warning" *ngIf="getAlertWarning()">- {{ getAlertWarning() }}+<my-alert rounded="false" type="warning" *ngIf="getAlertWarning()?.title">+ <div class="alert-title">{{ getAlertWarning()?.title }}</div>++ @if (canSeeMoreInfo()) {+ {{ getAlertWarning().watchSecondary }}+ }++ {{ getAlertWarning().watchMain }}</my-alert><my-alert rounded="false" i18n type="warning" *ngIf="noPlaylistVideoFound()">@@ -20,9 +26,10 @@<my-alert rounded="false" type="danger" *ngIf="video()?.blacklisted"><div class="blocked-label" i18n>This video is blocked.</div>+{{ video().blacklistedReason }}</my-alert>-<my-alert rounded="false" i18n type="warning" *ngIf="video()?.canAccessPasswordProtectedVideoWithoutPassword(user())">+<my-alert rounded="false" i18n type="warning" *ngIf="video()?.canBypassPassword(user())">This video is password protected.</my-alert>diff --git a/client/src/app/+video-watch/shared/information/video-alert.component.ts b/client/src/app/+video-watch/shared/information/video-alert.component.tsindex 3af35313df..7d07e8e89a 100644--- a/client/src/app/+video-watch/shared/information/video-alert.component.ts+++ b/client/src/app/+video-watch/shared/information/video-alert.component.ts@@ -1,10 +1,11 @@import { NgIf } from '@angular/common'-import { Component, input } from '@angular/core'+import { Component, inject, input } from '@angular/core'import { AuthUser } from '@app/core'import { AlertComponent } from '@app/shared/shared-main/common/alert.component'import { PTDatePipe } from '@app/shared/shared-main/common/date.pipe'import { VideoDetails } from '@app/shared/shared-main/video/video-details.model'-import { VideoPrivacy, VideoState } from '@peertube/peertube-models'+import { VideoStateMessageService } from '@app/shared/shared-video/video-state-message.service'+import { UserRight, VideoPrivacy, VideoState } from '@peertube/peertube-models'@Component({selector: 'my-video-alert',@@ -17,35 +18,17 @@ export class VideoAlertComponent {readonly video = input<VideoDetails>(undefined)readonly noPlaylistVideoFound = input<boolean>(undefined)- getAlertWarning () {- const video = this.video()- if (!video) return-- switch (video.state.id) {- case VideoState.TO_TRANSCODE:- return $localize`The video is being transcoded, it may not work properly.`-- case VideoState.TO_IMPORT:- return $localize`The video is being imported, it will be available when the import is finished.`-- case VideoState.TO_MOVE_TO_FILE_SYSTEM:- return $localize`The video is being moved to server file system, it may not work properly`+ private readonly videoStateMessage = inject(VideoStateMessageService)- case VideoState.TO_MOVE_TO_FILE_SYSTEM_FAILED:- return $localize`Move to file system failed, this video may not work properly.`-- case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE:- return $localize`The video is being moved to an external server, it may not work properly.`-- case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED:- return $localize`Move to external storage failed, this video may not work properly.`+ canSeeMoreInfo () {+ return !!(this.user()?.hasRight(UserRight.UPDATE_ANY_VIDEO))+ }- case VideoState.TO_EDIT:- return $localize`The video is being edited, it may not work properly.`+ getAlertWarning () {+ const video = this.video()+ if (!video) return undefined- case VideoState.TRANSCODING_FAILED:- return $localize`Transcoding failed, this video may not work properly.`- }+ return this.videoStateMessage.buildWarn(video.state.id)}hasVideoScheduledPublication () {diff --git a/client/src/app/+video-watch/video-watch.component.ts b/client/src/app/+video-watch/video-watch.component.tsindex 3cdf983066..60e23490be 100644--- a/client/src/app/+video-watch/video-watch.component.ts+++ b/client/src/app/+video-watch/video-watch.component.ts@@ -846,7 +846,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {videoFileToken: () => videoFileToken,requiresUserAuth: videoRequiresUserAuth(video, videoPassword),requiresPassword: video.privacy.id === VideoPrivacy.PASSWORD_PROTECTED &&- !video.canAccessPasswordProtectedVideoWithoutPassword(this.user),+ !video.canBypassPassword(this.user),videoPassword: () => videoPassword,videoCaptions: playerCaptions,diff --git a/client/src/app/+videos-publish-manage/+video-manage/routes.ts b/client/src/app/+videos-publish-manage/+video-manage/routes.tsindex 12354bdde5..f86b51ec9a 100644--- a/client/src/app/+videos-publish-manage/+video-manage/routes.ts+++ b/client/src/app/+videos-publish-manage/+video-manage/routes.ts@@ -1,6 +1,7 @@import { Routes } from '@angular/router'import { CanDeactivateGuard, LoginGuard } from '@app/core'import { LiveVideoService } from '@app/shared/shared-video-live/live-video.service'+import { VideoStateMessageService } from '@app/shared/shared-video/video-state-message.service'import { I18nPrimengCalendarService } from '../shared-manage/common/i18n-primeng-calendar.service'import { VideoUploadService } from '../shared-manage/common/video-upload.service'import { manageRoutes } from '../shared-manage/routes'@@ -19,7 +20,8 @@ export default [LiveVideoService,I18nPrimengCalendarService,VideoUploadService,- VideoStudioService+ VideoStudioService,+ VideoStateMessageService],resolve: {resolverData: VideoManageResolverdiff --git a/client/src/app/+videos-publish-manage/+video-publish/routes.ts b/client/src/app/+videos-publish-manage/+video-publish/routes.tsindex 054ca02453..748def0324 100644--- a/client/src/app/+videos-publish-manage/+video-publish/routes.ts+++ b/client/src/app/+videos-publish-manage/+video-publish/routes.ts@@ -10,6 +10,7 @@ import { VideoPublishComponent } from './video-publish.component'import { VideoPublishResolver } from './video-publish.resolver'import { inject } from '@angular/core'import debug from 'debug'+import { VideoStateMessageService } from '@app/shared/shared-video/video-state-message.service'const debugLogger = debug('peertube:video-publish')@@ -42,6 +43,7 @@ export default [providers: [VideoPublishResolver,VideoManageController,+ VideoStateMessageService,LiveVideoService,I18nPrimengCalendarService,VideoUploadService,diff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.htmlindex fb4ba63482..d116a1abe3 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.html@@ -117,41 +117,50 @@<div class="w-100 min-width-0">- <div class="video-header">- <div class="video-actions">- <my-button class="cancel-button" icon="arrow-left" theme="secondary" i18n [ptRouterLink]="cancelLink()">Cancel</my-button>-- <h2>{{ getVideo().name }}</h2>-- <div class="watch-save">- <my-button *ngIf="canWatch()" class="watch-button" icon="external-link" theme="secondary" class="me-3" [href]="getWatchUrl()">- <span i18n class="watch-button-label">Watch the video</span>- </my-button>-- <my-button- theme="primary" class="save-button"- icon="circle-tick"- [disabled]="!canUpdate() || !hasPendingChanges()" (click)="onWantToUpdate()"- >- @if (hasStudioTasks()) {- <ng-container i18n>Save and run studio tasks</ng-container>- } @else if (hasReplaceFile()) {- <ng-container i18n>Save and replace file</ng-container>- } @else {- <ng-container i18n>Save</ng-container>- }- </my-button>+ <div class="mb-3">+ <div class="video-header mb-2">+ <div class="video-actions video-header-block mb-2">+ <my-button class="cancel-button" icon="arrow-left" theme="secondary" i18n [ptRouterLink]="cancelLink()">Cancel</my-button>++ <h2>{{ getVideo().name }}</h2>++ <div class="watch-save">+ <my-button *ngIf="canWatch()" class="watch-button" icon="external-link" theme="secondary" class="me-3" [href]="getWatchUrl()">+ <span i18n class="watch-button-label">Watch the video</span>+ </my-button>++ <my-button+ theme="primary" class="save-button"+ icon="circle-tick"+ [disabled]="!canUpdate() || !hasPendingChanges()" (click)="onWantToUpdate()"+ >+ @if (hasStudioTasks()) {+ <ng-container i18n>Save and run studio tasks</ng-container>+ } @else if (hasReplaceFile()) {+ <ng-container i18n>Save and replace file</ng-container>+ } @else {+ <ng-container i18n>Save</ng-container>+ }+ </my-button>+ </div></div>- </div>- <my-manage-errors *ngIf="displayFormErrorsMsg && hasFormErrors()"></my-manage-errors>+ <div *ngIf="getStateWarning()?.title" class="video-state video-header-block mb-2">+ <div class="alert-title">{{ getStateWarning().title }}</div>++ <strong class="me-1">{{ getStateWarning().manageMain }}</strong>+ <span>{{ getStateWarning().manageSecondary }}</span>+ </div>++ <my-manage-errors *ngIf="displayFormErrorsMsg && hasFormErrors()" class="d-block mb-2"></my-manage-errors>- <my-upload-progress- [isUploading]="isUploadingFile()"- [uploadPercents]="getUploadPercents()" [error]="getUploadError()" [uploaded]="hasUploadedFile()"- [enableRetryAfterError]="canRetryUpload" (retry)="retryUpload()"- >- </my-upload-progress>+ <my-upload-progress+ [isUploading]="isUploadingFile()"+ [uploadPercents]="getUploadPercents()" [error]="getUploadError()" [uploaded]="hasUploadedFile()"+ [enableRetryAfterError]="canRetryUpload" (retry)="retryUpload()"+ >+ </my-upload-progress>+ </div><ng-content></ng-content></div>diff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scssindex 2661fec51e..fc2f45718c 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.scss@@ -171,19 +171,20 @@ h1 {}}+.video-header-block {+ border-radius: 14px;+ background-color: pvar(--bg-secondary-350);+}+.video-header {- margin-bottom: 1rem;display: flex;flex-direction: column;- row-gap: 1rem;.video-actions {- padding: 1.5rem;- border-radius: 14px;- background-color: pvar(--bg-secondary-350);display: flex;justify-content: space-between;gap: 1rem;+ padding: 1.5rem;h2 {font-size: 1.5rem;@@ -221,3 +222,10 @@ h1 {}}}++.video-state {+ color: pvar(--fg-300);+ padding: 1rem 1.5rem;++ @include font-size(14px);+}diff --git a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.tsindex 5703fef0f4..811107dee1 100644--- a/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts+++ b/client/src/app/+videos-publish-manage/shared-manage/video-manage-container.component.ts@@ -13,6 +13,7 @@ import { UploadProgressComponent } from '../../shared/standalone-upload/upload-pimport { ManageErrorsComponent } from './common/manage-errors.component'import { VideoEdit } from './common/video-edit.model'import { VideoManageController } from './video-manage-controller.service'+import { VideoStateMessageService } from '@app/shared/shared-video/video-state-message.service'@Component({selector: 'my-video-manage-container',@@ -35,6 +36,7 @@ export class VideoManageContainerComponent implements OnInit, OnDestroy {private notifier = inject(Notifier)private headerService = inject(HeaderService)private screenService = inject(ScreenService)+ private videoStateMessage = inject(VideoStateMessageService)readonly canWatch = input.required<boolean, string | boolean>({ transform: booleanAttribute })readonly canUpdate = input.required<boolean, string | boolean>({ transform: booleanAttribute })@@ -63,12 +65,20 @@ export class VideoManageContainerComponent implements OnInit, OnDestroy {this.headerService.setSearchHidden(false)}+ // ---------------------------------------------------------------------------+hasFormErrors () {return this.manageController.hasFormErrors()}// ---------------------------------------------------------------------------+ getStateWarning () {+ return this.videoStateMessage.buildWarn(this.videoEdit.getVideoAttributes().state)+ }++ // ---------------------------------------------------------------------------+hasPendingChanges () {return this.manageController.hasPendingChanges()}diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.tsindex e019d020e4..c4c56e8363 100644--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/playlist-miniature-markup.component.ts@@ -37,7 +37,6 @@ export class PlaylistMiniatureMarkupComponent implements CustomMarkupComponent,avatar: true,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.tsindex e7c82581ed..67ef8a2138 100644--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts@@ -38,7 +38,6 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnIavatar: true,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.tsindex 8f2b36bd3b..f94e2af4c8 100644--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts@@ -50,7 +50,6 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInitavatar: true,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false}diff --git a/client/src/app/shared/shared-main/common/alert.component.scss b/client/src/app/shared/shared-main/common/alert.component.scssdeleted file mode 100644index e69de29bb2..0000000000diff --git a/client/src/app/shared/shared-main/common/alert.component.ts b/client/src/app/shared/shared-main/common/alert.component.tsindex 4d759775bd..01be97ab0e 100644--- a/client/src/app/shared/shared-main/common/alert.component.ts+++ b/client/src/app/shared/shared-main/common/alert.component.ts@@ -1,11 +1,10 @@import { NgClass } from '@angular/common'-import { booleanAttribute, Component, OnChanges, OnInit, input } from '@angular/core'+import { booleanAttribute, Component, input, OnChanges, OnInit } from '@angular/core'export type AlertType = 'success' | 'info' | 'warning' | 'danger' | 'primary'@Component({selector: 'my-alert',- styleUrls: [ './alert.component.scss' ],templateUrl: './alert.component.html',imports: [ NgClass ]})diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.tsindex 2d095642d2..c0e7598078 100644--- a/client/src/app/shared/shared-main/video/video.model.ts+++ b/client/src/app/shared/shared-main/video/video.model.ts@@ -326,7 +326,7 @@ export class Video implements VideoServerModel {return user && this.isLocal === false && user.hasRight(UserRight.MANAGE_VIDEOS_REDUNDANCIES)}- canAccessPasswordProtectedVideoWithoutPassword (user: AuthUser) {+ canBypassPassword (user: AuthUser) {return this.privacy.id === VideoPrivacy.PASSWORD_PROTECTED &&user &&this.isLocal === true &&diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.htmlindex 6bfbebd7af..b0bb0d7d5e 100644--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html@@ -75,8 +75,6 @@<div class="video-info-privacy fw-semibold"><ng-container *ngIf="displayOptions().privacyText">{{ video().privacy.label }}</ng-container>- <ng-container *ngIf="displayOptions().privacyText && displayOptions().state && getStateLabel(video())"> - </ng-container>- <ng-container *ngIf="displayOptions().state">{{ getStateLabel(video()) }}</ng-container></div><div *ngIf="containedInPlaylists()" class="badges">diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.tsindex d628402949..5d37fd5aea 100644--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts@@ -13,7 +13,7 @@ import {} from '@angular/core'import { RouterLink } from '@angular/router'import { AuthService, ScreenService, ServerService, User } from '@app/core'-import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy, VideoState } from '@peertube/peertube-models'+import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy } from '@peertube/peertube-models'import { switchMap } from 'rxjs/operators'import { LinkType } from '../../../types/link.type'import { ActorAvatarComponent } from '../shared-actor-image/actor-avatar.component'@@ -33,7 +33,6 @@ export type MiniatureDisplayOptions = {avatar?: booleanprivacyLabel?: booleanprivacyText?: boolean- state?: booleanblacklistInfo?: booleannsfw?: boolean@@ -80,7 +79,6 @@ export class VideoMiniatureComponent implements OnInit {avatar: true,privacyLabel: false,privacyText: false,- state: false,blacklistInfo: false,forceChannelInBy: false})@@ -226,49 +224,6 @@ export class VideoMiniatureComponent implements OnInit {return this.video().privacy.id === VideoPrivacy.PASSWORD_PROTECTED}- getStateLabel (video: Video) {- if (!video.state) return ''-- if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {- return $localize`Published`- }-- if (video.scheduledUpdate) {- const updateAt = new Date(video.scheduledUpdate.updateAt.toString()).toLocaleString(this.localeId)- return $localize`Publication scheduled on ${updateAt}`- }-- switch (video.state.id) {- case VideoState.TRANSCODING_FAILED:- return $localize`Transcoding failed`-- case VideoState.TO_MOVE_TO_FILE_SYSTEM:- return $localize`Moving to file system`-- case VideoState.TO_MOVE_TO_FILE_SYSTEM_FAILED:- return $localize`Moving to file system failed`-- case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE:- return $localize`Moving to external storage`-- case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED:- return $localize`Move to external storage failed`-- case VideoState.TO_TRANSCODE:- return video.waitTranscoding === true- ? $localize`Waiting transcoding`- : $localize`To transcode`-- case VideoState.TO_IMPORT:- return $localize`To import`-- case VideoState.TO_EDIT:- return $localize`To edit`- }-- return ''- }-getAriaLabel () {return $localize`Watch video ${this.video().name}`}diff --git a/client/src/app/shared/shared-video-miniature/videos-list.component.ts b/client/src/app/shared/shared-video-miniature/videos-list.component.tsindex 25b18ff8fe..143eb3979b 100644--- a/client/src/app/shared/shared-video-miniature/videos-list.component.ts+++ b/client/src/app/shared/shared-video-miniature/videos-list.component.ts@@ -71,7 +71,9 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {private peertubeRouter = inject(PeerTubeRouterService)// eslint-disable-next-line max-len- readonly getVideosObservableFunction = input<(pagination: ComponentPaginationLight, filters: VideoFilters) => Observable<ResultList<Video>>>(undefined)+ readonly getVideosObservableFunction = input<+ (pagination: ComponentPaginationLight, filters: VideoFilters) => Observable<ResultList<Video>>+ >(undefined)readonly getSyndicationItemsFunction = input<(filters: VideoFilters) => Promise<Syndication[]> | Syndication[]>(undefined)readonly defaultSort = input<VideoSortField>(undefined)@@ -118,7 +120,6 @@ export class VideosListComponent implements OnInit, OnChanges, OnDestroy {avatar: true,privacyLabel: true,privacyText: false,- state: false,blacklistInfo: false}private routeSub: Subscriptiondiff --git a/client/src/app/shared/shared-video/video-state-message.service.ts b/client/src/app/shared/shared-video/video-state-message.service.tsnew file mode 100644index 0000000000..d724b12faf--- /dev/null+++ b/client/src/app/shared/shared-video/video-state-message.service.ts@@ -0,0 +1,102 @@+import { Injectable } from '@angular/core'+import { VideoState, VideoStateType } from '@peertube/peertube-models'++@Injectable()+export class VideoStateMessageService {+ buildWarn (+ state: VideoStateType+ ): { title: string, manageMain: string, manageSecondary: string, watchMain: string, watchSecondary: string } {+ const manageProcessed = $localize`Your video file is being processed.`+ const manageFeaturesDisabled = $localize`This can take a while and some features may not be available until it is complete.`+ const manageContactAdmin = $localize`Contact your administrator to fix it.`+ const watchNotPlayable = $localize`Your web browser may not be able to play it.`++ switch (state) {+ case VideoState.PUBLISHED:+ case VideoState.LIVE_ENDED:+ case VideoState.WAITING_FOR_LIVE:+ return undefined++ case VideoState.TO_TRANSCODE:+ return {+ title: $localize`Transcoding in progress`,+ manageMain: manageProcessed,+ manageSecondary: manageFeaturesDisabled,+ watchMain: watchNotPlayable,+ watchSecondary: ''+ }++ case VideoState.TO_IMPORT:+ return {+ title: $localize`Import in progress`,+ manageMain: $localize`Your remote video is being imported.`,+ manageSecondary: manageFeaturesDisabled,+ watchMain: $localize`The remote video is being imported, it will be available when the import is complete.`,+ watchSecondary: ''+ }++ case VideoState.TO_MOVE_TO_FILE_SYSTEM:+ return {+ title: $localize`Moving video files`,+ manageMain: manageProcessed,+ manageSecondary: manageFeaturesDisabled,+ watchMain: watchNotPlayable,+ watchSecondary: $localize`The video is being moved to the file system.`+ }++ case VideoState.TO_MOVE_TO_FILE_SYSTEM_FAILED: {+ const details = $localize`Failed to move video files to the platform file system.`++ return {+ title: $localize`Failed to move video files`,+ manageMain: details,+ manageSecondary: manageContactAdmin,+ watchMain: watchNotPlayable,+ watchSecondary: details+ }+ }++ case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE:+ return {+ title: $localize`Moving video files`,+ manageMain: manageProcessed,+ manageSecondary: manageFeaturesDisabled,+ watchMain: watchNotPlayable,+ watchSecondary: $localize`The video is being moved to an external storage.`+ }++ case VideoState.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED: {+ const details = $localize`Failed to move video files to an external storage.`++ return {+ title: $localize`Failed to move video files`,+ manageMain: details,+ manageSecondary: manageContactAdmin,+ watchMain: watchNotPlayable,+ watchSecondary: details+ }+ }++ case VideoState.TO_EDIT:+ return {+ title: $localize`Studio edition in progress`,+ manageMain: manageProcessed,+ manageSecondary: manageFeaturesDisabled,+ watchMain: watchNotPlayable,+ watchSecondary: ''+ }++ case VideoState.TRANSCODING_FAILED:+ return {+ title: $localize`Transcoding failed`,+ manageMain: $localize`Failure during transcoding of your video files`,+ manageSecondary: manageContactAdmin,+ watchMain: watchNotPlayable,+ watchSecondary: ''+ }++ default:+ return state satisfies never+ }+ }+}diff --git a/client/src/sass/class-helpers/_common.scss b/client/src/sass/class-helpers/_common.scssindex f5a91a5b0b..099e1e2f8c 100644--- a/client/src/sass/class-helpers/_common.scss+++ b/client/src/sass/class-helpers/_common.scss@@ -87,6 +87,7 @@// ---------------------------------------------------------------------------.alert {+&.pt-alert-primary {color: pvar(--alert-primary-fg);background-color: pvar(--alert-primary-bg);@@ -111,6 +112,13 @@}}+.alert-title {+ color: pvar(--fg-300);+ font-weight: $font-bold;++ @include font-size(18px);+}+// ---------------------------------------------------------------------------.chip {