Updated API

Removed unused component
This commit is contained in:
Isaac Abadi
2021-09-30 19:37:21 -06:00
parent 3937700eff
commit 94006ef794
80 changed files with 300 additions and 588 deletions

View File

@@ -3,8 +3,6 @@
/* eslint-disable */
export type { BaseChangePermissionsRequest } from './models/BaseChangePermissionsRequest';
export type { BaseDownloadRequest } from './models/BaseDownloadRequest';
export type { BaseDownloadResponse } from './models/BaseDownloadResponse';
export type { body_19 } from './models/body_19';
export type { body_20 } from './models/body_20';
export type { ChangeRolePermissionsRequest } from './models/ChangeRolePermissionsRequest';
@@ -13,8 +11,8 @@ export type { Config } from './models/Config';
export type { ConfigResponse } from './models/ConfigResponse';
export type { CreatePlaylistRequest } from './models/CreatePlaylistRequest';
export type { CreatePlaylistResponse } from './models/CreatePlaylistResponse';
export type { CropFileSettings } from './models/CropFileSettings';
export type { DatabaseFile } from './models/DatabaseFile';
export type { DeleteFileRequest } from './models/DeleteFileRequest';
export type { DeleteMp3Mp4Request } from './models/DeleteMp3Mp4Request';
export type { DeletePlaylistRequest } from './models/DeletePlaylistRequest';
export type { DeleteSubscriptionFileRequest } from './models/DeleteSubscriptionFileRequest';
@@ -22,6 +20,8 @@ export type { DeleteUserRequest } from './models/DeleteUserRequest';
export type { Download } from './models/Download';
export type { DownloadArchiveRequest } from './models/DownloadArchiveRequest';
export type { DownloadFileRequest } from './models/DownloadFileRequest';
export type { DownloadRequest } from './models/DownloadRequest';
export type { DownloadResponse } from './models/DownloadResponse';
export type { DownloadVideosForSubscriptionRequest } from './models/DownloadVideosForSubscriptionRequest';
export type { File } from './models/File';
export { FileType } from './models/FileType';
@@ -37,6 +37,8 @@ export type { GetMp3sResponse } from './models/GetMp3sResponse';
export type { GetMp4sResponse } from './models/GetMp4sResponse';
export type { GetPlaylistRequest } from './models/GetPlaylistRequest';
export type { GetPlaylistResponse } from './models/GetPlaylistResponse';
export type { GetPlaylistsRequest } from './models/GetPlaylistsRequest';
export type { GetPlaylistsResponse } from './models/GetPlaylistsResponse';
export type { GetRolesResponse } from './models/GetRolesResponse';
export type { GetSubscriptionRequest } from './models/GetSubscriptionRequest';
export type { GetSubscriptionResponse } from './models/GetSubscriptionResponse';
@@ -44,10 +46,6 @@ export type { GetUsersResponse } from './models/GetUsersResponse';
export type { inline_response_200_15 } from './models/inline_response_200_15';
export type { LoginRequest } from './models/LoginRequest';
export type { LoginResponse } from './models/LoginResponse';
export type { Mp3DownloadRequest } from './models/Mp3DownloadRequest';
export type { Mp3DownloadResponse } from './models/Mp3DownloadResponse';
export type { Mp4DownloadRequest } from './models/Mp4DownloadRequest';
export type { Mp4DownloadResponse } from './models/Mp4DownloadResponse';
export type { Playlist } from './models/Playlist';
export type { RegisterRequest } from './models/RegisterRequest';
export type { RegisterResponse } from './models/RegisterResponse';
@@ -60,7 +58,6 @@ export type { SubscriptionRequestData } from './models/SubscriptionRequestData';
export type { SuccessObject } from './models/SuccessObject';
export type { UnsubscribeRequest } from './models/UnsubscribeRequest';
export type { UnsubscribeResponse } from './models/UnsubscribeResponse';
export type { UpdatePlaylistFilesRequest } from './models/UpdatePlaylistFilesRequest';
export type { UpdatePlaylistRequest } from './models/UpdatePlaylistRequest';
export type { UpdaterStatus } from './models/UpdaterStatus';
export type { UpdateServerRequest } from './models/UpdateServerRequest';

