Added missing routes to API

Changed getDBInfo from post to get request
pull/218/head
Isaac Abadi 4 years ago
parent 94006ef794
commit c5db1d30e2

@ -33,6 +33,27 @@ paths:
description: Server download error description: Server download error
security: security:
- Auth query parameter: [] - Auth query parameter: []
/api/generateArgs:
post:
tags:
- downloader
summary: Download video file
description: Generates args, used for checking what args would run if you ran downloadFile
operationId: post-generateArgs
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DownloadRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateArgsResponse'
security:
- Auth query parameter: []
/api/getMp3s: /api/getMp3s:
get: get:
tags: tags:
@ -148,6 +169,27 @@ paths:
$ref: '#/components/schemas/SuccessObject' $ref: '#/components/schemas/SuccessObject'
security: security:
- Auth query parameter: [] - Auth query parameter: []
/api/incrementViewCount:
post:
summary: Increments a file's view count
tags:
- files
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IncrementViewCountRequest'
operationId: post-api-incrementViewCount
description: Increments a file's view count
security:
- Auth query parameter: []
/api/subscribe: /api/subscribe:
post: post:
tags: tags:
@ -359,6 +401,27 @@ paths:
$ref: '#/components/schemas/SuccessObject' $ref: '#/components/schemas/SuccessObject'
security: security:
- Auth query parameter: [] - Auth query parameter: []
/api/addFileToPlaylist:
post:
tags:
- playlists
summary: Adds a file to a playlist
description: Adds a file to a playlist
operationId: post-api-addFileToPlaylist
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AddFileToPlaylistRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
security:
- Auth query parameter: []
/api/deleteMp4: /api/deleteMp4:
post: post:
tags: tags:
@ -487,48 +550,6 @@ paths:
$ref: '#/components/schemas/inline_response_200_15' $ref: '#/components/schemas/inline_response_200_15'
security: security:
- Auth query parameter: [] - Auth query parameter: []
/api/checkPin:
post:
tags:
- security
summary: Check if pin is correct
description: Checks the pin against an inputted one. Will return true if they match
operationId: post-api-checkPin
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/body_19'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
security:
- Auth query parameter: []
/api/setPin:
post:
tags:
- security
summary: Set pin
operationId: post-api-setPin
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/body_20'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
security:
- Auth query parameter: []
description: ''
/api/generateNewAPIKey: /api/generateNewAPIKey:
post: post:
tags: tags:
@ -604,7 +625,7 @@ paths:
security: security:
- Auth query parameter: [] - Auth query parameter: []
/api/downloads: /api/downloads:
get: post:
summary: Get info for all downloads summary: Get info for all downloads
tags: tags:
- downloader - downloader
@ -615,7 +636,12 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/GetAllDownloadsResponse' $ref: '#/components/schemas/GetAllDownloadsResponse'
operationId: get-api-downloads requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllDownloadsRequest'
operationId: post-api-downloads
description: Retrieves all downloads recorded by the server and their status. description: Retrieves all downloads recorded by the server and their status.
security: security:
- Auth query parameter: [] - Auth query parameter: []
@ -799,6 +825,299 @@ paths:
- Auth query parameter: [] - Auth query parameter: []
tags: tags:
- multi-user mode - multi-user mode
/api/versionInfo:
get:
tags:
- server
summary: Gets server version info
operationId: get-api-versionInfo
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/VersionInfoResponse'
security:
- Auth query parameter: []
/api/getLogs:
post:
summary: Gets logs from server
tags:
- server
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetLogsResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetLogsRequest'
operationId: post-api-getLogs
description: Gets logs from server
security:
- Auth query parameter: []
/api/clearAllLogs:
post:
summary: Clears the log file
tags:
- server
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
operationId: post-api-clearAllLogs
description: Clears the log file
security:
- Auth query parameter: []
/api/getDBInfo:
get:
tags:
- db
summary: Gets information on the DB
operationId: get-api-getDBInfo
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DBInfoResponse'
security:
- Auth query parameter: []
/api/transferDB:
post:
summary: Transfers DB between Local and MongoDB
tags:
- db
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TransferDBResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TransferDBRequest'
operationId: post-api-transferDB
description: Initiates a transfer between Local and MongoDB. Connection string must be set.
security:
- Auth query parameter: []
/api/testConnectionString:
post:
summary: Tests a MongoDB connection string
tags:
- db
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TestConnectionStringResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TestConnectionStringRequest'
operationId: post-api-testConnectionString
description: Tests a MongoDB connection string and returns an error if one exists.
security:
- Auth query parameter: []
/api/getFullTwitchChat:
post:
summary: Gets the downloaded Twitch Chat (VODs only)
tags:
- twitch
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetFullTwitchChatResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetFullTwitchChatRequest'
operationId: post-api-getFullTwitchChat
description: Gets the downloaded Twitch Chat (VODs only)
security:
- Auth query parameter: []
/api/downloadTwitchChatByVODID:
post:
summary: Downloads Twitch Chat for a VOD
tags:
- twitch
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DownloadTwitchChatByVODIDResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DownloadTwitchChatByVODIDRequest'
operationId: post-api-downloadTwitchChatByVODID
description: Downloads Twitch Chat for a VOD
security:
- Auth query parameter: []
/api/checkConcurrentStream:
post:
summary: Checks status of a concurrent stream
tags:
- player
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CheckConcurrentStreamResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CheckConcurrentStreamRequest'
operationId: post-api-checkConcurrentStream
description: Checks status of a concurrent stream
security:
- Auth query parameter: []
/api/updateConcurrentStream:
post:
summary: Updates a concurrent stream
tags:
- player
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateConcurrentStreamResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateConcurrentStreamRequest'
operationId: post-api-updateConcurrentStream
description: Updates a concurrent stream
security:
- Auth query parameter: []
/api/getAllCategories:
post:
summary: Gets all categories
tags:
- categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllCategoriesResponse'
operationId: post-api-getAllCategories
description: Gets all categories
security:
- Auth query parameter: []
/api/createCategory:
post:
summary: Creates a category
tags:
- categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCategoryResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCategoryRequest'
operationId: post-api-createCategory
description: Creates a category
security:
- Auth query parameter: []
/api/deleteCategory:
post:
summary: Deletes a category
tags:
- categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteCategoryRequest'
operationId: post-api-deleteCategory
description: Deletes a category
security:
- Auth query parameter: []
/api/updateCategory:
post:
summary: Updates a category
tags:
- categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCategoryRequest'
operationId: post-api-updateCategory
description: Updates a category
security:
- Auth query parameter: []
/api/updateCategories:
post:
summary: Updates all categories
tags:
- categories
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessObject'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCategoriesRequest'
operationId: post-api-updateCategories
description: Updates all categories
security:
- Auth query parameter: []
components: components:
schemas: schemas:
SuccessObject: SuccessObject:
@ -874,6 +1193,13 @@ components:
download: download:
$ref: '#/components/schemas/Download' $ref: '#/components/schemas/Download'
nullable: true nullable: true
GenerateArgsResponse:
type: object
properties:
args:
type: array
items:
type: string
GetDownloadRequest: GetDownloadRequest:
type: object type: object
properties: properties:
@ -887,6 +1213,15 @@ components:
download: download:
$ref: '#/components/schemas/Download' $ref: '#/components/schemas/Download'
nullable: true nullable: true
GetAllDownloadsRequest:
type: object
properties:
uids:
type: array
items:
type: string
description: Filters downloads with the array
nullable: true
GetAllDownloadsResponse: GetAllDownloadsResponse:
type: object type: object
properties: properties:
@ -1159,8 +1494,6 @@ components:
type: type:
$ref: '#/components/schemas/FileType' $ref: '#/components/schemas/FileType'
DownloadFileRequest: DownloadFileRequest:
required:
- uid
type: object type: object
properties: properties:
uid: uid:
@ -1169,9 +1502,8 @@ components:
type: string type: string
sub_id: sub_id:
type: string type: string
is_playlist: playlist_id:
type: boolean type: string
description: Only used for subscriptions
DownloadArchiveRequest: DownloadArchiveRequest:
required: required:
- sub - sub
@ -1203,6 +1535,264 @@ components:
properties: properties:
tag: tag:
type: string type: string
DBInfoResponse:
required:
- db_info
type: object
properties:
using_local_db:
type: boolean
stats_by_table:
type: object
properties:
files:
$ref: '#/components/schemas/TableInfo'
playlists:
$ref: '#/components/schemas/TableInfo'
categories:
$ref: '#/components/schemas/TableInfo'
subscriptions:
$ref: '#/components/schemas/TableInfo'
users:
$ref: '#/components/schemas/TableInfo'
roles:
$ref: '#/components/schemas/TableInfo'
download_queue:
$ref: '#/components/schemas/TableInfo'
TransferDBResponse:
required:
- success
type: object
properties:
success:
type: boolean
error:
type: string
TransferDBRequest:
required:
- local_to_remote
type: object
properties:
local_to_remote:
description: True if transfering DB from Local to MongoDB, false if transferring DB from MongoDB to Local
type: boolean
TestConnectionStringResponse:
required:
- success
type: object
properties:
success:
type: boolean
error:
type: string
TestConnectionStringRequest:
required:
- connection_string
type: object
properties:
connection_string:
description: MongoDB connection string
type: string
GetFullTwitchChatResponse:
required:
- success
type: object
properties:
success:
type: boolean
error:
type: string
GetFullTwitchChatRequest:
required:
- id
- type
type: object
properties:
id:
description: File ID
type: string
type:
$ref: '#/components/schemas/FileType'
uuid:
description: User UID
type: string
sub:
description: Subscription
$ref: '#/components/schemas/Subscription'
DownloadTwitchChatByVODIDResponse:
required:
- chat
type: object
properties:
chat:
type: array
items:
$ref: '#/components/schemas/TwitchChatMessage'
DownloadTwitchChatByVODIDRequest:
required:
- id
- type
- vodId
type: object
properties:
id:
description: File ID
type: string
vodId:
description: ID of the VOD
type: string
type:
$ref: '#/components/schemas/FileType'
uuid:
description: User UID
type: string
sub:
description: Subscription
$ref: '#/components/schemas/Subscription'
CheckConcurrentStreamResponse:
required:
- stream
type: object
properties:
stream:
$ref: '#/components/schemas/ConcurrentStream'
CheckConcurrentStreamRequest:
required:
- uid
type: object
properties:
uid:
description: UID of the concurrent stream
type: string
UpdateConcurrentStreamResponse:
required:
- stream
type: object
properties:
stream:
$ref: '#/components/schemas/ConcurrentStream'
UpdateConcurrentStreamRequest:
allOf:
- $ref: '#/components/schemas/ConcurrentStream'
- type: object
properties:
uid:
type: string
description: Concurrent stream UID
required:
- uid
GetLogsResponse:
type: object
properties:
logs:
type: string
description: Number of lines to retrieve from the bottom
success:
type: boolean
GetLogsRequest:
required:
- connection_string
type: object
properties:
lines:
type: number
GetFileFormatsRequest:
type: object
properties:
url:
type: string
GetFileFormatsResponse:
required:
- result
- success
type: object
properties:
success:
type: boolean
result:
allOf:
- $ref: '#/components/schemas/file'
- type: object
properties:
formats:
type: array
items:
type: object
IncrementViewCountRequest:
required:
- file_uid
type: object
properties:
file_uid:
type: string
sub_id:
type: string
uuid:
type: string
description: User UID
AddFileToPlaylistRequest:
required:
- playlist_id
- file_uid
type: object
properties:
file_uid:
type: string
playlist_id:
type: string
GetAllCategoriesResponse:
required:
- categories
type: object
properties:
categories:
type: array
items:
$ref: '#/components/schemas/Category'
CreateCategoryResponse:
type: object
properties:
new_category:
$ref: '#/components/schemas/Category'
success:
type: boolean
CreateCategoryRequest:
required:
- name
type: object
properties:
name:
type: string
DeleteCategoryRequest:
required:
- category_uid
type: object
properties:
category_uid:
type: string
UpdateCategoryRequest:
required:
- category
type: object
properties:
category:
$ref: '#/components/schemas/Category'
UpdateCategoriesRequest:
required:
- categories
type: object
properties:
categories:
type: array
items:
$ref: '#/components/schemas/Category'
VersionInfoResponse:
required:
- version_info
type: object
properties:
version_info:
$ref: '#/components/schemas/Version'
inline_response_200_15: inline_response_200_15:
required: required:
- is_set - is_set
@ -1495,6 +2085,83 @@ components:
enum: enum:
- 'yes' - 'yes'
- 'no' - 'no'
TableInfo:
type: object
properties:
records_count:
type: number
TwitchChatMessage:
type: object
properties:
created_at:
type: string
content_offset_seconds:
type: number
commenter:
type: object
properties:
name:
type: string
_id:
type: string
created_at:
type: string
message:
type: object
properties:
body:
type: string
user_color:
type: string
ConcurrentStream:
type: object
properties:
playback_timestamp:
type: number
unix_timestamp:
type: number
playing:
type: boolean
Category:
type: object
properties:
name:
type: string
uid:
type: string
rules:
type: array
items:
$ref: '#/components/schemas/CategoryRule'
custom_output:
type: string
description: Overrides file output for downloaded files in category
CategoryRule:
type: object
properties:
preceding_operator:
type: string
enum:
- 'or'
- 'and'
comparator:
type: string
enum:
- 'includes'
- 'not_includes'
- 'equals'
- 'not_equals'
Version:
type: object
properties:
type:
type: string
tag:
type: string
commit:
type: string
date:
type: string
BaseChangePermissionsRequest: BaseChangePermissionsRequest:
required: required:
- permission - permission

