Upgrade to angular 10

This commit is contained in:
Chocobozzz 2020-06-26 08:37:26 +02:00 committed by Chocobozzz
parent 4504f09f6e
commit 583eb04b54
37 changed files with 2006 additions and 1891 deletions

View file

@ -429,7 +429,7 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"

View file

@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",

View file

@ -14,7 +14,7 @@
},
"scripts": {
"lint": "npm run lint-ts && npm run lint-scss",
"lint-ts": "tslint --project ./tsconfig.json -c ./tslint.json 'src/app/**/*.ts' 'src/standalone/**/*.ts'",
"lint-ts": "tslint --project ./tsconfig.app.json -c ./tslint.json 'src/app/**/*.ts' 'src/standalone/**/*.ts'",
"lint-scss": "sass-lint -c .sass-lint.yml",
"webpack": "webpack",
"tslint": "tslint",
@ -27,29 +27,28 @@
},
"typings": "*.d.ts",
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.7",
"@angular/animations": "~9.1.9",
"@angular/cdk": "^9.0.0",
"@angular/cli": "~9.1.7",
"@angular/common": "~9.1.9",
"@angular/compiler": "~9.1.9",
"@angular/compiler-cli": "~9.1.9",
"@angular/core": "~9.1.9",
"@angular/forms": "~9.1.9",
"@angular/language-service": "~9.1.9",
"@angular/localize": "^9.1.9",
"@angular/platform-browser": "~9.1.9",
"@angular/platform-browser-dynamic": "~9.1.9",
"@angular/router": "~9.1.9",
"@angular/service-worker": "~9.1.9",
"@angular-devkit/build-angular": "^0.1001.0-next.4",
"@angular/animations": "^10.1.0-next.4",
"@angular/cdk": "^10.0.0",
"@angular/cli": "^10.1.0-next.4",
"@angular/common": "^10.1.0-next.4",
"@angular/compiler": "^10.1.0-next.4",
"@angular/compiler-cli": "^10.1.0-next.4",
"@angular/core": "^10.1.0-next.4",
"@angular/forms": "^10.1.0-next.4",
"@angular/localize": "^10.1.0-next.4",
"@angular/platform-browser": "^10.1.0-next.4",
"@angular/platform-browser-dynamic": "^10.1.0-next.4",
"@angular/router": "^10.1.0-next.4",
"@angular/service-worker": "^10.1.0-next.4",
"@angularclass/hmr": "^2.1.3",
"@neos21/bootstrap3-glyphicons": "^1.0.1",
"@ng-bootstrap/ng-bootstrap": "^6.0.2",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@ngx-i18nsupport/ngx-i18nsupport": "^1.1.6",
"@ngx-i18nsupport/tooling": "^8.0.3",
"@ngx-loading-bar/core": "^4.2.0",
"@ngx-loading-bar/http-client": "^4.2.0",
"@ngx-loading-bar/router": "^4.2.0",
"@ngx-loading-bar/core": "^5.0.0",
"@ngx-loading-bar/http-client": "^5.0.0",
"@ngx-loading-bar/router": "^5.0.0",
"@ngx-meta/core": "^9.0.0",
"@ngx-translate/i18n-polyfill": "^1.0.0",
"@types/chart.js": "^2.9.16",
@ -62,14 +61,13 @@
"@types/linkifyjs": "^2.1.2",
"@types/lodash-es": "^4.17.0",
"@types/markdown-it": "^10.0.1",
"@types/node": "^12.11.1",
"@types/node": "^14.0.14",
"@types/sanitize-html": "1.23.2",
"@types/socket.io-client": "^1.4.32",
"@types/video.js": "^7.3.8",
"@types/webtorrent": "^0.107.0",
"angular2-hotkeys": "^2.1.2",
"angularx-qrcode": "2.3.4",
"awesome-typescript-loader": "5.2.1",
"angularx-qrcode": "10.0.6",
"bootstrap": "^4.1.3",
"buffer": "^5.1.0",
"cache-chunk-store": "^3.0.0",
@ -86,14 +84,14 @@
"html-loader": "^1.0.0",
"html-webpack-plugin": "^4.0.3",
"https-browserify": "^1.0.0",
"jasmine-core": "^3.1.0",
"jasmine-spec-reporter": "^5.0.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"jschannel": "^1.0.2",
"karma": "^5.0.4",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage-istanbul-reporter": "^3.0.2",
"karma-jasmine": "^3.1.1",
"karma-jasmine-html-reporter": "^1.3.1",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"linkifyjs": "^2.1.5",
"lodash-es": "^4.17.4",
"markdown-it": "^11.0.0",
@ -105,7 +103,7 @@
"path-browserify": "^1.0.0",
"primeng": "^9.0.0-rc.4",
"process": "^0.11.10",
"protractor": "^7.0.0",
"protractor": "~7.0.0",
"purify-css": "^1.2.5",
"purifycss-webpack": "^0.7.0",
"raw-loader": "^4.0.0",
@ -118,11 +116,12 @@
"stream-browserify": "^3.0.0",
"stream-http": "^3.0.0",
"terser-webpack-plugin": "^3.0.0",
"ts-loader": "^8.0.2",
"tslib": "^2.0.0",
"tslint": "^6.1.0",
"tslint": "~6.1.0",
"tslint-angular": "^3.0.2",
"tslint-config-standard": "^9.0.0",
"typescript": "~3.8.3",
"typescript": "~3.9.5",
"video.js": "^7",
"videojs-contextmenu-ui": "^5.0.0",
"videojs-contrib-quality-levels": "^2.0.9",