View File

@@ -8,4 +8,4 @@ import { YesNo } from './YesNo';
export interface BaseChangePermissionsRequest {
permission: UserPermission;
new_value: YesNo;
}
}

View File

@@ -1,29 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface BaseDownloadRequest {
url: string;
/**
* Video format code. Overrides other quality options.
*/
customQualityConfiguration?: string;
/**
* Custom command-line arguments for youtubedl. Overrides all other options, except url.
*/
customArgs?: string;
/**
* Custom output filename template.
*/
customOutput?: string;
/**
* Login with this account ID
*/
youtubeUsername?: string;
/**
* Account password
*/
youtubePassword?: string;
ui_uid?: string | null;
}

View File

@@ -1,9 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface BaseDownloadResponse {
uid: string;
file_names?: Array<string> | null;
}

View File

@@ -6,4 +6,4 @@ import { BaseChangePermissionsRequest } from './BaseChangePermissionsRequest';
export interface ChangeRolePermissionsRequest extends BaseChangePermissionsRequest {
role: string;
}
}

View File

@@ -6,4 +6,4 @@ import { BaseChangePermissionsRequest } from './BaseChangePermissionsRequest';
export interface ChangeUserPermissionsRequest extends BaseChangePermissionsRequest {
user_uid: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface Config {
YoutubeDLMaterial: any;
}
}

View File

@@ -7,4 +7,4 @@ import { Config } from './Config';
export interface ConfigResponse {
config_file: Config;
success: boolean;
}
}

View File

@@ -6,8 +6,7 @@ import { FileType } from './FileType';
export interface CreatePlaylistRequest {
playlistName: string;
fileNames: Array<string>;
uids: Array<string>;
type: FileType;
thumbnailURL: string;
duration: number;
}
}

View File

@@ -7,4 +7,4 @@ import { Playlist } from './Playlist';
export interface CreatePlaylistResponse {
new_playlist: Playlist;
success: boolean;
}
}

View File

@@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface CropFileSettings {
cropFileStart: number;
cropFileEnd: number;
}

View File

@@ -19,4 +19,4 @@ export interface DatabaseFile {
upload_date: string;
uid: string;
sharingEnabled?: boolean;
}
}

View File

@@ -1,10 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
export interface DeleteFileRequest {
fileName: string;
type: FileType;
}

View File

@@ -6,4 +6,4 @@
export interface DeleteMp3Mp4Request {
uid: string;
blacklistMode?: boolean;
}
}

View File

@@ -5,6 +5,6 @@
import { FileType } from './FileType';
export interface DeletePlaylistRequest {
playlistID: string;
playlist_id: string;
type: FileType;
}
}

View File

@@ -12,4 +12,4 @@ export interface DeleteSubscriptionFileRequest {
* If true, does not remove id from archive. Only valid if youtube-dl archive is enabled in settings.
*/
deleteForever?: boolean;
}
}

View File

@@ -5,4 +5,4 @@
export interface DeleteUserRequest {
uid: string;
}
}

View File

@@ -5,19 +5,22 @@
export interface Download {
uid: string;
ui_uid: string;
downloading: boolean;
complete: boolean;
ui_uid?: string;
running: boolean;
finished: boolean;
paused: boolean;
finished_step: boolean;
url: string;
type: string;
title: string;
step_index: number;
percent_complete: number;
is_playlist: boolean;
timestamp_start: number;
timestamp_end?: number;
filesize?: number | null;
/**
* Error text, set if download fails.
*/
error?: string;
fileNames?: Array<string>;
}
error?: string | null;
user_uid?: string;
sub_id?: string;
sub_name?: string;
}

View File

@@ -5,6 +5,6 @@
export interface DownloadArchiveRequest {
sub: {
archive_dir: string,
};
}
archive_dir: string,
};
}

View File

@@ -2,23 +2,13 @@
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
export interface DownloadFileRequest {
fileNames: ;
zip_mode?: boolean;
type: FileType;
outputName?: string;
fullPathProvided?: boolean;
uid: string;
uuid?: string;
uid?: string;
id?: string;
sub_id?: string;
/**
* Only used for subscriptions
*/
subscriptionName?: string;
/**
* Only used for subscriptions
*/
subPlaylist?: boolean;
}
is_playlist?: boolean;
}

