diff --git a/Public API v1.yaml b/Public API v1.yaml index 5ebe9f3..01cdfcd 100644 --- a/Public API v1.yaml +++ b/Public API v1.yaml @@ -6,34 +6,7 @@ info: servers: - url: 'http://localhost:17442' paths: - /api/tomp3: - post: - tags: - - downloader - summary: Download audio file - description: |- - Downloads an audio file with the given URL. Will include global args if they exist. - - - HTTP requests will return once the audio file download completes. In the future, it will (by default) return once the download starts, and a separate API call will be used for checking the download status. - operationId: post-tomp3 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Mp3DownloadRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Mp3DownloadResponse' - '500': - description: Server download error - security: - - Auth query parameter: [] - /api/tomp4: + /api/downloadFile: post: tags: - downloader @@ -48,14 +21,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Mp4DownloadRequest' + $ref: '#/components/schemas/DownloadRequest' responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/Mp4DownloadResponse' + $ref: '#/components/schemas/DownloadResponse' '500': description: Server download error security: @@ -365,27 +338,6 @@ paths: $ref: '#/components/schemas/SuccessObject' security: - Auth query parameter: [] - /api/updatePlaylistFiles: - post: - tags: - - playlists - summary: Update playlist files - description: Updates the list of filenames in the playlist object - operationId: post-api-updatePlaylistFiles - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePlaylistFilesRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessObject' - security: - - Auth query parameter: [] /api/deletePlaylist: post: tags: @@ -429,7 +381,7 @@ paths: description: Whether the operation succeeded security: - Auth query parameter: [] - /api/downloadFile: + /api/downloadFileFromServer: post: tags: - files @@ -451,13 +403,13 @@ paths: post: tags: - files - summary: Delete downloaded file (unused) + summary: Delete downloaded file operationId: post-api-deleteFile requestBody: content: application/json: schema: - $ref: '#/components/schemas/DeleteFileRequest' + $ref: '#/components/schemas/DeleteMp3Mp4Request' responses: '200': description: OK @@ -861,6 +813,16 @@ components: enum: - audio - video + CropFileSettings: + type: object + required: + - cropFileStart + - cropFileEnd + properties: + cropFileStart: + type: number + cropFileEnd: + type: number Config: required: - YoutubeDLMaterial @@ -868,7 +830,7 @@ components: properties: YoutubeDLMaterial: type: object - BaseDownloadRequest: + DownloadRequest: required: - url type: object @@ -881,7 +843,10 @@ components: example: '251' customArgs: type: string - description: Custom command-line arguments for youtubedl. Overrides all other options, except url. + description: Custom command-line arguments for youtube-dl. Overrides all other options, except url. + additionalArgs: + type: string + description: Additional command-line arguments for youtube-dl. Added to whatever args would normally be used. customOutput: type: string description: Custom output filename template. @@ -891,67 +856,31 @@ components: youtubePassword: type: string description: Account password - ui_uid: + selectedHeight: type: string - nullable: true - Mp3DownloadRequest: - allOf: - - $ref: '#/components/schemas/BaseDownloadRequest' - - type: object - properties: - maxBitrate: - type: string - description: Specify ffmpeg/avconv audio quality - example: '160' - Mp4DownloadRequest: - allOf: - - $ref: '#/components/schemas/BaseDownloadRequest' - - type: object - properties: - selectedHeight: - type: string - description: Height of the video, if known - example: '1080' - BaseDownloadResponse: - required: - - uid + description: Height of the video, if known + example: '1080' + maxBitrate: + type: string + description: Specify ffmpeg/avconv audio quality + example: '160' + type: + $ref: '#/components/schemas/FileType' + cropFileSettings: + $ref: '#/components/schemas/CropFileSettings' + DownloadResponse: type: object properties: - uid: - type: string - file_names: + download: + $ref: '#/components/schemas/Download' nullable: true - type: array - items: - type: string - Mp3DownloadResponse: - allOf: - - $ref: '#/components/schemas/BaseDownloadResponse' - - type: object - required: - - audiopathEncoded - properties: - audiopathEncoded: - type: string - Mp4DownloadResponse: - allOf: - - $ref: '#/components/schemas/BaseDownloadResponse' - - type: object - required: - - videopathEncoded - properties: - videopathEncoded: - type: string GetDownloadRequest: type: object properties: - session_id: - type: string - download_id: + download_uid: type: string required: - - session_id - - download_id + - download_uid GetDownloadResponse: type: object properties: @@ -962,13 +891,9 @@ components: type: object properties: downloads: - type: object - description: Map of Session ID to inner map - additionalProperties: - type: object - description: Map of Download UID to downoad - additionalProperties: - $ref: '#/components/schemas/Download' + type: array + items: + $ref: '#/components/schemas/Download' GetMp3sResponse: required: - mp3s @@ -1038,14 +963,11 @@ components: $ref: '#/components/schemas/DatabaseFile' SharingToggle: required: - - type - uid type: object properties: uid: type: string - type: - $ref: '#/components/schemas/FileType' is_playlist: type: boolean SubscribeRequest: @@ -1061,14 +983,14 @@ components: type: string timerange: type: string - streamingOnly: - type: boolean audioOnly: type: boolean customArgs: type: string customFileOutput: type: string + maxQuality: + type: string SubscribeResponse: required: - new_sub @@ -1120,6 +1042,9 @@ components: id: type: string description: Subscription ID + name: + type: string + description: Subscription name GetSubscriptionResponse: required: - files @@ -1150,16 +1075,15 @@ components: $ref: '#/components/schemas/Subscription' CreatePlaylistRequest: required: - - fileNames + - uids - playlistName - thumbnailURL - type - - duration type: object properties: playlistName: type: string - fileNames: + uids: type: array items: type: string @@ -1167,8 +1091,6 @@ components: $ref: '#/components/schemas/FileType' thumbnailURL: type: string - duration: - type: number CreatePlaylistResponse: required: - new_playlist @@ -1181,15 +1103,17 @@ components: type: boolean GetPlaylistRequest: required: - - playlistID + - playlist_id type: object properties: - playlistID: + playlist_id: type: string type: $ref: '#/components/schemas/FileType' uuid: type: string + include_file_metadata: + type: boolean GetPlaylistResponse: required: - playlist @@ -1203,6 +1127,20 @@ components: $ref: '#/components/schemas/FileType' success: type: boolean + GetPlaylistsRequest: + type: object + properties: + include_categories: + type: boolean + GetPlaylistsResponse: + required: + - playlists + type: object + properties: + playlists: + type: array + items: + $ref: '#/components/schemas/Playlist' UpdatePlaylistRequest: required: - playlist @@ -1210,74 +1148,30 @@ components: properties: playlist: $ref: '#/components/schemas/Playlist' - UpdatePlaylistFilesRequest: - required: - - fileNames - - playlistID - - type - type: object - properties: - playlistID: - type: string - fileNames: - type: array - items: - type: string - type: - $ref: '#/components/schemas/FileType' DeletePlaylistRequest: required: - - playlistID + - playlist_id - type type: object properties: - playlistID: + playlist_id: type: string type: $ref: '#/components/schemas/FileType' DownloadFileRequest: required: - - fileNames - - type + - uid type: object properties: - fileNames: - oneOf: - - type: string - - type: array - description: Array of 1 or more files to download - items: - type: string - zip_mode: - type: boolean - type: - $ref: '#/components/schemas/FileType' - outputName: - type: string - fullPathProvided: - type: boolean - uuid: - type: string uid: type: string - id: + uuid: type: string - subscriptionName: + sub_id: type: string - description: Only used for subscriptions - subPlaylist: + is_playlist: type: boolean description: Only used for subscriptions - DeleteFileRequest: - required: - - fileName - - type - type: object - properties: - fileName: - type: string - type: - $ref: '#/components/schemas/FileType' DownloadArchiveRequest: required: - sub @@ -1406,7 +1300,7 @@ components: type: boolean Playlist: required: - - fileNames + - uids - id - name - thumbnailURL @@ -1417,7 +1311,7 @@ components: properties: name: type: string - fileNames: + uids: type: array items: type: string @@ -1431,16 +1325,22 @@ components: type: number duration: type: number + user_uid: + type: string Download: required: - - uid - - ui_uid - - downloading - - complete - url - type + - title + - type + - options + - uid + - step_index + - paused + - running + - finished_step - percent_complete - - is_playlist + - finished - timestamp_start type: object properties: @@ -1448,32 +1348,36 @@ components: type: string ui_uid: type: string - downloading: + running: type: boolean - complete: + finished: + type: boolean + paused: + type: boolean + finished_step: type: boolean url: type: string type: type: string + title: + type: string + step_index: + type: number percent_complete: type: number - is_playlist: - type: boolean timestamp_start: type: number - timestamp_end: - type: number - filesize: - type: number - nullable: true error: type: string description: Error text, set if download fails. - fileNames: - type: array - items: - type: string + nullable: true + user_uid: + type: string + sub_id: + type: string + sub_name: + type: string SubscriptionRequestData: required: - id diff --git a/backend/app.js b/backend/app.js index 97a29df..6b2ca95 100644 --- a/backend/app.js +++ b/backend/app.js @@ -1348,7 +1348,6 @@ app.post('/api/subscribe', optionalJwt, async (req, res) => { let url = req.body.url; let maxQuality = req.body.maxQuality; let timerange = req.body.timerange; - let streamingOnly = req.body.streamingOnly; let audioOnly = req.body.audioOnly; let customArgs = req.body.customArgs; let customOutput = req.body.customFileOutput; @@ -1358,7 +1357,6 @@ app.post('/api/subscribe', optionalJwt, async (req, res) => { url: url, maxQuality: maxQuality, id: uuid(), - streamingOnly: streamingOnly, user_uid: user_uid, type: audioOnly ? 'audio' : 'video' }; @@ -1554,7 +1552,7 @@ app.post('/api/getPlaylists', optionalJwt, async (req, res) => { const uuid = req.isAuthenticated() ? req.user.uid : null; const include_categories = req.body.include_categories; - const playlists = await db_api.getRecords('playlists', {user_uid: uuid}); + let playlists = await db_api.getRecords('playlists', {user_uid: uuid}); if (include_categories) { const categories = await categories_api.getCategoriesAsPlaylists(files); if (categories) { diff --git a/src/api-types/index.ts b/src/api-types/index.ts index 5a0b927..83c73a8 100644 --- a/src/api-types/index.ts +++ b/src/api-types/index.ts @@ -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'; diff --git a/src/api-types/models/BaseChangePermissionsRequest.ts b/src/api-types/models/BaseChangePermissionsRequest.ts index 6551d46..d548225 100644 --- a/src/api-types/models/BaseChangePermissionsRequest.ts +++ b/src/api-types/models/BaseChangePermissionsRequest.ts @@ -8,4 +8,4 @@ import { YesNo } from './YesNo'; export interface BaseChangePermissionsRequest { permission: UserPermission; new_value: YesNo; -} +} \ No newline at end of file diff --git a/src/api-types/models/BaseDownloadRequest.ts b/src/api-types/models/BaseDownloadRequest.ts deleted file mode 100644 index b6cf3fb..0000000 --- a/src/api-types/models/BaseDownloadRequest.ts +++ /dev/null @@ -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; -} diff --git a/src/api-types/models/BaseDownloadResponse.ts b/src/api-types/models/BaseDownloadResponse.ts deleted file mode 100644 index 83d848f..0000000 --- a/src/api-types/models/BaseDownloadResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - - -export interface BaseDownloadResponse { - uid: string; - file_names?: Array | null; -} diff --git a/src/api-types/models/ChangeRolePermissionsRequest.ts b/src/api-types/models/ChangeRolePermissionsRequest.ts index a6f6ed9..417c8ef 100644 --- a/src/api-types/models/ChangeRolePermissionsRequest.ts +++ b/src/api-types/models/ChangeRolePermissionsRequest.ts @@ -6,4 +6,4 @@ import { BaseChangePermissionsRequest } from './BaseChangePermissionsRequest'; export interface ChangeRolePermissionsRequest extends BaseChangePermissionsRequest { role: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/ChangeUserPermissionsRequest.ts b/src/api-types/models/ChangeUserPermissionsRequest.ts index e6f044a..c74dc09 100644 --- a/src/api-types/models/ChangeUserPermissionsRequest.ts +++ b/src/api-types/models/ChangeUserPermissionsRequest.ts @@ -6,4 +6,4 @@ import { BaseChangePermissionsRequest } from './BaseChangePermissionsRequest'; export interface ChangeUserPermissionsRequest extends BaseChangePermissionsRequest { user_uid: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/Config.ts b/src/api-types/models/Config.ts index 509c42f..855217a 100644 --- a/src/api-types/models/Config.ts +++ b/src/api-types/models/Config.ts @@ -5,4 +5,4 @@ export interface Config { YoutubeDLMaterial: any; -} +} \ No newline at end of file diff --git a/src/api-types/models/ConfigResponse.ts b/src/api-types/models/ConfigResponse.ts index b493361..d3ff49a 100644 --- a/src/api-types/models/ConfigResponse.ts +++ b/src/api-types/models/ConfigResponse.ts @@ -7,4 +7,4 @@ import { Config } from './Config'; export interface ConfigResponse { config_file: Config; success: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/CreatePlaylistRequest.ts b/src/api-types/models/CreatePlaylistRequest.ts index e497dff..2fef41b 100644 --- a/src/api-types/models/CreatePlaylistRequest.ts +++ b/src/api-types/models/CreatePlaylistRequest.ts @@ -6,8 +6,7 @@ import { FileType } from './FileType'; export interface CreatePlaylistRequest { playlistName: string; - fileNames: Array; + uids: Array; type: FileType; thumbnailURL: string; - duration: number; -} +} \ No newline at end of file diff --git a/src/api-types/models/CreatePlaylistResponse.ts b/src/api-types/models/CreatePlaylistResponse.ts index 7d5a98c..4cac9cf 100644 --- a/src/api-types/models/CreatePlaylistResponse.ts +++ b/src/api-types/models/CreatePlaylistResponse.ts @@ -7,4 +7,4 @@ import { Playlist } from './Playlist'; export interface CreatePlaylistResponse { new_playlist: Playlist; success: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/CropFileSettings.ts b/src/api-types/models/CropFileSettings.ts new file mode 100644 index 0000000..ec8edec --- /dev/null +++ b/src/api-types/models/CropFileSettings.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface CropFileSettings { + cropFileStart: number; + cropFileEnd: number; +} \ No newline at end of file diff --git a/src/api-types/models/DatabaseFile.ts b/src/api-types/models/DatabaseFile.ts index d6009b2..b1a17c0 100644 --- a/src/api-types/models/DatabaseFile.ts +++ b/src/api-types/models/DatabaseFile.ts @@ -19,4 +19,4 @@ export interface DatabaseFile { upload_date: string; uid: string; sharingEnabled?: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/DeleteFileRequest.ts b/src/api-types/models/DeleteFileRequest.ts deleted file mode 100644 index c64af6c..0000000 --- a/src/api-types/models/DeleteFileRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import { FileType } from './FileType'; - -export interface DeleteFileRequest { - fileName: string; - type: FileType; -} diff --git a/src/api-types/models/DeleteMp3Mp4Request.ts b/src/api-types/models/DeleteMp3Mp4Request.ts index f6d65d6..3202c4f 100644 --- a/src/api-types/models/DeleteMp3Mp4Request.ts +++ b/src/api-types/models/DeleteMp3Mp4Request.ts @@ -6,4 +6,4 @@ export interface DeleteMp3Mp4Request { uid: string; blacklistMode?: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/DeletePlaylistRequest.ts b/src/api-types/models/DeletePlaylistRequest.ts index 25830bb..76f2f81 100644 --- a/src/api-types/models/DeletePlaylistRequest.ts +++ b/src/api-types/models/DeletePlaylistRequest.ts @@ -5,6 +5,6 @@ import { FileType } from './FileType'; export interface DeletePlaylistRequest { - playlistID: string; + playlist_id: string; type: FileType; -} +} \ No newline at end of file diff --git a/src/api-types/models/DeleteSubscriptionFileRequest.ts b/src/api-types/models/DeleteSubscriptionFileRequest.ts index aebe91b..7a166a9 100644 --- a/src/api-types/models/DeleteSubscriptionFileRequest.ts +++ b/src/api-types/models/DeleteSubscriptionFileRequest.ts @@ -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; -} +} \ No newline at end of file diff --git a/src/api-types/models/DeleteUserRequest.ts b/src/api-types/models/DeleteUserRequest.ts index a994369..15a1d09 100644 --- a/src/api-types/models/DeleteUserRequest.ts +++ b/src/api-types/models/DeleteUserRequest.ts @@ -5,4 +5,4 @@ export interface DeleteUserRequest { uid: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/Download.ts b/src/api-types/models/Download.ts index b4d91d9..d91dd00 100644 --- a/src/api-types/models/Download.ts +++ b/src/api-types/models/Download.ts @@ -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; -} + error?: string | null; + user_uid?: string; + sub_id?: string; + sub_name?: string; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadArchiveRequest.ts b/src/api-types/models/DownloadArchiveRequest.ts index 46c5c45..857910c 100644 --- a/src/api-types/models/DownloadArchiveRequest.ts +++ b/src/api-types/models/DownloadArchiveRequest.ts @@ -5,6 +5,6 @@ export interface DownloadArchiveRequest { sub: { - archive_dir: string, - }; -} +archive_dir: string, +}; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadFileRequest.ts b/src/api-types/models/DownloadFileRequest.ts index 61816c9..0bee9d2 100644 --- a/src/api-types/models/DownloadFileRequest.ts +++ b/src/api-types/models/DownloadFileRequest.ts @@ -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; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadRequest.ts b/src/api-types/models/DownloadRequest.ts new file mode 100644 index 0000000..5c6da09 --- /dev/null +++ b/src/api-types/models/DownloadRequest.ts @@ -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; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadResponse.ts b/src/api-types/models/DownloadResponse.ts new file mode 100644 index 0000000..5450cfd --- /dev/null +++ b/src/api-types/models/DownloadResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Download } from './Download'; + +export interface DownloadResponse { + download?: Download | null; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadVideosForSubscriptionRequest.ts b/src/api-types/models/DownloadVideosForSubscriptionRequest.ts index 4b64af3..31d0c6d 100644 --- a/src/api-types/models/DownloadVideosForSubscriptionRequest.ts +++ b/src/api-types/models/DownloadVideosForSubscriptionRequest.ts @@ -5,4 +5,4 @@ export interface DownloadVideosForSubscriptionRequest { subID: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/File.ts b/src/api-types/models/File.ts index 2e81613..5114e53 100644 --- a/src/api-types/models/File.ts +++ b/src/api-types/models/File.ts @@ -5,4 +5,4 @@ export interface File { id?: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/GenerateNewApiKeyResponse.ts b/src/api-types/models/GenerateNewApiKeyResponse.ts index d96a464..378a642 100644 --- a/src/api-types/models/GenerateNewApiKeyResponse.ts +++ b/src/api-types/models/GenerateNewApiKeyResponse.ts @@ -5,4 +5,4 @@ export interface GenerateNewApiKeyResponse { new_api_key: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetAllDownloadsResponse.ts b/src/api-types/models/GetAllDownloadsResponse.ts index 1f99a85..5367f56 100644 --- a/src/api-types/models/GetAllDownloadsResponse.ts +++ b/src/api-types/models/GetAllDownloadsResponse.ts @@ -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>; -} + downloads?: Array; +} \ No newline at end of file diff --git a/src/api-types/models/GetAllFilesResponse.ts b/src/api-types/models/GetAllFilesResponse.ts index 79f7fc6..d067555 100644 --- a/src/api-types/models/GetAllFilesResponse.ts +++ b/src/api-types/models/GetAllFilesResponse.ts @@ -11,4 +11,4 @@ export interface GetAllFilesResponse { * All video playlists */ playlists: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetAllSubscriptionsResponse.ts b/src/api-types/models/GetAllSubscriptionsResponse.ts index fafb6f5..485d0cd 100644 --- a/src/api-types/models/GetAllSubscriptionsResponse.ts +++ b/src/api-types/models/GetAllSubscriptionsResponse.ts @@ -6,4 +6,4 @@ import { Subscription } from './Subscription'; export interface GetAllSubscriptionsResponse { subscriptions: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetDownloadRequest.ts b/src/api-types/models/GetDownloadRequest.ts index 9ad5fdf..49f102a 100644 --- a/src/api-types/models/GetDownloadRequest.ts +++ b/src/api-types/models/GetDownloadRequest.ts @@ -4,6 +4,5 @@ export interface GetDownloadRequest { - session_id: string; - download_id: string; -} + download_uid: string; +} \ No newline at end of file diff --git a/src/api-types/models/GetDownloadResponse.ts b/src/api-types/models/GetDownloadResponse.ts index b027cbf..029e21f 100644 --- a/src/api-types/models/GetDownloadResponse.ts +++ b/src/api-types/models/GetDownloadResponse.ts @@ -6,4 +6,4 @@ import { Download } from './Download'; export interface GetDownloadResponse { download?: Download | null; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetFileRequest.ts b/src/api-types/models/GetFileRequest.ts index 0d85afb..3bb14b1 100644 --- a/src/api-types/models/GetFileRequest.ts +++ b/src/api-types/models/GetFileRequest.ts @@ -14,4 +14,4 @@ export interface GetFileRequest { * User UID */ uuid?: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetFileResponse.ts b/src/api-types/models/GetFileResponse.ts index 71b3563..df78e28 100644 --- a/src/api-types/models/GetFileResponse.ts +++ b/src/api-types/models/GetFileResponse.ts @@ -7,4 +7,4 @@ import { DatabaseFile } from './DatabaseFile'; export interface GetFileResponse { success: boolean; file?: DatabaseFile; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetMp3sResponse.ts b/src/api-types/models/GetMp3sResponse.ts index 13f03dc..23a80d7 100644 --- a/src/api-types/models/GetMp3sResponse.ts +++ b/src/api-types/models/GetMp3sResponse.ts @@ -11,4 +11,4 @@ export interface GetMp3sResponse { * All audio playlists */ playlists: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetMp4sResponse.ts b/src/api-types/models/GetMp4sResponse.ts index 9ef2c1f..06e1f98 100644 --- a/src/api-types/models/GetMp4sResponse.ts +++ b/src/api-types/models/GetMp4sResponse.ts @@ -11,4 +11,4 @@ export interface GetMp4sResponse { * All video playlists */ playlists: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetPlaylistRequest.ts b/src/api-types/models/GetPlaylistRequest.ts index ca86a2d..9a48a9b 100644 --- a/src/api-types/models/GetPlaylistRequest.ts +++ b/src/api-types/models/GetPlaylistRequest.ts @@ -5,7 +5,8 @@ import { FileType } from './FileType'; export interface GetPlaylistRequest { - playlistID: string; + playlist_id: string; type?: FileType; uuid?: string; -} + include_file_metadata?: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/GetPlaylistResponse.ts b/src/api-types/models/GetPlaylistResponse.ts index c3bf7c9..afe4184 100644 --- a/src/api-types/models/GetPlaylistResponse.ts +++ b/src/api-types/models/GetPlaylistResponse.ts @@ -9,4 +9,4 @@ export interface GetPlaylistResponse { playlist: Playlist; type: FileType; success: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetPlaylistsRequest.ts b/src/api-types/models/GetPlaylistsRequest.ts new file mode 100644 index 0000000..2693d19 --- /dev/null +++ b/src/api-types/models/GetPlaylistsRequest.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetPlaylistsRequest { + include_categories?: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/GetPlaylistsResponse.ts b/src/api-types/models/GetPlaylistsResponse.ts new file mode 100644 index 0000000..e01f586 --- /dev/null +++ b/src/api-types/models/GetPlaylistsResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Playlist } from './Playlist'; + +export interface GetPlaylistsResponse { + playlists: Array; +} \ No newline at end of file diff --git a/src/api-types/models/GetRolesResponse.ts b/src/api-types/models/GetRolesResponse.ts index ce5e696..2209ec4 100644 --- a/src/api-types/models/GetRolesResponse.ts +++ b/src/api-types/models/GetRolesResponse.ts @@ -6,11 +6,11 @@ import { UserPermission } from './UserPermission'; export interface GetRolesResponse { roles: { - admin?: { - permissions?: Array, - }, - user?: { - permissions?: Array, - }, - }; -} +admin?: { +permissions?: Array, +}, +user?: { +permissions?: Array, +}, +}; +} \ No newline at end of file diff --git a/src/api-types/models/GetSubscriptionRequest.ts b/src/api-types/models/GetSubscriptionRequest.ts index 99ee221..c11c5fa 100644 --- a/src/api-types/models/GetSubscriptionRequest.ts +++ b/src/api-types/models/GetSubscriptionRequest.ts @@ -8,4 +8,8 @@ export interface GetSubscriptionRequest { * Subscription ID */ id: string; -} + /** + * Subscription name + */ + name?: string; +} \ No newline at end of file diff --git a/src/api-types/models/GetSubscriptionResponse.ts b/src/api-types/models/GetSubscriptionResponse.ts index 9d2209a..0efb102 100644 --- a/src/api-types/models/GetSubscriptionResponse.ts +++ b/src/api-types/models/GetSubscriptionResponse.ts @@ -7,4 +7,4 @@ import { Subscription } from './Subscription'; export interface GetSubscriptionResponse { subscription: Subscription; files: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/GetUsersResponse.ts b/src/api-types/models/GetUsersResponse.ts index f5f9eb0..2f17953 100644 --- a/src/api-types/models/GetUsersResponse.ts +++ b/src/api-types/models/GetUsersResponse.ts @@ -6,4 +6,4 @@ import { User } from './User'; export interface GetUsersResponse { users: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/LoginRequest.ts b/src/api-types/models/LoginRequest.ts index a06327f..2e99447 100644 --- a/src/api-types/models/LoginRequest.ts +++ b/src/api-types/models/LoginRequest.ts @@ -6,4 +6,4 @@ export interface LoginRequest { username: string; password: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/LoginResponse.ts b/src/api-types/models/LoginResponse.ts index c94f444..7f5c42d 100644 --- a/src/api-types/models/LoginResponse.ts +++ b/src/api-types/models/LoginResponse.ts @@ -10,4 +10,4 @@ export interface LoginResponse { token?: string; permissions?: Array; available_permissions?: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/Mp3DownloadRequest.ts b/src/api-types/models/Mp3DownloadRequest.ts deleted file mode 100644 index b4b4f8f..0000000 --- a/src/api-types/models/Mp3DownloadRequest.ts +++ /dev/null @@ -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; -} diff --git a/src/api-types/models/Mp3DownloadResponse.ts b/src/api-types/models/Mp3DownloadResponse.ts deleted file mode 100644 index 32924a6..0000000 --- a/src/api-types/models/Mp3DownloadResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import { BaseDownloadResponse } from './BaseDownloadResponse'; - -export interface Mp3DownloadResponse extends BaseDownloadResponse { - audiopathEncoded: string; -} diff --git a/src/api-types/models/Mp4DownloadRequest.ts b/src/api-types/models/Mp4DownloadRequest.ts deleted file mode 100644 index faeb6ab..0000000 --- a/src/api-types/models/Mp4DownloadRequest.ts +++ /dev/null @@ -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; -} diff --git a/src/api-types/models/Mp4DownloadResponse.ts b/src/api-types/models/Mp4DownloadResponse.ts deleted file mode 100644 index 0763c07..0000000 --- a/src/api-types/models/Mp4DownloadResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import { BaseDownloadResponse } from './BaseDownloadResponse'; - -export interface Mp4DownloadResponse extends BaseDownloadResponse { - videopathEncoded: string; -} diff --git a/src/api-types/models/Playlist.ts b/src/api-types/models/Playlist.ts index 1afe993..7741f41 100644 --- a/src/api-types/models/Playlist.ts +++ b/src/api-types/models/Playlist.ts @@ -6,10 +6,11 @@ import { FileType } from './FileType'; export interface Playlist { name: string; - fileNames: Array; + uids: Array; id: string; thumbnailURL: string; type: FileType; registered: number; duration: number; -} + user_uid?: string; +} \ No newline at end of file diff --git a/src/api-types/models/RegisterRequest.ts b/src/api-types/models/RegisterRequest.ts index 73bee22..87b7f0f 100644 --- a/src/api-types/models/RegisterRequest.ts +++ b/src/api-types/models/RegisterRequest.ts @@ -7,4 +7,4 @@ export interface RegisterRequest { userid: string; username: string; password: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/RegisterResponse.ts b/src/api-types/models/RegisterResponse.ts index 4e45b65..5aaa76a 100644 --- a/src/api-types/models/RegisterResponse.ts +++ b/src/api-types/models/RegisterResponse.ts @@ -6,4 +6,4 @@ import { User } from './User'; export interface RegisterResponse { user?: User; -} +} \ No newline at end of file diff --git a/src/api-types/models/SetConfigRequest.ts b/src/api-types/models/SetConfigRequest.ts index 41ef52a..f307009 100644 --- a/src/api-types/models/SetConfigRequest.ts +++ b/src/api-types/models/SetConfigRequest.ts @@ -6,4 +6,4 @@ import { Config } from './Config'; export interface SetConfigRequest { new_config_file: Config; -} +} \ No newline at end of file diff --git a/src/api-types/models/SharingToggle.ts b/src/api-types/models/SharingToggle.ts index 2de90fc..5acba30 100644 --- a/src/api-types/models/SharingToggle.ts +++ b/src/api-types/models/SharingToggle.ts @@ -2,10 +2,8 @@ /* tslint:disable */ /* eslint-disable */ -import { FileType } from './FileType'; export interface SharingToggle { uid: string; - type: FileType; is_playlist?: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/SubscribeRequest.ts b/src/api-types/models/SubscribeRequest.ts index d475cb9..2cca0df 100644 --- a/src/api-types/models/SubscribeRequest.ts +++ b/src/api-types/models/SubscribeRequest.ts @@ -7,8 +7,8 @@ export interface SubscribeRequest { name: string; url: string; timerange?: string; - streamingOnly: boolean; audioOnly?: boolean; customArgs?: string; customFileOutput?: string; -} + maxQuality?: string; +} \ No newline at end of file diff --git a/src/api-types/models/SubscribeResponse.ts b/src/api-types/models/SubscribeResponse.ts index fa4c235..a1f1331 100644 --- a/src/api-types/models/SubscribeResponse.ts +++ b/src/api-types/models/SubscribeResponse.ts @@ -7,4 +7,4 @@ import { Subscription } from './Subscription'; export interface SubscribeResponse { new_sub: Subscription; error?: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/Subscription.ts b/src/api-types/models/Subscription.ts index 8cd369e..1184827 100644 --- a/src/api-types/models/Subscription.ts +++ b/src/api-types/models/Subscription.ts @@ -17,4 +17,4 @@ export interface Subscription { custom_args?: string; custom_output?: string; videos: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/SubscriptionRequestData.ts b/src/api-types/models/SubscriptionRequestData.ts index 6c99499..056ff28 100644 --- a/src/api-types/models/SubscriptionRequestData.ts +++ b/src/api-types/models/SubscriptionRequestData.ts @@ -10,4 +10,4 @@ export interface SubscriptionRequestData { type?: FileType; isPlaylist?: boolean; archive?: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/SuccessObject.ts b/src/api-types/models/SuccessObject.ts index cd0a11e..f59e3fa 100644 --- a/src/api-types/models/SuccessObject.ts +++ b/src/api-types/models/SuccessObject.ts @@ -5,4 +5,4 @@ export interface SuccessObject { success: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/UnsubscribeRequest.ts b/src/api-types/models/UnsubscribeRequest.ts index 598faee..1ee72e3 100644 --- a/src/api-types/models/UnsubscribeRequest.ts +++ b/src/api-types/models/UnsubscribeRequest.ts @@ -10,4 +10,4 @@ export interface UnsubscribeRequest { * Defaults to false */ deleteMode?: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/UnsubscribeResponse.ts b/src/api-types/models/UnsubscribeResponse.ts index 0f0d991..1d43b7b 100644 --- a/src/api-types/models/UnsubscribeResponse.ts +++ b/src/api-types/models/UnsubscribeResponse.ts @@ -6,4 +6,4 @@ export interface UnsubscribeResponse { success: boolean; error?: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/UpdatePlaylistFilesRequest.ts b/src/api-types/models/UpdatePlaylistFilesRequest.ts deleted file mode 100644 index 3fa95c2..0000000 --- a/src/api-types/models/UpdatePlaylistFilesRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import { FileType } from './FileType'; - -export interface UpdatePlaylistFilesRequest { - playlistID: string; - fileNames: Array; - type: FileType; -} diff --git a/src/api-types/models/UpdatePlaylistRequest.ts b/src/api-types/models/UpdatePlaylistRequest.ts index 1eaee52..38f98ac 100644 --- a/src/api-types/models/UpdatePlaylistRequest.ts +++ b/src/api-types/models/UpdatePlaylistRequest.ts @@ -6,4 +6,4 @@ import { Playlist } from './Playlist'; export interface UpdatePlaylistRequest { playlist: Playlist; -} +} \ No newline at end of file diff --git a/src/api-types/models/UpdateServerRequest.ts b/src/api-types/models/UpdateServerRequest.ts index 95db6e4..8c616f6 100644 --- a/src/api-types/models/UpdateServerRequest.ts +++ b/src/api-types/models/UpdateServerRequest.ts @@ -5,4 +5,4 @@ export interface UpdateServerRequest { tag: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/UpdateUserRequest.ts b/src/api-types/models/UpdateUserRequest.ts index c6e2f05..19e32c8 100644 --- a/src/api-types/models/UpdateUserRequest.ts +++ b/src/api-types/models/UpdateUserRequest.ts @@ -5,8 +5,8 @@ export interface UpdateUserRequest { change_object: { - uid: string, - name?: string, - role?: string, - }; -} +uid: string, +name?: string, +role?: string, +}; +} \ No newline at end of file diff --git a/src/api-types/models/UpdaterStatus.ts b/src/api-types/models/UpdaterStatus.ts index 19e513c..8db6a17 100644 --- a/src/api-types/models/UpdaterStatus.ts +++ b/src/api-types/models/UpdaterStatus.ts @@ -7,4 +7,4 @@ export interface UpdaterStatus { updating: boolean; details: string; error?: boolean; -} +} \ No newline at end of file diff --git a/src/api-types/models/User.ts b/src/api-types/models/User.ts index 8a49d3c..0568e06 100644 --- a/src/api-types/models/User.ts +++ b/src/api-types/models/User.ts @@ -10,16 +10,16 @@ export interface User { name?: string; passhash?: string; files?: { - audio?: Array, - video?: Array, - }; +audio?: Array, +video?: Array, +}; playlists?: { - audio?: Array, - video?: Array, - }; +audio?: Array, +video?: Array, +}; subscriptions?: Array; created?: number; role?: string; permissions?: Array; permission_overrides?: Array; -} +} \ No newline at end of file diff --git a/src/api-types/models/body_19.ts b/src/api-types/models/body_19.ts index b0ce9cb..c7f8fb8 100644 --- a/src/api-types/models/body_19.ts +++ b/src/api-types/models/body_19.ts @@ -5,4 +5,4 @@ export interface body_19 { input_pin: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/body_20.ts b/src/api-types/models/body_20.ts index 84a7b47..559ea14 100644 --- a/src/api-types/models/body_20.ts +++ b/src/api-types/models/body_20.ts @@ -5,4 +5,4 @@ export interface body_20 { unhashed_pin: string; -} +} \ No newline at end of file diff --git a/src/api-types/models/inline_response_200_15.ts b/src/api-types/models/inline_response_200_15.ts index bb98ac6..7147a1e 100644 --- a/src/api-types/models/inline_response_200_15.ts +++ b/src/api-types/models/inline_response_200_15.ts @@ -5,4 +5,4 @@ export interface inline_response_200_15 { is_set: boolean; -} +} \ No newline at end of file diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9277a4f..7b26e63 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -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, diff --git a/src/app/dialogs/subscribe-dialog/subscribe-dialog.component.ts b/src/app/dialogs/subscribe-dialog/subscribe-dialog.component.ts index 0d3ab68..916b5f9 100644 --- a/src/app/dialogs/subscribe-dialog/subscribe-dialog.component.ts +++ b/src/app/dialogs/subscribe-dialog/subscribe-dialog.component.ts @@ -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']) { diff --git a/src/app/download-item/download-item.component.html b/src/app/download-item/download-item.component.html deleted file mode 100644 index 07d4310..0000000 --- a/src/app/download-item/download-item.component.html +++ /dev/null @@ -1,41 +0,0 @@ -
- - -
ID: {{url_id ? url_id : download.uid}}
-
- - - done - error - - - - -
- - -
- Details -
-
-
- {{download.timestamp_start | date:'medium'}} -
-
-
-
- An error has occurred: -
- {{download.error}} -
-
- Download start: {{download.timestamp_start | date:'medium'}} -
-
- Download end: {{download.timestamp_end | date:'medium'}} -
-
- File path(s): {{download.fileNames.join(', ')}} -
-
-
\ No newline at end of file diff --git a/src/app/download-item/download-item.component.scss b/src/app/download-item/download-item.component.scss deleted file mode 100644 index f28a49f..0000000 --- a/src/app/download-item/download-item.component.scss +++ /dev/null @@ -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; -} diff --git a/src/app/download-item/download-item.component.spec.ts b/src/app/download-item/download-item.component.spec.ts deleted file mode 100644 index 7baea1e..0000000 --- a/src/app/download-item/download-item.component.spec.ts +++ /dev/null @@ -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; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [ DownloadItemComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DownloadItemComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/download-item/download-item.component.ts b/src/app/download-item/download-item.component.ts deleted file mode 100644 index 5803afd..0000000 --- a/src/app/download-item/download-item.component.ts +++ /dev/null @@ -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(); - - @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); - } - -} diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index de787ca..08906bd 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -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 = new Subject(); 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; } diff --git a/src/app/player/player.component.ts b/src/app/player/player.component.ts index d87c858..fb40ed1 100644 --- a/src/app/player/player.component.ts +++ b/src/app/player/player.component.ts @@ -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(); }); } diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index fd81f73..56cc403 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -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(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(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(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(this.path + 'disableSharing', body, this.httpOptions); } @@ -434,10 +432,9 @@ export class PostsService implements CanActivate { return this.http.post(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(this.path + 'subscribe', body, this.httpOptions); }