Skip to content

Commit

Permalink
✔ Destroy & Reject
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed Oct 12, 2023
1 parent 36fca5d commit 0bb8c86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/fansubid/server/main.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/api/scheduler/upload-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export class UploadService {
if (fIdx >= 0) {
if (attachment.ext === 'mkv') {
try {
this.gs.log('[FILE_SUBTITLE_FONT-EXTRACT_MULAI] 🎼', attachment.name, 'error');
const extractedFiles = await this.mkv.mkvExtract(attachment.name, `${environment.uploadFolder}/${files[fIdx].name}`);
for (const ef of extractedFiles) {
const fileNameExt = ef.name.split('.');
Expand Down
3 changes: 3 additions & 0 deletions src/api/services/mkv-extract.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class MkvExtractService {

decoder.on('error', error => {
this.gs.log(`[MKVEXTRACT_DECODER_ERROR] 🌋 ${fileName} 🧬`, error, 'error');
decoder.destroy(error);
fileStream.destroy(error);
reject(error);
});
Expand All @@ -90,6 +91,7 @@ export class MkvExtractService {
switch (chunk[0]) {
case 'end':
// if (chunk[1].name === 'Info') {
// decoder.destroy();
// fileStream.destroy();
// }
if (chunk[1].name === 'TrackEntry') {
Expand All @@ -103,6 +105,7 @@ export class MkvExtractService {
case 'tag':
if (chunk[1].name === 'unknown') {
const error = new Error('Unknown File Tag!');
decoder.destroy(error);
fileStream.destroy(error);
reject(error);
}
Expand Down

0 comments on commit 0bb8c86

Please sign in to comment.