View File

@@ -0,0 +1,44 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { CropFileSettings } from './CropFileSettings';
import { FileType } from './FileType';
export interface DownloadRequest {
url: string;
/**
* Video format code. Overrides other quality options.
*/
customQualityConfiguration?: string;
/**
* Custom command-line arguments for youtube-dl. Overrides all other options, except url.
*/
customArgs?: string;
/**
* Additional command-line arguments for youtube-dl. Added to whatever args would normally be used.
*/
additionalArgs?: string;
/**
* Custom output filename template.
*/
customOutput?: string;
/**
* Login with this account ID
*/
youtubeUsername?: string;
/**
* Account password
*/
youtubePassword?: string;
/**
* Height of the video, if known
*/
selectedHeight?: string;
/**
* Specify ffmpeg/avconv audio quality
*/
maxBitrate?: string;
type?: FileType;
cropFileSettings?: CropFileSettings;
}

View File

@@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Download } from './Download';
export interface DownloadResponse {
download?: Download | null;
}

View File

@@ -5,4 +5,4 @@
export interface DownloadVideosForSubscriptionRequest {
subID: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface File {
id?: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface GenerateNewApiKeyResponse {
new_api_key: string;
}
}

View File

@@ -2,12 +2,8 @@
/* tslint:disable */
/* eslint-disable */
import { Dictionary } from './Dictionary';
import { Download } from './Download';
export interface GetAllDownloadsResponse {
/**
* Map of Session ID to inner map
*/
downloads?: Dictionary<Dictionary<Download>>;
}
downloads?: Array<Download>;
}

View File

@@ -11,4 +11,4 @@ export interface GetAllFilesResponse {
* All video playlists
*/
playlists: Array<Playlist>;
}
}

View File

@@ -6,4 +6,4 @@ import { Subscription } from './Subscription';
export interface GetAllSubscriptionsResponse {
subscriptions: Array<Subscription>;
}
}

View File

@@ -4,6 +4,5 @@
export interface GetDownloadRequest {
session_id: string;
download_id: string;
}
download_uid: string;
}

View File

@@ -6,4 +6,4 @@ import { Download } from './Download';
export interface GetDownloadResponse {
download?: Download | null;
}
}

View File

@@ -14,4 +14,4 @@ export interface GetFileRequest {
* User UID
*/
uuid?: string;
}
}

View File

@@ -7,4 +7,4 @@ import { DatabaseFile } from './DatabaseFile';
export interface GetFileResponse {
success: boolean;
file?: DatabaseFile;
}
}

View File

@@ -11,4 +11,4 @@ export interface GetMp3sResponse {
* All audio playlists
*/
playlists: Array<Playlist>;
}
}

View File

@@ -11,4 +11,4 @@ export interface GetMp4sResponse {
* All video playlists
*/
playlists: Array<Playlist>;
}
}

View File

@@ -5,7 +5,8 @@
import { FileType } from './FileType';
export interface GetPlaylistRequest {
playlistID: string;
playlist_id: string;
type?: FileType;
uuid?: string;
}
include_file_metadata?: boolean;
}

View File

@@ -9,4 +9,4 @@ export interface GetPlaylistResponse {
playlist: Playlist;
type: FileType;
success: boolean;
}
}

View File

@@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetPlaylistsRequest {
include_categories?: boolean;
}

View File

@@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Playlist } from './Playlist';
export interface GetPlaylistsResponse {
playlists: Array<Playlist>;
}

View File

@@ -6,11 +6,11 @@ import { UserPermission } from './UserPermission';
export interface GetRolesResponse {
roles: {
admin?: {
permissions?: Array<UserPermission>,
},
user?: {
permissions?: Array<UserPermission>,
},
};
}
admin?: {
permissions?: Array<UserPermission>,
},
user?: {
permissions?: Array<UserPermission>,
},
};
}

View File

@@ -8,4 +8,8 @@ export interface GetSubscriptionRequest {
* Subscription ID
*/
id: string;
}
/**
* Subscription name
*/
name?: string;
}

View File

