From 583eb04b541175035d6d452ca626a96ebf2b7437 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 26 Jun 2020 08:37:26 +0200 Subject: Upgrade to angular 10 --- shared/models/plugins/plugin-settings-manager.model.ts | 8 +++----- shared/models/plugins/plugin-storage-manager.model.ts | 6 ++---- shared/models/videos/video-file-metadata.ts | 9 ++------- shared/models/videos/video-file.model.ts | 6 +++--- shared/models/videos/video.model.ts | 10 +++++----- 5 files changed, 15 insertions(+), 24 deletions(-) (limited to 'shared') diff --git a/shared/models/plugins/plugin-settings-manager.model.ts b/shared/models/plugins/plugin-settings-manager.model.ts index db88ae6e7..165f0dc5b 100644 --- a/shared/models/plugins/plugin-settings-manager.model.ts +++ b/shared/models/plugins/plugin-settings-manager.model.ts @@ -1,11 +1,9 @@ -import * as Bluebird from 'bluebird' - export interface PluginSettingsManager { - getSetting: (name: string) => Bluebird + getSetting: (name: string) => Promise - getSettings: (names: string[]) => Bluebird<{ [settingName: string]: string | boolean }> + getSettings: (names: string[]) => Promise<{ [settingName: string]: string | boolean }> - setSetting: (name: string, value: string) => Bluebird + setSetting: (name: string, value: string) => Promise onSettingsChange: (cb: (names: string[]) => void) => void } diff --git a/shared/models/plugins/plugin-storage-manager.model.ts b/shared/models/plugins/plugin-storage-manager.model.ts index 8a1f389f1..51567044a 100644 --- a/shared/models/plugins/plugin-storage-manager.model.ts +++ b/shared/models/plugins/plugin-storage-manager.model.ts @@ -1,7 +1,5 @@ -import * as Bluebird from 'bluebird' - export interface PluginStorageManager { - getData: (key: string) => Bluebird + getData: (key: string) => Promise - storeData: (key: string, data: any) => Bluebird + storeData: (key: string, data: any) => Promise } diff --git a/shared/models/videos/video-file-metadata.ts b/shared/models/videos/video-file-metadata.ts index 010bf7cf5..8f527c0a7 100644 --- a/shared/models/videos/video-file-metadata.ts +++ b/shared/models/videos/video-file-metadata.ts @@ -1,14 +1,9 @@ -import { FfprobeData } from 'fluent-ffmpeg' -import { DeepOmit } from '../../core-utils' - -export type VideoFileMetadataModel = DeepOmit - -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) { + constructor (hash: { chapters: any[], format: any, streams: any[] }) { this.chapters = hash.chapters this.format = hash.format this.streams = hash.streams diff --git a/shared/models/videos/video-file.model.ts b/shared/models/videos/video-file.model.ts index 6cc2d5aee..cbef05ac0 100644 --- a/shared/models/videos/video-file.model.ts +++ b/shared/models/videos/video-file.model.ts @@ -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 } diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 0f8822125..557e66e09 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts @@ -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 -- cgit v1.2.3