View file

@ -1,11 +1,10 @@
import { Routes } from '@angular/router'
import { UserRightGuard } from '../../core'
import { UserRight } from '../../../../../shared'
import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-installed/plugin-list-installed.component'
import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component'
import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component'
import { PluginsComponent } from '@app/+admin/plugins/plugins.component'
import { UserRightGuard } from '@app/core'
import { UserRight } from '@shared/models'
export const PluginsRoutes: Routes = [
{

View file

@ -1,9 +1,10 @@
import { OnInit } from '@angular/core'
import { OnInit, Directive } from '@angular/core'
import { ConfigService } from '@app/+admin/config/shared/config.service'
import { AuthService, ScreenService, ServerService, User } from '@app/core'
import { FormReactive } from '@app/shared/shared-forms'
import { ServerConfig, USER_ROLE_LABELS, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
@Directive()
export abstract class UserEdit extends FormReactive implements OnInit {
videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = []
videoQuotaDailyOptions: { value: string, label: string, disabled?: boolean }[] = []

View file

@ -1,5 +1,5 @@
import { catchError, switchMap, tap } from 'rxjs/operators'
import { EventEmitter, OnInit } from '@angular/core'
import { EventEmitter, OnInit, Directive } from '@angular/core'
import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core'
import { populateAsyncUserVideoChannels } from '@app/helpers'
import { FormReactive } from '@app/shared/shared-forms'
@ -7,6 +7,7 @@ import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '
import { LoadingBarService } from '@ngx-loading-bar/core'
import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
@Directive()
export abstract class VideoSend extends FormReactive implements OnInit {
userVideoChannels: { id: number, label: string, support: string }[] = []
videoPrivacies: VideoConstant<VideoPrivacy>[] = []

View file

@ -3,6 +3,8 @@
@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
$assets-path: '../assets';
.peertube-container {
padding-bottom: 20px;
}
@ -39,7 +41,7 @@
&.icon-menu {
background-color: pvar(--mainForegroundColor);
mask-image: url('../assets/images/misc/menu.svg');
mask-image: url('#{$assets-path}/images/misc/menu.svg');
margin: 0 18px 0 20px;
}
}
@ -62,7 +64,6 @@
.icon.icon-logo {
display: inline-block;
background-repeat: no-repeat;
width: 23px;
height: 24px;
margin-right: .5rem;

View file

@ -4,7 +4,7 @@ import { catchError, map } from 'rxjs/operators'
import { HttpClient, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { RestExtractor, RestPagination, RestService } from '@app/core'
import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index'
import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/models'
import { environment } from '../../../environments/environment'
@Injectable()

View file

@ -1,4 +1,3 @@
import { FfprobeData } from 'fluent-ffmpeg'
import { Observable } from 'rxjs'
import { catchError, map, switchMap } from 'rxjs/operators'
import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'
@ -19,7 +18,8 @@ import {
VideoFilter,
VideoPrivacy,
VideoSortField,
VideoUpdate
VideoUpdate,
VideoFileMetadata
} from '@shared/models'
import { environment } from '../../../../environments/environment'
import { Account, AccountService } from '../account'
@ -275,7 +275,7 @@ export class VideoService implements VideosProvider {
getVideoFileMetadata (metadataUrl: string) {
return this.authHttp
.get<FfprobeData>(metadataUrl)
.get<VideoFileMetadata>(metadataUrl)
.pipe(
catchError(err => this.restExtractor.handleError(err))
)

View file

@ -1,11 +1,12 @@
import { SortMeta } from 'primeng/api'
import { OnInit } from '@angular/core'
import { OnInit, Directive } from '@angular/core'
import { Notifier, RestPagination, RestTable } from '@app/core'
import { Actor } from '@app/shared/shared-main'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { AccountBlock } from './account-block.model'
import { BlocklistComponentType, BlocklistService } from './blocklist.service'
@Directive()
export class GenericAccountBlocklistComponent extends RestTable implements OnInit {
// @ts-ignore: "Abstract methods can only appear within an abstract class"
abstract mode: BlocklistComponentType

View file

@ -1,11 +1,12 @@
import { SortMeta } from 'primeng/api'
import { OnInit, ViewChild } from '@angular/core'
import { OnInit, ViewChild, Directive } from '@angular/core'
import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component'
import { Notifier, RestPagination, RestTable } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ServerBlock } from '@shared/models'
import { BlocklistComponentType, BlocklistService } from './blocklist.service'
@Directive()
export class GenericServerBlocklistComponent extends RestTable implements OnInit {
@ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent

View file

@ -1,6 +1,6 @@
import { fromEvent, Observable, Subject, Subscription } from 'rxjs'
import { debounceTime, switchMap, tap } from 'rxjs/operators'
import { OnDestroy, OnInit } from '@angular/core'
import { OnDestroy, OnInit, Directive } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import {
AuthService,
@ -30,6 +30,7 @@ enum GroupDate {
OLDER = 5
}
@Directive()
export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableForReuseHook {
pagination: ComponentPaginationLight = {
currentPage: 1,

View file

@ -1,4 +1,3 @@
import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg'
import { mapValues, pick } from 'lodash-es'
import { BytesPipe } from 'ngx-pipes'
import { Component, ElementRef, ViewChild } from '@angular/core'
@ -144,7 +143,7 @@ export class VideoDownloadComponent {
this.type = type
}
getMetadataFormat (format: FfprobeFormat) {
getMetadataFormat (format: any) {
const keyToTranslateFunction = {
'encoder': (value: string) => ({ label: this.i18n('Encoder'), value }),
'format_long_name': (value: string) => ({ label: this.i18n('Format name'), value }),
@ -165,7 +164,7 @@ export class VideoDownloadComponent {
)
}
getMetadataStream (streams: FfprobeStream[], type: 'video' | 'audio') {
getMetadataStream (streams: any[], type: 'video' | 'audio') {
const stream = streams.find(s => s.codec_type === type)
if (!stream) return undefined
@ -201,6 +200,7 @@ export class VideoDownloadComponent {
private hydrateMetadataFromMetadataUrl (file: VideoFile) {
const observable = this.videoService.getVideoFileMetadata(file.metadataUrl)
observable.subscribe(res => file.metadata = res)
return observable.toPromise()
}
}

View file

@ -12,7 +12,7 @@ import {
} from '@angular/core'
import { AuthService, ScreenService, ServerService, User } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared'
import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models'
import { Video } from '../shared-main'
import { VideoPlaylistService } from '../shared-video-playlist'
import { VideoActionsDisplayType } from './video-actions-dropdown.component'

View file

@ -1,5 +1,5 @@
import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos'
import { Video } from '@app/shared/shared-main'
import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '@shared/models'
export class VideoPlaylistElement implements ServerVideoPlaylistElement {
id: number

View file

@ -13,7 +13,7 @@ type Metadata = {
levels: Hlsjs.Level[]
}
type CustomAudioTrack = AudioTrack & { name?: string, lang?: string }
type CustomAudioTrack = Hlsjs.AudioTrack & { name?: string, lang?: string }
const registerSourceHandler = function (vjs: typeof videojs) {
if (!Hlsjs.isSupported()) {
@ -180,8 +180,6 @@ class Html5Hlsjs {
this.player.textTracks().removeEventListener('change', this.handlers.textTracksChange)
this.uiTextTrackHandled = false
this.player.audioTracks().removeEventListener('change', this.handlers.audioTracksChange)
this.hls.destroy()
}

View file

@ -19,9 +19,7 @@ import './videojs-components/settings-panel'
import './videojs-components/settings-panel-child'
import './videojs-components/theater-button'
import videojs from 'video.js'
import { isDefaultLocale } from '../../../../shared/models/i18n/i18n'
import { VideoFile } from '../../../../shared/models/videos'
import { isDefaultLocale, VideoFile } from '@shared/models'
import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
import { segmentUrlBuilderFactory } from './p2p-media-loader/segment-url-builder'
import { segmentValidatorFactory } from './p2p-media-loader/segment-validator'

View file

@ -41,8 +41,6 @@ declare module 'video.js' {
tracks_: (TextTrack & { id: string, label: string, src: string })[]
}
audioTracks (): AudioTrackList
dock (options: { title: string, description: string }): void
}
}

View file

@ -1,4 +1,4 @@
import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models'
import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '@shared/models'
export class TranslationsManager {
private static videojsLocaleCache: { [ path: string ]: any } = {}

View file

@ -1,4 +1,4 @@
import { VideoFile } from '../../../../shared/models/videos'
import { VideoFile } from '@shared/models'
function toTitleCase (str: string) {
return str.charAt(0).toUpperCase() + str.slice(1)

View file

@ -8,7 +8,7 @@ $icon-font-path: '~@neos21/bootstrap3-glyphicons/assets/fonts/';
@import '~video.js/dist/video-js.css';
$assets-path: '../assets/';
$assets-path: '../../assets/';
@import './player/index';
@import './loading-bar';

View file

@ -1,24 +1,19 @@
import './embed.scss'
import videojs from 'video.js'
import { objectToUrlEncoded, peertubeLocalStorage, PureAuthUser } from '@root-helpers/index'
import {
peertubeTranslate,
ResultList,
ServerConfig,
UserRefreshToken,
VideoCaption,
VideoDetails,
UserRefreshToken
} from '../../../../shared'
import { VideoCaption } from '../../../../shared/models/videos/caption/video-caption.model'
import {
P2PMediaLoaderOptions,
PeertubePlayerManagerOptions,
PlayerMode
} from '../../assets/player/peertube-player-manager'
import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type'
import { PeerTubeEmbedApi } from './embed-api'
import { TranslationsManager } from '../../assets/player/translations-manager'
import videojs from 'video.js'
VideoStreamingPlaylistType
} from '../../../../shared/models'
import { P2PMediaLoaderOptions, PeertubePlayerManagerOptions, PlayerMode } from '../../assets/player/peertube-player-manager'
import { VideoJSCaption } from '../../assets/player/peertube-videojs-typings'
import { PureAuthUser, objectToUrlEncoded, peertubeLocalStorage } from '@root-helpers/index'
import { TranslationsManager } from '../../assets/player/translations-manager'
import { PeerTubeEmbedApi } from './embed-api'
type Translations = { [ id: string ]: string }

View file

@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"baseUrl": "./",
@ -18,5 +18,9 @@
"src/main*.ts",
"src/**/*.d.ts",
"src/shims/*.ts"
],
"exclude": [
"../node_modules",
"../server"
]
}

48
client/tsconfig.base.json Normal file
View file

@ -0,0 +1,48 @@
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"module": "esnext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"noImplicitThis": true,
"suppressImplicitAnyIndexErrors":true,
"alwaysStrict": true,
"importHelpers": true,
"strictBindCallApply": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"baseUrl": "./",
"paths": {
"video.js": [ "node_modules/video.js/core" ],
"@app/*": [ "src/app/*" ],
"@shared/models/*": [ "../shared/models/*" ],
"@shared/models": [ "../shared/models" ],
"@shared/core-utils": [ "../shared/core-utils" ],
"@shared/core-utils/*": [ "../shared/core-utils/*" ],
"@root-helpers/*": [ "src/root-helpers/*" ],
"fs": [ "src/shims/noop.ts" ],
"http": [ "src/shims/http.ts" ],
"https": [ "src/shims/https.ts" ],
"path": [ "src/shims/path.ts" ],
"stream": [ "src/shims/noop.ts" ],
"crypto": [ "src/shims/noop.ts" ]
}
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
"fullTemplateTypeCheck": true,
"strictTemplates": true
}
}

View file

@ -1,45 +1,14 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScripts language server to improve development experience.
It is not intended to be used to perform a compilation.
To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"module": "esnext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"noImplicitThis": true,
"suppressImplicitAnyIndexErrors":true,
"alwaysStrict": true,
"importHelpers": true,
"strictBindCallApply": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"baseUrl": "./",
"paths": {
"video.js": [ "node_modules/video.js/core" ],
"@app/*": [ "src/app/*" ],
"@shared/*": [ "../shared/*" ],
"@root-helpers/*": [ "src/root-helpers/*" ],
"fs": [ "src/shims/noop.ts" ],
"http": [ "src/shims/http.ts" ],
"https": [ "src/shims/https.ts" ],
"path": [ "src/shims/path.ts" ],
"stream": [ "src/shims/noop.ts" ],
"crypto": [ "src/shims/noop.ts" ]
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
}
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
"fullTemplateTypeCheck": true,
"strictTemplates": true
}
]
}

View file

@ -1,11 +1,13 @@
{
"extends": [ "tslint-angular", "tslint-config-standard" ],
"rules": {
"deprecation": {
"severity": "warning"
},
"no-inferrable-types": true,
"eofline": true,
"max-line-length": [true, 140],
"no-floating-promises": false,
"no-unused-variable": false, // Memory issues
"no-floating-promises": false, // Memory issues
"await-promise": [true, "PromiseLike"],
"member-ordering": [true, {
"order": [

View file

@ -1,7 +1,6 @@
const helpers = require('./helpers')
const path = require('path')
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin
const HtmlWebpackPlugin = require('html-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
@ -29,7 +28,7 @@ module.exports = function () {
alias: {
'video.js$': path.resolve('node_modules/video.js/core.js'),
'@root-helpers': path.resolve('src/root-helpers'),
'@shared': path.resolve('../shared')
'@shared/models': path.resolve('../shared/models'),
}
},
@ -54,13 +53,12 @@ module.exports = function () {
test: /\.ts$/,
use: [
{
loader: 'awesome-typescript-loader',
loader: 'ts-loader',
options: {
configFileName: 'tsconfig.json'
configFile: 'tsconfig.base.json'
}
}
],
exclude: [/\.(spec|e2e)\.ts$/]
]
},
{
@ -75,12 +73,6 @@ module.exports = function () {
importLoaders: 1
}
},
// {
// loader: 'resolve-url-loader',
// options: {
// debug: true
// }
// },
{
loader: 'sass-loader',
options: {
@ -135,8 +127,6 @@ module.exports = function () {
}
}),
new CheckerPlugin(),
new HtmlWebpackPlugin({
template: 'src/standalone/videos/embed.html',
filename: 'embed.html',

File diff suppressed because it is too large Load diff

View file

@ -5,4 +5,5 @@ set -eu
cd client
mkdir -p ./dist/standalone/videos/
NODE_ENV=production npm run webpack -- --config webpack/webpack.video-embed.js --mode production --json > "./dist/standalone/videos/embed-stats.json"

View file

@ -5,5 +5,5 @@ set -eu
gawk -i inplace 'BEGIN { found=0 } { if (found || $0 ~ /^{/) { found=1; print }}' ./client/dist/standalone/videos/embed-stats.json
npm run concurrently -- -k \
"cd client && npm run webpack-bundle-analyzer -- -p 8888 ./dist/en-US/stats-es2015.json" \
"cd client && npm run webpack-bundle-analyzer -- -p 8888 ./dist/en-US/stats.json" \
"cd client && npm run webpack-bundle-analyzer -- -p 8889 ./dist/standalone/videos/embed-stats.json"

View file

@ -482,6 +482,7 @@ async function getVideoDescription (req: express.Request, res: express.Response)
async function getVideoFileMetadata (req: express.Request, res: express.Response) {
const videoFile = await VideoFileModel.loadWithMetadata(toInt(req.params.videoFileId))
return res.json(videoFile.metadata)
}

View file

@ -1,11 +1,9 @@
import * as Bluebird from 'bluebird'
export interface PluginSettingsManager {
getSetting: (name: string) => Bluebird<string | boolean>
getSetting: (name: string) => Promise<string | boolean>
getSettings: (names: string[]) => Bluebird<{ [settingName: string]: string | boolean }>
getSettings: (names: string[]) => Promise<{ [settingName: string]: string | boolean }>
setSetting: (name: string, value: string) => Bluebird<any>
setSetting: (name: string, value: string) => Promise<any>
onSettingsChange: (cb: (names: string[]) => void) => void
}

View file

@ -1,7 +1,5 @@
import * as Bluebird from 'bluebird'
export interface PluginStorageManager {
getData: (key: string) => Bluebird<string>
getData: (key: string) => Promise<string>
storeData: (key: string, data: any) => Bluebird<any>
storeData: (key: string, data: any) => Promise<any>
}

View file

@ -1,14 +1,9 @@
import { FfprobeData } from 'fluent-ffmpeg'
import { DeepOmit } from '../../core-utils'
export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'>
export class VideoFileMetadata implements VideoFileMetadataModel {
export class VideoFileMetadata {
streams: { [x: string]: any, [x: number]: any }[]
format: { [x: string]: any, [x: number]: any }
chapters: any[]
constructor (hash: Partial<VideoFileMetadataModel>) {
constructor (hash: { chapters: any[], format: any, streams: any[] }) {
this.chapters = hash.chapters
this.format = hash.format
this.streams = hash.streams

View file

@ -1,5 +1,5 @@
import { VideoConstant, VideoResolution } from '@shared/models'
import { FfprobeData } from 'fluent-ffmpeg'
import { VideoConstant, VideoFileMetadata, VideoResolution } from '@shared/models'
export interface VideoFile {
magnetUri: string
@ -10,6 +10,6 @@ export interface VideoFile {
fileUrl: string
fileDownloadUrl: string
fps: number
metadata?: FfprobeData
metadata?: VideoFileMetadata
metadataUrl?: string
}

View file

@ -1,11 +1,11 @@
import { AccountSummary, VideoChannelSummary, VideoState } from '../../index'
import { Account } from '../actors'
import { VideoChannel } from './channel/video-channel.model'
import { Account, AccountSummary } from '../actors'
import { VideoChannel, VideoChannelSummary } from './channel/video-channel.model'
import { VideoConstant } from './video-constant.model'
import { VideoFile } from './video-file.model'
import { VideoPrivacy } from './video-privacy.enum'
import { VideoScheduleUpdate } from './video-schedule-update.model'
import { VideoConstant } from './video-constant.model'
import { VideoState } from './video-state.enum'
import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
import { VideoFile } from './video-file.model'
export interface Video {
id: number