Skip to content

Commit

Permalink
Remove useless option
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Aug 21, 2024
1 parent a86252b commit 5291ac2
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Subscription } from 'rxjs'
import { NgClass, NgIf } from '@angular/common'
import { HttpErrorResponse } from '@angular/common/http'
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { ActivatedRoute } from '@angular/router'
import { AuthService, HooksService, Notifier, RedirectService } from '@app/core'
import { genericUploadErrorHandler } from '@app/helpers'
Expand All @@ -10,18 +11,16 @@ import {
VIDEO_CHANNEL_SUPPORT_VALIDATOR
} from '@app/shared/form-validators/video-channel-validators'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { VideoChannelUpdate } from '@peertube/peertube-models'
import { VideoChannelEdit } from './video-channel-edit'
import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'
import { shallowCopy } from '@peertube/peertube-core-utils'
import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { VideoChannelUpdate } from '@peertube/peertube-models'
import { Subscription } from 'rxjs'
import { ActorAvatarEditComponent } from '../../shared/shared-actor-image-edit/actor-avatar-edit.component'
import { ActorBannerEditComponent } from '../../shared/shared-actor-image-edit/actor-banner-edit.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgIf, NgClass } from '@angular/common'
import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { PeertubeCheckboxComponent } from '../../shared/shared-forms/peertube-checkbox.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { VideoChannelEdit } from './video-channel-edit'

@Component({
selector: 'my-video-channel-update',
Expand All @@ -42,7 +41,6 @@ import { VideoChannelService } from '@app/shared/shared-main/video-channel/video
})
export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, AfterViewInit, OnDestroy {
error: string
videoChannel: VideoChannel

private paramsSub: Subscription
private oldSupportField: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { VideoConstant, VideoPlaylist, VideoPlaylistPrivacyType } from '@peertube/peertube-models'
import { SelectChannelItem } from '../../../types/select-options-item.model'
import { FormReactive } from '@app/shared/shared-forms/form-reactive'
import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
import { VideoConstant, VideoPlaylistPrivacyType } from '@peertube/peertube-models'
import { SelectChannelItem } from '../../../types/select-options-item.model'

export abstract class MyVideoPlaylistEdit extends FormReactive {
// Declare it here to avoid errors in create template
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forkJoin, Subscription } from 'rxjs'
import { map, switchMap } from 'rxjs/operators'
import { NgClass, NgIf } from '@angular/common'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { ActivatedRoute, Router, RouterLink } from '@angular/router'
import { AuthService, Notifier, ServerService } from '@app/core'
import { listUserChannelsForSelect } from '@app/helpers'
Expand All @@ -12,17 +12,16 @@ import {
VIDEO_PLAYLIST_PRIVACY_VALIDATOR
} from '@app/shared/form-validators/video-playlist-validators'
import { FormReactiveService } from '@app/shared/shared-forms/form-reactive.service'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { VideoPlaylistUpdate } from '@peertube/peertube-models'
import { MyVideoPlaylistEdit } from './my-video-playlist-edit'
import { forkJoin, Subscription } from 'rxjs'
import { map, switchMap } from 'rxjs/operators'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { PreviewUploadComponent } from '../../shared/shared-forms/preview-upload.component'
import { SelectChannelComponent } from '../../shared/shared-forms/select/select-channel.component'
import { SelectOptionsComponent } from '../../shared/shared-forms/select/select-options.component'
import { MarkdownTextareaComponent } from '../../shared/shared-forms/markdown-textarea.component'
import { HelpComponent } from '../../shared/shared-main/misc/help.component'
import { PreviewUploadComponent } from '../../shared/shared-forms/preview-upload.component'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { NgIf, NgClass } from '@angular/common'
import { VideoPlaylist } from '@app/shared/shared-video-playlist/video-playlist.model'
import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-playlist.service'
import { MyVideoPlaylistEdit } from './my-video-playlist-edit'

@Component({
templateUrl: './my-video-playlist-edit.component.html',
Expand All @@ -43,7 +42,6 @@ import { VideoPlaylistService } from '@app/shared/shared-video-playlist/video-pl
})
export class MyVideoPlaylistUpdateComponent extends MyVideoPlaylistEdit implements OnInit, OnDestroy {
error: string
videoPlaylistToUpdate: VideoPlaylist

private paramsSub: Subscription

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { getAbsoluteAPIUrl } from '@app/helpers'
import { Account as ServerAccount, ActorImage, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@peertube/peertube-models'
import { Actor } from '../account/actor.model'
import { maxBy } from '@peertube/peertube-core-utils'
import { ActorImage, Account as ServerAccount, VideoChannel as ServerVideoChannel, ViewsPerDate } from '@peertube/peertube-models'
import { Actor } from '../account/actor.model'

export class VideoChannel extends Actor implements ServerVideoChannel {
displayName: string
description: string
support: string

isLocal: boolean

nameWithHost: string
nameWithHostForced: string

Expand Down
15 changes: 8 additions & 7 deletions client/src/app/shared/shared-main/video/video-details.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ import {
import { Video } from './video.model'

export class VideoDetails extends Video implements VideoDetailsServerModel {
declare channel: VideoChannel
declare account: Account

descriptionPath: string
support: string
channel: VideoChannel
tags: string[]
account: Account
downloadEnabled: boolean

waitTranscoding: boolean
state: VideoConstant<VideoStateType>

commentsEnabled: never
commentsPolicy: VideoConstant<VideoCommentPolicyType>

Expand All @@ -32,8 +30,11 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {

inputFileUpdatedAt: Date | string

files: VideoFile[]
streamingPlaylists: VideoStreamingPlaylist[]
// These fields are not optional
declare files: VideoFile[]
declare streamingPlaylists: VideoStreamingPlaylist[]
declare waitTranscoding: boolean
declare state: VideoConstant<VideoStateType>

constructor (hash: VideoDetailsServerModel, translations = {}) {
super(hash, translations)
Expand Down
3 changes: 1 addition & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"crypto": [
"src/shims/noop.ts"
]
},
"useDefineForClassFields": false
}
},
"references": [
{ "path": "../packages/core-utils" },
Expand Down

0 comments on commit 5291ac2

Please sign in to comment.