@ -950,7 +950,7 @@ app.post('/api/restartServer', optionalJwt, (req, res) => {
res.send({success: true}); res.send({success: true});
}); });
app.post('/api/getDBInfo', optionalJwt, async (req, res) => { app.get('/api/getDBInfo', optionalJwt, async (req, res) => {
const db_info = await db_api.getDBStats(); const db_info = await db_api.getDBStats();
res.send({db_info: db_info}); res.send({db_info: db_info});
}); });

7
package-lock.json generated

@ -13767,6 +13767,13 @@
"integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==", "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==",
"dev": true "dev": true
}, },
"uglify-js": {
"version": "3.14.2",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz",
"integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==",
"dev": true,
"optional": true
},
"unicode-canonical-property-names-ecmascript": { "unicode-canonical-property-names-ecmascript": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",

@ -2,17 +2,27 @@
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
export type { AddFileToPlaylistRequest } from './models/AddFileToPlaylistRequest';
export type { BaseChangePermissionsRequest } from './models/BaseChangePermissionsRequest'; export type { BaseChangePermissionsRequest } from './models/BaseChangePermissionsRequest';
export type { body_19 } from './models/body_19'; export type { body_19 } from './models/body_19';
export type { body_20 } from './models/body_20'; export type { body_20 } from './models/body_20';
export type { Category } from './models/Category';
export { CategoryRule } from './models/CategoryRule';
export type { ChangeRolePermissionsRequest } from './models/ChangeRolePermissionsRequest'; export type { ChangeRolePermissionsRequest } from './models/ChangeRolePermissionsRequest';
export type { ChangeUserPermissionsRequest } from './models/ChangeUserPermissionsRequest'; export type { ChangeUserPermissionsRequest } from './models/ChangeUserPermissionsRequest';
export type { CheckConcurrentStreamRequest } from './models/CheckConcurrentStreamRequest';
export type { CheckConcurrentStreamResponse } from './models/CheckConcurrentStreamResponse';
export type { ConcurrentStream } from './models/ConcurrentStream';
export type { Config } from './models/Config'; export type { Config } from './models/Config';
export type { ConfigResponse } from './models/ConfigResponse'; export type { ConfigResponse } from './models/ConfigResponse';
export type { CreateCategoryRequest } from './models/CreateCategoryRequest';
export type { CreateCategoryResponse } from './models/CreateCategoryResponse';
export type { CreatePlaylistRequest } from './models/CreatePlaylistRequest'; export type { CreatePlaylistRequest } from './models/CreatePlaylistRequest';
export type { CreatePlaylistResponse } from './models/CreatePlaylistResponse'; export type { CreatePlaylistResponse } from './models/CreatePlaylistResponse';
export type { CropFileSettings } from './models/CropFileSettings'; export type { CropFileSettings } from './models/CropFileSettings';
export type { DatabaseFile } from './models/DatabaseFile'; export type { DatabaseFile } from './models/DatabaseFile';
export type { DBInfoResponse } from './models/DBInfoResponse';
export type { DeleteCategoryRequest } from './models/DeleteCategoryRequest';
export type { DeleteMp3Mp4Request } from './models/DeleteMp3Mp4Request'; export type { DeleteMp3Mp4Request } from './models/DeleteMp3Mp4Request';
export type { DeletePlaylistRequest } from './models/DeletePlaylistRequest'; export type { DeletePlaylistRequest } from './models/DeletePlaylistRequest';
export type { DeleteSubscriptionFileRequest } from './models/DeleteSubscriptionFileRequest'; export type { DeleteSubscriptionFileRequest } from './models/DeleteSubscriptionFileRequest';
@ -22,17 +32,28 @@ export type { DownloadArchiveRequest } from './models/DownloadArchiveRequest';
export type { DownloadFileRequest } from './models/DownloadFileRequest'; export type { DownloadFileRequest } from './models/DownloadFileRequest';
export type { DownloadRequest } from './models/DownloadRequest'; export type { DownloadRequest } from './models/DownloadRequest';
export type { DownloadResponse } from './models/DownloadResponse'; export type { DownloadResponse } from './models/DownloadResponse';
export type { DownloadTwitchChatByVODIDRequest } from './models/DownloadTwitchChatByVODIDRequest';
export type { DownloadTwitchChatByVODIDResponse } from './models/DownloadTwitchChatByVODIDResponse';
export type { DownloadVideosForSubscriptionRequest } from './models/DownloadVideosForSubscriptionRequest'; export type { DownloadVideosForSubscriptionRequest } from './models/DownloadVideosForSubscriptionRequest';
export type { File } from './models/File'; export type { File } from './models/File';
export { FileType } from './models/FileType'; export { FileType } from './models/FileType';
export type { GenerateArgsResponse } from './models/GenerateArgsResponse';
export type { GenerateNewApiKeyResponse } from './models/GenerateNewApiKeyResponse'; export type { GenerateNewApiKeyResponse } from './models/GenerateNewApiKeyResponse';
export type { GetAllCategoriesResponse } from './models/GetAllCategoriesResponse';
export type { GetAllDownloadsRequest } from './models/GetAllDownloadsRequest';
export type { GetAllDownloadsResponse } from './models/GetAllDownloadsResponse'; export type { GetAllDownloadsResponse } from './models/GetAllDownloadsResponse';
export type { GetAllFilesResponse } from './models/GetAllFilesResponse'; export type { GetAllFilesResponse } from './models/GetAllFilesResponse';
export type { GetAllSubscriptionsResponse } from './models/GetAllSubscriptionsResponse'; export type { GetAllSubscriptionsResponse } from './models/GetAllSubscriptionsResponse';
export type { GetDownloadRequest } from './models/GetDownloadRequest'; export type { GetDownloadRequest } from './models/GetDownloadRequest';
export type { GetDownloadResponse } from './models/GetDownloadResponse'; export type { GetDownloadResponse } from './models/GetDownloadResponse';
export type { GetFileFormatsRequest } from './models/GetFileFormatsRequest';
export type { GetFileFormatsResponse } from './models/GetFileFormatsResponse';
export type { GetFileRequest } from './models/GetFileRequest'; export type { GetFileRequest } from './models/GetFileRequest';
export type { GetFileResponse } from './models/GetFileResponse'; export type { GetFileResponse } from './models/GetFileResponse';
export type { GetFullTwitchChatRequest } from './models/GetFullTwitchChatRequest';
export type { GetFullTwitchChatResponse } from './models/GetFullTwitchChatResponse';
export type { GetLogsRequest } from './models/GetLogsRequest';
export type { GetLogsResponse } from './models/GetLogsResponse';
export type { GetMp3sResponse } from './models/GetMp3sResponse'; export type { GetMp3sResponse } from './models/GetMp3sResponse';
export type { GetMp4sResponse } from './models/GetMp4sResponse'; export type { GetMp4sResponse } from './models/GetMp4sResponse';
export type { GetPlaylistRequest } from './models/GetPlaylistRequest'; export type { GetPlaylistRequest } from './models/GetPlaylistRequest';
@ -43,6 +64,7 @@ export type { GetRolesResponse } from './models/GetRolesResponse';
export type { GetSubscriptionRequest } from './models/GetSubscriptionRequest'; export type { GetSubscriptionRequest } from './models/GetSubscriptionRequest';
export type { GetSubscriptionResponse } from './models/GetSubscriptionResponse'; export type { GetSubscriptionResponse } from './models/GetSubscriptionResponse';
export type { GetUsersResponse } from './models/GetUsersResponse'; export type { GetUsersResponse } from './models/GetUsersResponse';
export type { IncrementViewCountRequest } from './models/IncrementViewCountRequest';
export type { inline_response_200_15 } from './models/inline_response_200_15'; export type { inline_response_200_15 } from './models/inline_response_200_15';
export type { LoginRequest } from './models/LoginRequest'; export type { LoginRequest } from './models/LoginRequest';
export type { LoginResponse } from './models/LoginResponse'; export type { LoginResponse } from './models/LoginResponse';
@ -56,12 +78,24 @@ export type { SubscribeResponse } from './models/SubscribeResponse';
export type { Subscription } from './models/Subscription'; export type { Subscription } from './models/Subscription';
export type { SubscriptionRequestData } from './models/SubscriptionRequestData'; export type { SubscriptionRequestData } from './models/SubscriptionRequestData';
export type { SuccessObject } from './models/SuccessObject'; export type { SuccessObject } from './models/SuccessObject';
export type { TableInfo } from './models/TableInfo';
export type { TestConnectionStringRequest } from './models/TestConnectionStringRequest';
export type { TestConnectionStringResponse } from './models/TestConnectionStringResponse';
export type { TransferDBRequest } from './models/TransferDBRequest';
export type { TransferDBResponse } from './models/TransferDBResponse';
export type { TwitchChatMessage } from './models/TwitchChatMessage';
export type { UnsubscribeRequest } from './models/UnsubscribeRequest'; export type { UnsubscribeRequest } from './models/UnsubscribeRequest';
export type { UnsubscribeResponse } from './models/UnsubscribeResponse'; export type { UnsubscribeResponse } from './models/UnsubscribeResponse';
export type { UpdateCategoriesRequest } from './models/UpdateCategoriesRequest';
export type { UpdateCategoryRequest } from './models/UpdateCategoryRequest';
export type { UpdateConcurrentStreamRequest } from './models/UpdateConcurrentStreamRequest';
export type { UpdateConcurrentStreamResponse } from './models/UpdateConcurrentStreamResponse';
export type { UpdatePlaylistRequest } from './models/UpdatePlaylistRequest'; export type { UpdatePlaylistRequest } from './models/UpdatePlaylistRequest';
export type { UpdaterStatus } from './models/UpdaterStatus'; export type { UpdaterStatus } from './models/UpdaterStatus';
export type { UpdateServerRequest } from './models/UpdateServerRequest'; export type { UpdateServerRequest } from './models/UpdateServerRequest';
export type { UpdateUserRequest } from './models/UpdateUserRequest'; export type { UpdateUserRequest } from './models/UpdateUserRequest';
export type { User } from './models/User'; export type { User } from './models/User';
export { UserPermission } from './models/UserPermission'; export { UserPermission } from './models/UserPermission';
export type { Version } from './models/Version';
export type { VersionInfoResponse } from './models/VersionInfoResponse';
export { YesNo } from './models/YesNo'; export { YesNo } from './models/YesNo';

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface AddFileToPlaylistRequest {
file_uid: string;
playlist_id: string;
}

@ -0,0 +1,15 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { CategoryRule } from './CategoryRule';
export interface Category {
name?: string;
uid?: string;
rules?: Array<CategoryRule>;
/**
* Overrides file output for downloaded files in category
*/
custom_output?: string;
}

@ -0,0 +1,26 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface CategoryRule {
preceding_operator?: CategoryRule.preceding_operator;
comparator?: CategoryRule.comparator;
}
export namespace CategoryRule {
export enum preceding_operator {
OR = 'or',
AND = 'and',
}
export enum comparator {
INCLUDES = 'includes',
NOT_INCLUDES = 'not_includes',
EQUALS = 'equals',
NOT_EQUALS = 'not_equals',
}
}

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface CheckConcurrentStreamRequest {
/**
* UID of the concurrent stream
*/
uid: string;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { ConcurrentStream } from './ConcurrentStream';
export interface CheckConcurrentStreamResponse {
stream: ConcurrentStream;
}

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface ConcurrentStream {
playback_timestamp?: number;
unix_timestamp?: number;
playing?: boolean;
}

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface CreateCategoryRequest {
name: string;
}

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Category } from './Category';
export interface CreateCategoryResponse {
new_category?: Category;
success?: boolean;
}

@ -0,0 +1,18 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { TableInfo } from './TableInfo';
export interface DBInfoResponse {
using_local_db?: boolean;
stats_by_table?: {
files?: TableInfo,
playlists?: TableInfo,
categories?: TableInfo,
subscriptions?: TableInfo,
users?: TableInfo,
roles?: TableInfo,
download_queue?: TableInfo,
};
}

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface DeleteCategoryRequest {
category_uid: string;
}

@ -4,11 +4,8 @@
export interface DownloadFileRequest { export interface DownloadFileRequest {
uid: string; uid?: string;
uuid?: string; uuid?: string;
sub_id?: string; sub_id?: string;
/** playlist_id?: string;
* Only used for subscriptions
*/
is_playlist?: boolean;
} }

@ -0,0 +1,26 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
import { Subscription } from './Subscription';
export interface DownloadTwitchChatByVODIDRequest {
/**
* File ID
*/
id: string;
/**
* ID of the VOD
*/
vodId: string;
type: FileType;
/**
* User UID
*/
uuid?: string;
/**
* Subscription
*/
sub?: Subscription;
}

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

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GenerateArgsResponse {
args?: Array<string>;
}

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

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetAllDownloadsRequest {
/**
* Filters downloads with the array
*/
uids?: Array<string> | null;
}

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetFileFormatsRequest {
url?: string;
}

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { File } from './File';
export interface GetFileFormatsResponse {
success: boolean;
result: {
formats?: Array<any>,
};
}

@ -0,0 +1,22 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { FileType } from './FileType';
import { Subscription } from './Subscription';
export interface GetFullTwitchChatRequest {
/**
* File ID
*/
id: string;
type: FileType;
/**
* User UID
*/
uuid?: string;
/**
* Subscription
*/
sub?: Subscription;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetFullTwitchChatResponse {
success: boolean;
error?: string;
}

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetLogsRequest {
lines?: number;
}

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface GetLogsResponse {
/**
* Number of lines to retrieve from the bottom
*/
logs?: string;
success?: boolean;
}

@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface IncrementViewCountRequest {
file_uid: string;
sub_id?: string;
/**
* User UID
*/
uuid?: string;
}

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TableInfo {
records_count?: number;
}

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TestConnectionStringRequest {
/**
* MongoDB connection string
*/
connection_string: string;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TestConnectionStringResponse {
success: boolean;
error?: string;
}

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TransferDBRequest {
/**
* True if transfering DB from Local to MongoDB, false if transferring DB from MongoDB to Local
*/
local_to_remote: boolean;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TransferDBResponse {
success: boolean;
error?: string;
}

@ -0,0 +1,18 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface TwitchChatMessage {
created_at?: string;
content_offset_seconds?: number;
commenter?: {
name?: string,
_id?: string,
created_at?: string,
};
message?: {
body?: string,
user_color?: string,
};
}

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

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Category } from './Category';
export interface UpdateCategoryRequest {
category: Category;
}

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { ConcurrentStream } from './ConcurrentStream';
export interface UpdateConcurrentStreamRequest extends ConcurrentStream {
/**
* Concurrent stream UID
*/
uid: string;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { ConcurrentStream } from './ConcurrentStream';
export interface UpdateConcurrentStreamResponse {
stream: ConcurrentStream;
}

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export interface Version {
type?: string;
tag?: string;
commit?: string;
date?: string;
}

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Version } from './Version';
export interface VersionInfoResponse {
version_info: Version;
}

@ -597,7 +597,7 @@ export class MainComponent implements OnInit {
} }
} }
this.postsService.generateArgs(this.url, type, (this.selectedQuality === '' ? null : this.selectedQuality), this.postsService.generateArgs(this.url, type as FileType, (this.selectedQuality === '' ? null : this.selectedQuality),
customQualityConfiguration, customArgs, additionalArgs, customOutput, youtubeUsername, youtubePassword, cropFileSettings).subscribe(res => { customQualityConfiguration, customArgs, additionalArgs, customOutput, youtubeUsername, youtubePassword, cropFileSettings).subscribe(res => {
const simulated_args = res['args']; const simulated_args = res['args'];
if (simulated_args) { if (simulated_args) {

@ -61,6 +61,35 @@ import {
UpdateUserRequest, UpdateUserRequest,
UserPermission, UserPermission,
YesNo, YesNo,
GenerateArgsResponse,
GetPlaylistsRequest,
UpdateCategoryRequest,
UpdateCategoriesRequest,
DeleteCategoryRequest,
CreateCategoryRequest,
CreateCategoryResponse,
GetAllCategoriesResponse,
AddFileToPlaylistRequest,
IncrementViewCountRequest,
GetLogsRequest,
GetLogsResponse,
UpdateConcurrentStreamResponse,
UpdateConcurrentStreamRequest,
CheckConcurrentStreamRequest,
CheckConcurrentStreamResponse,
DownloadTwitchChatByVODIDRequest,
DownloadTwitchChatByVODIDResponse,
GetFullTwitchChatRequest,
GetFullTwitchChatResponse,
GetAllDownloadsRequest,
TestConnectionStringRequest,
TestConnectionStringResponse,
TransferDBRequest,
TransferDBResponse,
VersionInfoResponse,
DBInfoResponse,
GetFileFormatsRequest,
GetFileFormatsResponse,
} from '../api-types'; } from '../api-types';
import { isoLangs } from './settings/locales_list'; import { isoLangs } from './settings/locales_list';
import { Title } from '@angular/platform-browser'; import { Title } from '@angular/platform-browser';
@ -243,37 +272,40 @@ export class PostsService implements CanActivate {
return this.http.post<DownloadResponse>(this.path + 'downloadFile', body, this.httpOptions); return this.http.post<DownloadResponse>(this.path + 'downloadFile', body, this.httpOptions);
} }
generateArgs(url: string, type: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings = null) { generateArgs(url: string, type: FileType, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings = null) {
return this.http.post(this.path + 'generateArgs', {url: url, const body: DownloadRequest = {url: url,
selectedHeight: selectedQuality, selectedHeight: selectedQuality,
customQualityConfiguration: customQualityConfiguration, customQualityConfiguration: customQualityConfiguration,
customArgs: customArgs, customArgs: customArgs,
additionalArgs: additionalArgs, additionalArgs: additionalArgs,
customOutput: customOutput, customOutput: customOutput,
youtubeUsername: youtubeUsername, youtubeUsername: youtubeUsername,
youtubePassword: youtubePassword, youtubePassword: youtubePassword,
type: type, type: type,
cropFileSettings: cropFileSettings}, this.httpOptions); cropFileSettings: cropFileSettings}
return this.http.post<GenerateArgsResponse>(this.path + 'generateArgs', body, this.httpOptions);
} }
getDBInfo() { getDBInfo() {
return this.http.post(this.path + 'getDBInfo', {}, this.httpOptions); return this.http.get<DBInfoResponse>(this.path + 'getDBInfo', this.httpOptions);
} }
transferDB(local_to_remote) { transferDB(local_to_remote) {
return this.http.post(this.path + 'transferDB', {local_to_remote: local_to_remote}, this.httpOptions); const body: TransferDBRequest = {local_to_remote: local_to_remote};
return this.http.post<TransferDBResponse>(this.path + 'transferDB', body, this.httpOptions);
} }
testConnectionString(connection_string) { testConnectionString(connection_string: string) {
return this.http.post(this.path + 'testConnectionString', {connection_string: connection_string}, this.httpOptions); const body: TestConnectionStringRequest = {connection_string: connection_string};
return this.http.post<TestConnectionStringResponse>(this.path + 'testConnectionString', body, this.httpOptions);
} }
killAllDownloads() { killAllDownloads() {
return this.http.post(this.path + 'killAllDownloads', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'killAllDownloads', {}, this.httpOptions);
} }
restartServer() { restartServer() {
return this.http.post(this.path + 'restartServer', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'restartServer', {}, this.httpOptions);
} }
loadNavItems() { loadNavItems() {
@ -319,54 +351,51 @@ export class PostsService implements CanActivate {
return this.http.post<GetAllFilesResponse>(this.path + 'getAllFiles', {sort: sort, range: range, text_search: text_search, file_type_filter: file_type_filter}, this.httpOptions); return this.http.post<GetAllFilesResponse>(this.path + 'getAllFiles', {sort: sort, range: range, text_search: text_search, file_type_filter: file_type_filter}, this.httpOptions);
} }
downloadFileFromServer(uid: string, uuid: string = null, sub_id: string = null, is_playlist: boolean = null) { downloadFileFromServer(uid: string, uuid: string = null, sub_id: string = null) {
const body: DownloadFileRequest = { const body: DownloadFileRequest = {
uid: uid, uid: uid,
uuid: uuid, uuid: uuid,
sub_id: sub_id, sub_id: sub_id
is_playlist: is_playlist
}; };
return this.http.post(this.path + 'downloadFile', body, {responseType: 'blob', params: this.httpOptions.params}); return this.http.post(this.path + 'downloadFile', body, {responseType: 'blob', params: this.httpOptions.params});
} }
getFullTwitchChat(id, type, uuid = null, sub = null) { getFullTwitchChat(id, type, uuid = null, sub = null) {
return this.http.post(this.path + 'getFullTwitchChat', {id: id, type: type, uuid: uuid, sub: sub}, this.httpOptions); const body: GetFullTwitchChatRequest = {id: id, type: type, uuid: uuid, sub: sub};
return this.http.post<GetFullTwitchChatResponse>(this.path + 'getFullTwitchChat', body, this.httpOptions);
} }
downloadTwitchChat(id, type, vodId, uuid = null, sub = null) { downloadTwitchChat(id, type, vodId, uuid = null, sub = null) {
return this.http.post(this.path + 'downloadTwitchChatByVODID', {id: id, type: type, vodId: vodId, uuid: uuid, sub: sub}, this.httpOptions); const body: DownloadTwitchChatByVODIDRequest = {id: id, type: type, vodId: vodId, uuid: uuid, sub: sub};
return this.http.post<DownloadTwitchChatByVODIDResponse>(this.path + 'downloadTwitchChatByVODID', body, this.httpOptions);
} }
downloadPlaylistFromServer(playlist_id, uuid = null) { downloadPlaylistFromServer(playlist_id, uuid = null) {
return this.http.post(this.path + 'downloadFileFromServer', { const body: DownloadFileRequest = {uuid: uuid, playlist_id: playlist_id};
uuid: uuid, return this.http.post(this.path + 'downloadFileFromServer', body, {responseType: 'blob', params: this.httpOptions.params});
playlist_id: playlist_id
},
{responseType: 'blob', params: this.httpOptions.params});
} }
downloadSubFromServer(sub_id, uuid = null) { downloadSubFromServer(sub_id, uuid = null) {
return this.http.post(this.path + 'downloadFileFromServer', { const body: DownloadFileRequest = {uuid: uuid, sub_id: sub_id};
uuid: uuid, return this.http.post(this.path + 'downloadFileFromServer', body, {responseType: 'blob', params: this.httpOptions.params});
sub_id: sub_id
},
{responseType: 'blob', params: this.httpOptions.params});
} }
checkConcurrentStream(uid) { checkConcurrentStream(uid) {
return this.http.post(this.path + 'checkConcurrentStream', {uid: uid}, this.httpOptions); const body: CheckConcurrentStreamRequest = {uid: uid};
return this.http.post<CheckConcurrentStreamResponse>(this.path + 'checkConcurrentStream', body, this.httpOptions);
} }
updateConcurrentStream(uid, playback_timestamp, unix_timestamp, playing) { updateConcurrentStream(uid, playback_timestamp, unix_timestamp, playing) {
return this.http.post(this.path + 'updateConcurrentStream', {uid: uid, const body: UpdateConcurrentStreamRequest = {uid: uid,
playback_timestamp: playback_timestamp, playback_timestamp: playback_timestamp,
unix_timestamp: unix_timestamp, unix_timestamp: unix_timestamp,
playing: playing}, this.httpOptions); playing: playing};
return this.http.post<UpdateConcurrentStreamResponse>(this.path + 'updateConcurrentStream', body, this.httpOptions);
} }
uploadCookiesFile(fileFormData) { uploadCookiesFile(fileFormData) {
return this.http.post(this.path + 'uploadCookies', fileFormData, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'uploadCookies', fileFormData, this.httpOptions);
} }
downloadArchive(sub) { downloadArchive(sub) {
@ -375,15 +404,17 @@ export class PostsService implements CanActivate {
} }
getFileFormats(url) { getFileFormats(url) {
return this.http.post(this.path + 'getFileFormats', {url: url}, this.httpOptions); const body: GetFileFormatsRequest = {url: url};
return this.http.post<GetFileFormatsResponse>(this.path + 'getFileFormats', body, this.httpOptions);
} }
getLogs(lines = 50) { getLogs(lines = 50) {
return this.http.post(this.path + 'logs', {lines: lines}, this.httpOptions); const body: GetLogsRequest = {lines: lines};
return this.http.post<GetLogsResponse>(this.path + 'logs', body, this.httpOptions);
} }
clearAllLogs() { clearAllLogs() {
return this.http.post(this.path + 'clearAllLogs', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'clearAllLogs', {}, this.httpOptions);
} }
generateNewAPIKey() { generateNewAPIKey() {
@ -415,11 +446,12 @@ export class PostsService implements CanActivate {
} }
incrementViewCount(file_uid, sub_id, uuid) { incrementViewCount(file_uid, sub_id, uuid) {
return this.http.post(this.path + 'incrementViewCount', {file_uid: file_uid, sub_id: sub_id, uuid: uuid}, this.httpOptions); const body: IncrementViewCountRequest = {file_uid: file_uid, sub_id: sub_id, uuid: uuid};
return this.http.post<SuccessObject>(this.path + 'incrementViewCount', body, this.httpOptions);
} }
getPlaylists() { getPlaylists() {
return this.http.post(this.path + 'getPlaylists', {}, this.httpOptions); return this.http.post<GetPlaylistsRequest>(this.path + 'getPlaylists', {}, this.httpOptions);
} }
updatePlaylist(playlist: Playlist) { updatePlaylist(playlist: Playlist) {
@ -439,31 +471,34 @@ export class PostsService implements CanActivate {
} }
addFileToPlaylist(playlist_id, file_uid) { addFileToPlaylist(playlist_id, file_uid) {
return this.http.post(this.path + 'addFileToPlaylist', {playlist_id: playlist_id, const body: AddFileToPlaylistRequest = {playlist_id: playlist_id, file_uid: file_uid}
file_uid: file_uid}, return this.http.post<SuccessObject>(this.path + 'addFileToPlaylist', body, this.httpOptions);
this.httpOptions);
} }
// categories // categories
getAllCategories() { getAllCategories() {
return this.http.post(this.path + 'getAllCategories', {}, this.httpOptions); return this.http.post<GetAllCategoriesResponse>(this.path + 'getAllCategories', {}, this.httpOptions);
} }
createCategory(name) { createCategory(name) {
return this.http.post(this.path + 'createCategory', {name: name}, this.httpOptions); const body: CreateCategoryRequest = {name: name};
return this.http.post<CreateCategoryResponse>(this.path + 'createCategory', body, this.httpOptions);
} }
deleteCategory(category_uid) { deleteCategory(category_uid) {
return this.http.post(this.path + 'deleteCategory', {category_uid: category_uid}, this.httpOptions); const body: DeleteCategoryRequest = {category_uid: category_uid};
return this.http.post<SuccessObject>(this.path + 'deleteCategory', body, this.httpOptions);
} }
updateCategory(category) { updateCategory(category) {
return this.http.post(this.path + 'updateCategory', {category: category}, this.httpOptions); const body: UpdateCategoryRequest = {category: category};
return this.http.post<SuccessObject>(this.path + 'updateCategory', body, this.httpOptions);
} }
updateCategories(categories) { updateCategories(categories) {
return this.http.post(this.path + 'updateCategories', {categories: categories}, this.httpOptions); const body: UpdateCategoriesRequest = {categories: categories};
return this.http.post<SuccessObject>(this.path + 'updateCategories', body, this.httpOptions);
} }
reloadCategories() { reloadCategories() {
@ -474,7 +509,7 @@ export class PostsService implements CanActivate {
updateSubscription(subscription) { updateSubscription(subscription) {
delete subscription['videos']; delete subscription['videos'];
return this.http.post(this.path + 'updateSubscription', {subscription: subscription}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'updateSubscription', {subscription: subscription}, this.httpOptions);
} }
unsubscribe(sub: SubscriptionRequestData, deleteMode = false) { unsubscribe(sub: SubscriptionRequestData, deleteMode = false) {
@ -498,7 +533,8 @@ export class PostsService implements CanActivate {
} }
getCurrentDownloads(uids: Array<string> = null) { getCurrentDownloads(uids: Array<string> = null) {
return this.http.post<GetAllDownloadsResponse>(this.path + 'downloads', {uids: uids}, this.httpOptions); const body: GetAllDownloadsRequest = {uids: uids};
return this.http.post<GetAllDownloadsResponse>(this.path + 'downloads', body, this.httpOptions);
} }
getCurrentDownload(download_uid: string) { getCurrentDownload(download_uid: string) {
@ -507,39 +543,39 @@ export class PostsService implements CanActivate {
} }
pauseDownload(download_uid) { pauseDownload(download_uid) {
return this.http.post(this.path + 'pauseDownload', {download_uid: download_uid}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'pauseDownload', {download_uid: download_uid}, this.httpOptions);
} }
pauseAllDownloads() { pauseAllDownloads() {
return this.http.post(this.path + 'pauseAllDownloads', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'pauseAllDownloads', {}, this.httpOptions);
} }
resumeDownload(download_uid) { resumeDownload(download_uid) {
return this.http.post(this.path + 'resumeDownload', {download_uid: download_uid}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'resumeDownload', {download_uid: download_uid}, this.httpOptions);
} }
resumeAllDownloads() { resumeAllDownloads() {
return this.http.post(this.path + 'resumeAllDownloads', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'resumeAllDownloads', {}, this.httpOptions);
} }
restartDownload(download_uid) { restartDownload(download_uid) {
return this.http.post(this.path + 'restartDownload', {download_uid: download_uid}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'restartDownload', {download_uid: download_uid}, this.httpOptions);
} }
cancelDownload(download_uid) { cancelDownload(download_uid) {
return this.http.post(this.path + 'cancelDownload', {download_uid: download_uid}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'cancelDownload', {download_uid: download_uid}, this.httpOptions);
} }
clearDownload(download_uid) { clearDownload(download_uid) {
return this.http.post(this.path + 'clearDownload', {download_uid: download_uid}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'clearDownload', {download_uid: download_uid}, this.httpOptions);
} }
clearFinishedDownloads() { clearFinishedDownloads() {
return this.http.post(this.path + 'clearFinishedDownloads', {}, this.httpOptions); return this.http.post<SuccessObject>(this.path + 'clearFinishedDownloads', {}, this.httpOptions);
} }
getVersionInfo() { getVersionInfo() {
return this.http.get(this.path + 'versionInfo', this.httpOptions); return this.http.get<VersionInfoResponse>(this.path + 'versionInfo', this.httpOptions);
} }
updateServer(tag: string) { updateServer(tag: string) {

Loading…
Cancel
Save