diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-28 15:43:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-28 15:46:14 +0200 |
commit | f9ac050a354ee91356aa342d10b49033d8b79fe0 (patch) | |
tree | ca25871142ef071c8b83bea83caa5b1741021e84 | |
parent | 3193ac2c3b0209b87c1347032f7bd21ea651d8e6 (diff) | |
download | PeerTube-f9ac050a354ee91356aa342d10b49033d8b79fe0.tar.gz PeerTube-f9ac050a354ee91356aa342d10b49033d8b79fe0.tar.zst PeerTube-f9ac050a354ee91356aa342d10b49033d8b79fe0.zip |
Remove unnecessary workarounds
Has been fixed upstream
4 files changed, 4 insertions, 21 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-upload.service.ts b/client/src/app/+videos/+video-edit/shared/video-upload.service.ts index cb9503503..50ca1a60b 100644 --- a/client/src/app/+videos/+video-edit/shared/video-upload.service.ts +++ b/client/src/app/+videos/+video-edit/shared/video-upload.service.ts | |||
@@ -3,7 +3,6 @@ import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/h | |||
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { AuthService, Notifier, ServerService } from '@app/core' | 4 | import { AuthService, Notifier, ServerService } from '@app/core' |
5 | import { BytesPipe, VideoService } from '@app/shared/shared-main' | 5 | import { BytesPipe, VideoService } from '@app/shared/shared-main' |
6 | import { isIOS } from '@root-helpers/web-browser' | ||
7 | import { HttpStatusCode } from '@shared/models' | 6 | import { HttpStatusCode } from '@shared/models' |
8 | import { UploaderXFormData } from './uploaderx-form-data' | 7 | import { UploaderXFormData } from './uploaderx-form-data' |
9 | 8 | ||
@@ -64,17 +63,11 @@ export class VideoUploadService { | |||
64 | } | 63 | } |
65 | 64 | ||
66 | private getUploadxOptions (endpoint: string, uploaderClass: typeof UploaderXFormData) { | 65 | private getUploadxOptions (endpoint: string, uploaderClass: typeof UploaderXFormData) { |
67 | // FIXME: https://github.com/Chocobozzz/PeerTube/issues/4382#issuecomment-915854167 | ||
68 | const chunkSize = isIOS() | ||
69 | ? 0 | ||
70 | : undefined // Auto chunk size | ||
71 | |||
72 | return { | 66 | return { |
73 | endpoint, | 67 | endpoint, |
74 | multiple: false, | 68 | multiple: false, |
75 | 69 | ||
76 | maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize, | 70 | maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize, |
77 | chunkSize, | ||
78 | 71 | ||
79 | token: this.authService.getAccessToken(), | 72 | token: this.authService.getAccessToken(), |
80 | 73 | ||
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index cfa42910b..f7e1872a5 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts | |||
@@ -158,8 +158,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy | |||
158 | break | 158 | break |
159 | 159 | ||
160 | case 'uploading': | 160 | case 'uploading': |
161 | // TODO: remove || 0 when // https://github.com/kukhariev/ngx-uploadx/pull/368 is released | 161 | this.videoUploadPercents = state.progress |
162 | this.videoUploadPercents = state.progress || 0 | ||
163 | break | 162 | break |
164 | 163 | ||
165 | case 'paused': | 164 | case 'paused': |
diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.ts b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts index 76ef77e5a..f71eb3d34 100644 --- a/client/src/app/shared/shared-forms/peertube-checkbox.component.ts +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core' | 1 | import { AfterContentInit, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core' |
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
3 | import { PeerTubeTemplateDirective } from '@app/shared/shared-main' | 3 | import { PeerTubeTemplateDirective } from '@app/shared/shared-main' |
4 | 4 | ||
@@ -25,14 +25,9 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon | |||
25 | 25 | ||
26 | @ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>> | 26 | @ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>> |
27 | 27 | ||
28 | // FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836 | ||
29 | @Input() onPushWorkaround = false | ||
30 | |||
31 | labelTemplate: TemplateRef<any> | 28 | labelTemplate: TemplateRef<any> |
32 | helpTemplate: TemplateRef<any> | 29 | helpTemplate: TemplateRef<any> |
33 | 30 | ||
34 | constructor (private cdr: ChangeDetectorRef) { } | ||
35 | |||
36 | ngAfterContentInit () { | 31 | ngAfterContentInit () { |
37 | { | 32 | { |
38 | const t = this.templates.find(t => t.name === 'label') | 33 | const t = this.templates.find(t => t.name === 'label') |
@@ -49,10 +44,6 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon | |||
49 | 44 | ||
50 | writeValue (checked: boolean) { | 45 | writeValue (checked: boolean) { |
51 | this.checked = checked | 46 | this.checked = checked |
52 | |||
53 | if (this.onPushWorkaround) { | ||
54 | this.cdr.markForCheck() | ||
55 | } | ||
56 | } | 47 | } |
57 | 48 | ||
58 | registerOnChange (fn: (_: any) => void) { | 49 | registerOnChange (fn: (_: any) => void) { |
diff --git a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html index f2f69236c..4aaccd50d 100644 --- a/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html +++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html | |||
@@ -17,7 +17,7 @@ | |||
17 | <button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)"> | 17 | <button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)"> |
18 | <my-peertube-checkbox | 18 | <my-peertube-checkbox |
19 | [disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)" | 19 | [disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)" |
20 | [ngModel]="isPrimaryCheckboxChecked(playlist)" [onPushWorkaround]="true" | 20 | [ngModel]="isPrimaryCheckboxChecked(playlist)" |
21 | ></my-peertube-checkbox> | 21 | ></my-peertube-checkbox> |
22 | 22 | ||
23 | <label [for]="getPrimaryInputName(playlist)" class="display-name"> | 23 | <label [for]="getPrimaryInputName(playlist)" class="display-name"> |
@@ -36,7 +36,7 @@ | |||
36 | <ng-container *ngFor="let element of buildOptionalRowElements(playlist)"> | 36 | <ng-container *ngFor="let element of buildOptionalRowElements(playlist)"> |
37 | <my-peertube-checkbox | 37 | <my-peertube-checkbox |
38 | [inputName]="getOptionalInputName(playlist, element)" | 38 | [inputName]="getOptionalInputName(playlist, element)" |
39 | [ngModel]="element.enabled" [onPushWorkaround]="true" | 39 | [ngModel]="element.enabled" |
40 | (click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)" | 40 | (click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)" |
41 | ></my-peertube-checkbox> | 41 | ></my-peertube-checkbox> |
42 | 42 | ||