@@ -7,4 +7,4 @@ import { Subscription } from './Subscription';
export interface GetSubscriptionResponse {
subscription: Subscription;
files: Array<any>;
}
}

View File

@@ -6,4 +6,4 @@ import { User } from './User';
export interface GetUsersResponse {
users: Array<User>;
}
}

View File

@@ -6,4 +6,4 @@
export interface LoginRequest {
username: string;
password: string;
}
}

View File

@@ -10,4 +10,4 @@ export interface LoginResponse {
token?: string;
permissions?: Array<UserPermission>;
available_permissions?: Array<UserPermission>;
}
}

View File

@@ -1,12 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { BaseDownloadRequest } from './BaseDownloadRequest';
export interface Mp3DownloadRequest extends BaseDownloadRequest {
/**
* Specify ffmpeg/avconv audio quality
*/
maxBitrate?: string;
}

View File

@@ -1,9 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { BaseDownloadResponse } from './BaseDownloadResponse';
export interface Mp3DownloadResponse extends BaseDownloadResponse {
audiopathEncoded: string;
}

View File

@@ -1,12 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { BaseDownloadRequest } from './BaseDownloadRequest';
export interface Mp4DownloadRequest extends BaseDownloadRequest {
/**
* Height of the video, if known
*/
selectedHeight?: string;
}

View File

@@ -1,9 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { BaseDownloadResponse } from './BaseDownloadResponse';
export interface Mp4DownloadResponse extends BaseDownloadResponse {
videopathEncoded: string;
}

View File

@@ -6,10 +6,11 @@ import { FileType } from './FileType';
export interface Playlist {
name: string;
fileNames: Array<string>;
uids: Array<string>;
id: string;
thumbnailURL: string;
type: FileType;
registered: number;
duration: number;
}
user_uid?: string;
}

View File

@@ -7,4 +7,4 @@ export interface RegisterRequest {
userid: string;
username: string;
password: string;
}
}

View File

@@ -6,4 +6,4 @@ import { User } from './User';
export interface RegisterResponse {
user?: User;
}
}

View File

@@ -6,4 +6,4 @@ import { Config } from './Config';
export interface SetConfigRequest {
new_config_file: Config;
}
}

View File

@@ -2,10 +2,8 @@
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
export interface SharingToggle {
uid: string;
type: FileType;
is_playlist?: boolean;
}
}

View File

@@ -7,8 +7,8 @@ export interface SubscribeRequest {
name: string;
url: string;
timerange?: string;
streamingOnly: boolean;
audioOnly?: boolean;
customArgs?: string;
customFileOutput?: string;
}
maxQuality?: string;
}

View File

@@ -7,4 +7,4 @@ import { Subscription } from './Subscription';
export interface SubscribeResponse {
new_sub: Subscription;
error?: string;
}
}

View File

@@ -17,4 +17,4 @@ export interface Subscription {
custom_args?: string;
custom_output?: string;
videos: Array<any>;
}
}

View File

@@ -10,4 +10,4 @@ export interface SubscriptionRequestData {
type?: FileType;
isPlaylist?: boolean;
archive?: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface SuccessObject {
success: boolean;
}
}

View File

@@ -10,4 +10,4 @@ export interface UnsubscribeRequest {
* Defaults to false
*/
deleteMode?: boolean;
}
}

View File

@@ -6,4 +6,4 @@
export interface UnsubscribeResponse {
success: boolean;
error?: string;
}
}

View File

@@ -1,11 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
export interface UpdatePlaylistFilesRequest {
playlistID: string;
fileNames: Array<string>;
type: FileType;
}

View File

@@ -6,4 +6,4 @@ import { Playlist } from './Playlist';
export interface UpdatePlaylistRequest {
playlist: Playlist;
}
}

View File

@@ -5,4 +5,4 @@
export interface UpdateServerRequest {
tag: string;
}
}

View File

@@ -5,8 +5,8 @@
export interface UpdateUserRequest {
change_object: {
uid: string,
name?: string,
role?: string,
};
}
uid: string,
name?: string,
role?: string,
};
}

View File

@@ -7,4 +7,4 @@ export interface UpdaterStatus {
updating: boolean;
details: string;
error?: boolean;
}
}

