added API endpoint to get file from database

video/audio files can now be retrieved by just uid, allowing for easy sharing

added API endpoints for sharing/unsharing a video (no UI support yet)
This commit is contained in:
Isaac Grynsztein
2020-04-07 14:49:05 -04:00
parent 2414e16021
commit 822aec4de8
6 changed files with 201 additions and 60 deletions

View File

@@ -118,6 +118,10 @@ export class PostsService {
return this.http.post(this.path + 'getMp4s', {});
}
getFile(uid, type) {
return this.http.post(this.path + 'getFile', {uid: uid, type: type});
}
downloadFileFromServer(fileName, type, outputName = null, fullPathProvided = null) {
return this.http.post(this.path + 'downloadFile', {fileNames: fileName,
type: type,
@@ -147,6 +151,14 @@ export class PostsService {
return this.http.post(this.path + 'checkPin', {input_pin: unhashed_pin});
}
enableSharing(uid, type) {
return this.http.post(this.path + 'enableSharing', {uid: uid, type: type});
}
disableSharing(uid, type) {
return this.http.post(this.path + 'disableSharing', {uid: uid, type: type});
}
createPlaylist(playlistName, fileNames, type, thumbnailURL) {
return this.http.post(this.path + 'createPlaylist', {playlistName: playlistName,
fileNames: fileNames,