mirror of https://github.com/Chocobozzz/PeerTube
Merge branch 'release/3.1.0' into develop
commit
dc48fdbe68
|
@ -153,7 +153,7 @@
|
||||||
<my-select-options
|
<my-select-options
|
||||||
id="liveTranscodingProfile"
|
id="liveTranscodingProfile"
|
||||||
formControlName="profile"
|
formControlName="profile"
|
||||||
[items]="getAvailableTranscodingProfile()"
|
[items]="transcodingProfiles"
|
||||||
[clearable]="false"
|
[clearable]="false"
|
||||||
>
|
>
|
||||||
</my-select-options>
|
</my-select-options>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||||
import { FormGroup } from '@angular/forms'
|
import { FormGroup } from '@angular/forms'
|
||||||
import { ServerConfig } from '@shared/models'
|
import { ServerConfig } from '@shared/models'
|
||||||
import { ConfigService } from '../shared/config.service'
|
import { ConfigService } from '../shared/config.service'
|
||||||
|
@ -11,12 +11,14 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
||||||
templateUrl: './edit-live-configuration.component.html',
|
templateUrl: './edit-live-configuration.component.html',
|
||||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||||
})
|
})
|
||||||
export class EditLiveConfigurationComponent implements OnInit {
|
export class EditLiveConfigurationComponent implements OnInit, OnChanges {
|
||||||
@Input() form: FormGroup
|
@Input() form: FormGroup
|
||||||
@Input() formErrors: any
|
@Input() formErrors: any
|
||||||
@Input() serverConfig: ServerConfig
|
@Input() serverConfig: ServerConfig
|
||||||
|
|
||||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||||
|
transcodingProfiles: SelectOptionsItem[] = []
|
||||||
|
|
||||||
liveMaxDurationOptions: SelectOptionsItem[] = []
|
liveMaxDurationOptions: SelectOptionsItem[] = []
|
||||||
liveResolutions: ResolutionOption[] = []
|
liveResolutions: ResolutionOption[] = []
|
||||||
|
|
||||||
|
@ -39,7 +41,13 @@ export class EditLiveConfigurationComponent implements OnInit {
|
||||||
this.liveResolutions = this.editConfigurationService.getLiveResolutions()
|
this.liveResolutions = this.editConfigurationService.getLiveResolutions()
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableTranscodingProfile () {
|
ngOnChanges (changes: SimpleChanges) {
|
||||||
|
if (changes['serverConfig']) {
|
||||||
|
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAvailableTranscodingProfile () {
|
||||||
const profiles = this.serverConfig.live.transcoding.availableProfiles
|
const profiles = this.serverConfig.live.transcoding.availableProfiles
|
||||||
|
|
||||||
return profiles.map(p => {
|
return profiles.map(p => {
|
||||||
|
|
|
@ -181,7 +181,7 @@
|
||||||
<my-select-options
|
<my-select-options
|
||||||
id="transcodingProfile"
|
id="transcodingProfile"
|
||||||
formControlName="profile"
|
formControlName="profile"
|
||||||
[items]="getAvailableTranscodingProfile()"
|
[items]="transcodingProfiles"
|
||||||
[clearable]="false"
|
[clearable]="false"
|
||||||
></my-select-options>
|
></my-select-options>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||||
import { FormGroup } from '@angular/forms'
|
import { FormGroup } from '@angular/forms'
|
||||||
import { ServerConfig } from '@shared/models'
|
import { ServerConfig } from '@shared/models'
|
||||||
import { ConfigService } from '../shared/config.service'
|
import { ConfigService } from '../shared/config.service'
|
||||||
|
@ -11,12 +11,13 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
||||||
templateUrl: './edit-vod-transcoding.component.html',
|
templateUrl: './edit-vod-transcoding.component.html',
|
||||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||||
})
|
})
|
||||||
export class EditVODTranscodingComponent implements OnInit {
|
export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
@Input() form: FormGroup
|
@Input() form: FormGroup
|
||||||
@Input() formErrors: any
|
@Input() formErrors: any
|
||||||
@Input() serverConfig: ServerConfig
|
@Input() serverConfig: ServerConfig
|
||||||
|
|
||||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||||
|
transcodingProfiles: SelectOptionsItem[] = []
|
||||||
resolutions: ResolutionOption[] = []
|
resolutions: ResolutionOption[] = []
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
@ -31,7 +32,13 @@ export class EditVODTranscodingComponent implements OnInit {
|
||||||
this.checkTranscodingFields()
|
this.checkTranscodingFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableTranscodingProfile () {
|
ngOnChanges (changes: SimpleChanges) {
|
||||||
|
if (changes['serverConfig']) {
|
||||||
|
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAvailableTranscodingProfile () {
|
||||||
const profiles = this.serverConfig.transcoding.availableProfiles
|
const profiles = this.serverConfig.transcoding.availableProfiles
|
||||||
|
|
||||||
return profiles.map(p => {
|
return profiles.map(p => {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { DatePipe } from '@angular/common'
|
import { Component, Input, OnChanges } from '@angular/core'
|
||||||
import { Component, Input, OnChanges, OnInit } from '@angular/core'
|
|
||||||
import { FromNowPipe } from '../angular/from-now.pipe'
|
import { FromNowPipe } from '../angular/from-now.pipe'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -14,10 +13,7 @@ export class DateToggleComponent implements OnChanges {
|
||||||
dateRelative: string
|
dateRelative: string
|
||||||
dateAbsolute: string
|
dateAbsolute: string
|
||||||
|
|
||||||
constructor (
|
constructor (private fromNowPipe: FromNowPipe) { }
|
||||||
private datePipe: DatePipe,
|
|
||||||
private fromNowPipe: FromNowPipe
|
|
||||||
) { }
|
|
||||||
|
|
||||||
ngOnChanges () {
|
ngOnChanges () {
|
||||||
this.updateDates()
|
this.updateDates()
|
||||||
|
|
|
@ -5,7 +5,8 @@ $playlist-menu-width: 350px;
|
||||||
right: 0;
|
right: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: $playlist-menu-width;
|
width: $playlist-menu-width;
|
||||||
background: rgba(0, 0, 0, 0.8);
|
// !important to prevent none background set on focus
|
||||||
|
background: rgba(0, 0, 0, 0.8) !important;
|
||||||
z-index: 101;
|
z-index: 101;
|
||||||
transition: right 0.2s;
|
transition: right 0.2s;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|
|
@ -76,7 +76,7 @@ function getYoutubeDLSubs (url: string, opts?: object): Promise<YoutubeDLSubs> {
|
||||||
logger.debug('Get subtitles from youtube dl.', { url, files })
|
logger.debug('Get subtitles from youtube dl.', { url, files })
|
||||||
|
|
||||||
const subtitles = files.reduce((acc, filename) => {
|
const subtitles = files.reduce((acc, filename) => {
|
||||||
const matched = filename.match(/\.([a-z]{2})\.(vtt|ttml)/i)
|
const matched = filename.match(/\.([a-z]{2})(-[a-z]+)?\.(vtt|ttml)/i)
|
||||||
if (!matched || !matched[1]) return acc
|
if (!matched || !matched[1]) return acc
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
import * as Sequelize from 'sequelize'
|
||||||
|
|
||||||
|
async function up (utils: {
|
||||||
|
transaction: Sequelize.Transaction
|
||||||
|
queryInterface: Sequelize.QueryInterface
|
||||||
|
sequelize: Sequelize.Sequelize
|
||||||
|
db: any
|
||||||
|
}): Promise<void> {
|
||||||
|
|
||||||
|
await utils.sequelize.query(
|
||||||
|
'DELETE FROM "videoCaption" v1 USING (SELECT MIN(id) as id, "filename" FROM "videoCaption" ' +
|
||||||
|
'GROUP BY "filename" HAVING COUNT(*) > 1) v2 WHERE v1."filename" = v2."filename" AND v1.id <> v2.id'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function down (options) {
|
||||||
|
throw new Error('Not implemented.')
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
up,
|
||||||
|
down
|
||||||
|
}
|
|
@ -917,7 +917,7 @@ export class VideoModel extends Model {
|
||||||
},
|
},
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
attributes: [ 'language', 'fileUrl' ],
|
attributes: [ 'filename', 'language', 'fileUrl' ],
|
||||||
model: VideoCaptionModel.unscoped(),
|
model: VideoCaptionModel.unscoped(),
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
|
|
|
@ -2646,9 +2646,14 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
properties:
|
||||||
items:
|
total:
|
||||||
$ref: '#/components/schemas/VideoChannel'
|
type: integer
|
||||||
|
example: 1
|
||||||
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/VideoChannel'
|
||||||
'/accounts/{name}/ratings':
|
'/accounts/{name}/ratings':
|
||||||
get:
|
get:
|
||||||
summary: List ratings of an account
|
summary: List ratings of an account
|
||||||
|
|
Loading…
Reference in New Issue