View File

@@ -10,16 +10,16 @@ export interface User {
name?: string;
passhash?: string;
files?: {
audio?: Array<File>,
video?: Array<File>,
};
audio?: Array<File>,
video?: Array<File>,
};
playlists?: {
audio?: Array<File>,
video?: Array<File>,
};
audio?: Array<File>,
video?: Array<File>,
};
subscriptions?: Array<Subscription>;
created?: number;
role?: string;
permissions?: Array<UserPermission>;
permission_overrides?: Array<UserPermission>;
}
}

View File

@@ -5,4 +5,4 @@
export interface body_19 {
input_pin: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface body_20 {
unhashed_pin: string;
}
}

View File

@@ -5,4 +5,4 @@
export interface inline_response_200_15 {
is_set: boolean;
}
}

View File

@@ -47,7 +47,6 @@ import { InputDialogComponent } from './input-dialog/input-dialog.component';
import { LazyLoadImageModule, IsVisibleProps } from 'ng-lazyload-image';
import { audioFilesMouseHovering, videoFilesMouseHovering, audioFilesOpened, videoFilesOpened } from './main/main.component';
import { CreatePlaylistComponent } from './create-playlist/create-playlist.component';
import { DownloadItemComponent } from './download-item/download-item.component';
import { SubscriptionsComponent } from './subscriptions/subscriptions.component';
import { SubscribeDialogComponent } from './dialogs/subscribe-dialog/subscribe-dialog.component';
import { SubscriptionComponent } from './subscription//subscription/subscription.component';
@@ -102,7 +101,6 @@ export function isVisible({ event, element, scrollContainer, offset }: IsVisible
PlayerComponent,
InputDialogComponent,
CreatePlaylistComponent,
DownloadItemComponent,
SubscriptionsComponent,
SubscribeDialogComponent,
SubscriptionComponent,

View File

@@ -90,7 +90,7 @@ export class SubscribeDialogComponent implements OnInit {
if (!this.download_all) {
timerange = 'now-' + this.timerange_amount.toString() + this.timerange_unit;
}
this.postsService.createSubscription(this.url, this.name, timerange, this.streamingOnlyMode, this.maxQuality,
this.postsService.createSubscription(this.url, this.name, timerange, this.maxQuality,
this.audioOnlyMode, this.customArgs, this.customFileOutput).subscribe(res => {
this.subscribing = false;
if (res['new_sub']) {

View File

@@ -1,41 +0,0 @@
<div>
<mat-grid-list [rowHeight]="50" [cols]="24">
<mat-grid-tile [colspan]="7">
<div style="display: inline-block; text-align: center; width: 100%;"><span class="shorten"><ng-container i18n="Download ID">ID:</ng-container>&nbsp;{{url_id ? url_id : download.uid}}</span></div>
</mat-grid-tile>
<mat-grid-tile [colspan]="13">
<mat-progress-bar [value]="(download.complete || download.error) ? 100 : download.percent_complete" [mode]="(!download.complete && download.percent_complete === 0 && !download.error) ? 'indeterminate' : 'determinate'"></mat-progress-bar>
<mat-icon *ngIf="download.complete" style="margin-left: 25px; cursor: default" matTooltip="The download was successful" i18n-matTooltip="download successful tooltip">done</mat-icon>
<mat-icon *ngIf="download.error" style="margin-left: 25px; cursor: default" matTooltip="An error has occurred" i18n-matTooltip="download error tooltip">error</mat-icon>
</mat-grid-tile>
<mat-grid-tile [colspan]="4">
<button style="margin-bottom: 2px;" (click)="cancelTheDownload()" mat-icon-button color="warn"><mat-icon fontSet="material-icons-outlined">cancel</mat-icon></button>
</mat-grid-tile>
</mat-grid-list>
<mat-expansion-panel *ngIf="download.timestamp_start" class="ignore-margin">
<mat-expansion-panel-header>
<div>
<ng-container i18n="Details">Details</ng-container>
</div>
<div style="width: 100%">
<div style="float: right">
<mat-panel-description>{{download.timestamp_start | date:'medium'}}</mat-panel-description>
</div>
</div>
</mat-expansion-panel-header>
<div *ngIf="download.error">
<strong><ng-container i18n="Error label">An error has occurred:</ng-container></strong>
<br/>
{{download.error}}
</div>
<div *ngIf="download.timestamp_start">
<strong><ng-container i18n="Download start label">Download start:</ng-container></strong>&nbsp;{{download.timestamp_start | date:'medium'}}
</div>
<div *ngIf="download.timestamp_end">
<strong><ng-container i18n="Download end label">Download end:</ng-container></strong>&nbsp;{{download.timestamp_end | date:'medium'}}
</div>
<div *ngIf="download.fileNames">
<strong><ng-container i18n="File path(s) label">File path(s):</ng-container></strong>&nbsp;{{download.fileNames.join(', ')}}
</div>
</mat-expansion-panel>
</div>

View File

@@ -1,16 +0,0 @@
.shorten {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
}
.mat-expansion-panel:not([class*='mat-elevation-z']) {
box-shadow: none;
}
.ignore-margin {
margin-left: -15px;
margin-right: -15px;
margin-bottom: -15px;
}

View File

@@ -1,25 +0,0 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { DownloadItemComponent } from './download-item.component';
describe('DownloadItemComponent', () => {
let component: DownloadItemComponent;
let fixture: ComponentFixture<DownloadItemComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DownloadItemComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DownloadItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -1,45 +0,0 @@
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { Download } from 'app/main/main.component';
@Component({
selector: 'app-download-item',
templateUrl: './download-item.component.html',
styleUrls: ['./download-item.component.scss']
})
export class DownloadItemComponent implements OnInit {
@Input() download: Download = {
uid: null,
type: 'audio',
percent_complete: 0,
complete: false,
url: 'http://youtube.com/watch?v=17848rufj',
downloading: true,
timestamp_start: null,
timestamp_end: null,
is_playlist: false,
error: false
};
@Output() cancelDownload = new EventEmitter<Download>();
@Input() queueNumber = null;
url_id = null;
constructor() { }
ngOnInit() {
if (this.download && this.download.url && this.download.url.includes('youtu')) {
const string_id = (this.download.is_playlist ? '?list=' : '?v=')
const index_offset = (this.download.is_playlist ? 6 : 3);
const end_index = this.download.url.indexOf(string_id) + index_offset;
this.url_id = this.download.url.substring(end_index, this.download.url.length);
}
}
cancelTheDownload() {
this.cancelDownload.emit(this.download);
}
}

View File

@@ -10,26 +10,13 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Platform } from '@angular/cdk/platform';
import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component';
import { RecentVideosComponent } from 'app/components/recent-videos/recent-videos.component';
import { Download, FileType } from 'api-types';
export let audioFilesMouseHovering = false;
export let videoFilesMouseHovering = false;
export let audioFilesOpened = false;
export let videoFilesOpened = false;
export interface Download {
uid: string;
type: string;
url: string;
percent_complete: number;
downloading: boolean;
is_playlist: boolean;
error?: boolean | string;
fileNames?: string[];
complete?: boolean;
timestamp_start?: number;
timestamp_end?: number;
}
@Component({
selector: 'app-root',
templateUrl: './main.component.html',
@@ -198,16 +185,6 @@ export class MainComponent implements OnInit {
last_valid_url = '';
last_url_check = 0;
test_download: Download = {
uid: null,
type: 'audio',
percent_complete: 0,
url: 'http://youtube.com/watch?v=17848rufj',
downloading: true,
is_playlist: false,
error: false
};
argsChangedSubject: Subject<boolean> = new Subject<boolean>();
simulatedOutput = '';
@@ -411,7 +388,7 @@ export class MainComponent implements OnInit {
const urls = this.getURLArray(this.url);
for (let i = 0; i < urls.length; i++) {
const url = urls[i];
this.postsService.downloadFile(url, type, (selected_quality === '' ? null : selected_quality),
this.postsService.downloadFile(url, type as FileType, (selected_quality === '' ? null : selected_quality),
customQualityConfiguration, customArgs, additionalArgs, customOutput, youtubeUsername, youtubePassword, cropFileSettings).subscribe(res => {
this.current_download = res['download'];
this.downloads.push(res['download']);
@@ -439,7 +416,6 @@ export class MainComponent implements OnInit {
return;
}
this.downloadingfile = false;
this.current_download.downloading = false;
this.current_download = null;
}

View File

@@ -157,7 +157,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy {
});
// regular video/audio file (not playlist)
this.uids = [this.db_file['uid']];
this.type = this.db_file['isAudio'] ? 'audio' : 'video' as FileType;
this.type = this.db_file['isAudio'] ? 'audio' as FileType : 'video' as FileType;
this.parseFileNames();
});
}

View File

@@ -16,6 +16,7 @@ import {
ConfigResponse,
CreatePlaylistRequest,
CreatePlaylistResponse,
CropFileSettings,
DeleteMp3Mp4Request,
DeletePlaylistRequest,
DeleteSubscriptionFileRequest,
@@ -41,10 +42,8 @@ import {
GetUsersResponse,
LoginRequest,
LoginResponse,
Mp3DownloadRequest,
Mp3DownloadResponse,
Mp4DownloadRequest,
Mp4DownloadResponse,
DownloadRequest,
DownloadResponse,
Playlist,
RegisterRequest,
RegisterResponse,
@@ -57,7 +56,6 @@ import {
UpdaterStatus,
UnsubscribeRequest,
UnsubscribeResponse,
UpdatePlaylistFilesRequest,
UpdatePlaylistRequest,
UpdateServerRequest,
UpdateUserRequest,
@@ -231,7 +229,7 @@ export class PostsService implements CanActivate {
// tslint:disable-next-line: max-line-length
// tslint:disable-next-line: max-line-length
downloadFile(url: string, type: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings: CropFileSettings = null) {
downloadFile(url: string, type: FileType, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings: CropFileSettings = null) {
const body: DownloadRequest = {url: url,
selectedHeight: selectedQuality,
customQualityConfiguration: customQualityConfiguration,
@@ -299,7 +297,7 @@ export class PostsService implements CanActivate {
return this.http.post<SuccessObject>(this.path + 'setConfig', body, this.httpOptions);
}
deleteFile(uid: string, isAudio: boolean, blacklistMode = false) {
deleteFile(uid: string, blacklistMode = false) {
const body: DeleteMp3Mp4Request = {uid: uid, blacklistMode: blacklistMode}
return this.http.post(this.path + 'deleteFile', body, this.httpOptions);
}
@@ -392,12 +390,12 @@ export class PostsService implements CanActivate {
return this.http.post<GenerateNewApiKeyResponse>(this.path + 'generateNewAPIKey', {}, this.httpOptions);
}
enableSharing(uid: string, type: FileType, is_playlist: boolean) {
enableSharing(uid: string, is_playlist: boolean) {
const body: SharingToggle = {uid: uid, is_playlist: is_playlist};
return this.http.post<SuccessObject>(this.path + 'enableSharing', body, this.httpOptions);
}
disableSharing(uid: string, type: FileType, is_playlist: boolean) {
disableSharing(uid: string, is_playlist: boolean) {
const body: SharingToggle = {uid: uid, is_playlist: is_playlist};
return this.http.post<SuccessObject>(this.path + 'disableSharing', body, this.httpOptions);
}
@@ -434,10 +432,9 @@ export class PostsService implements CanActivate {
return this.http.post<SuccessObject>(this.path + 'deletePlaylist', body, this.httpOptions);
}
createSubscription(url, name, timerange = null, streamingOnly = false, maxQuality = 'best', audioOnly = false, customArgs: string = null, customFileOutput: string = null) {
createSubscription(url, name, timerange = null, maxQuality = 'best', audioOnly = false, customArgs: string = null, customFileOutput: string = null) {
const body: SubscribeRequest = {url: url, name: name, timerange: timerange, maxQuality: maxQuality,
streamingOnly: streamingOnly, audioOnly: audioOnly, customArgs: customArgs,
customFileOutput: customFileOutput};
audioOnly: audioOnly, customArgs: customArgs, customFileOutput: customFileOutput};
return this.http.post<SubscribeResponse>(this.path + 'subscribe', body, this.httpOptions);
}