Added custom quality options to PostsService and the ability to do a URL info grab from the server

Video and audio streams now save the stream object in a "descriptors" variable which will give the server the ability to close them when the file needs to be deleted.
- without this, windows systems don't play nice with nodejs function fs.unlinkSync. A weird, but necessary workaround

deleting files is now done asynchronously, and success is now determined by whether they exist afterwards or not

Added backend function to get info for URLs

Modified tomp3 and tomp4 endpoint to support custom quality settings.
This commit is contained in:
Isaac Grynsztein
2020-02-17 00:36:15 -05:00
parent 5f4a7a1e69
commit f673b325fd
2 changed files with 201 additions and 32 deletions

View File

@@ -36,12 +36,16 @@ export class PostsService {
return this.http.get(this.startPath + 'audiofolder');
}
makeMP3(url: string) {
return this.http.post(this.path + 'tomp3', {url: url});
makeMP3(url: string, selectedQuality: string, customQualityConfiguration: string) {
return this.http.post(this.path + 'tomp3', {url: url,
maxBitrate: selectedQuality,
customQualityConfiguration: customQualityConfiguration});
}
makeMP4(url: string) {
return this.http.post(this.path + 'tomp4', {url: url});
makeMP4(url: string, selectedQuality: string, customQualityConfiguration: string) {
return this.http.post(this.path + 'tomp4', {url: url,
selectedHeight: selectedQuality,
customQualityConfiguration: customQualityConfiguration});
}
getFileStatusMp3(name: string) {
@@ -80,8 +84,8 @@ export class PostsService {
return this.http.post(this.path + 'downloadFile', {fileName: fileName, type: type}, {responseType: 'blob'});
}
getFileInfo(fileNames, type) {
return this.http.post(this.path + 'getVideoInfos', {fileNames: fileNames, type: type});
getFileInfo(fileNames, type, urlMode) {
return this.http.post(this.path + 'getVideoInfos', {fileNames: fileNames, type: type, urlMode: urlMode});
}
}