Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
Thanks to TypeScript 5.5, this workaround is no longer needed
  • Loading branch information
AnimeDL committed Jun 23, 2024
1 parent 9457ee6 commit e0e1ba1
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions crunchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2165,30 +2165,20 @@ export default class Crunchy implements ServiceClass {
}
const merger = new Merger({
onlyVid: hasAudioStreams ? data.filter(a => a.type === 'Video').map((a) : MergerInput => {
if (a.type === 'Subtitle')
throw new Error('Never');
return {
lang: a.lang,
path: a.path,
};
}) : [],
skipSubMux: options.skipSubMux,
onlyAudio: hasAudioStreams ? data.filter(a => a.type === 'Audio').map((a) : MergerInput => {
if (a.type === 'Subtitle')
throw new Error('Never');
return {
lang: a.lang,
path: a.path,
};
}) : [],
output: `${options.output}.${options.mp4 ? 'mp4' : 'mkv'}`,
subtitles: data.filter(a => a.type === 'Subtitle').map((a) : SubtitleInput => {
if (a.type === 'Video')
throw new Error('Never');
if (a.type === 'Audio')
throw new Error('Never');
if (a.type === 'Chapters')
throw new Error('Never');
return {
file: a.path,
language: a.language,
Expand All @@ -2200,20 +2190,12 @@ export default class Crunchy implements ServiceClass {
keepAllVideos: options.keepAllVideos,
fonts: Merger.makeFontsList(this.cfg.dir.fonts, data.filter(a => a.type === 'Subtitle') as sxItem[]),
videoAndAudio: hasAudioStreams ? [] : data.filter(a => a.type === 'Video').map((a) : MergerInput => {
if (a.type === 'Subtitle')
throw new Error('Never');
return {
lang: a.lang,
path: a.path,
};
}),
chapters: data.filter(a => a.type === 'Chapters').map((a) : MergerInput => {
if (a.type === 'Video')
throw new Error('Never');
if (a.type === 'Audio')
throw new Error('Never');
if (a.type === 'Subtitle')
throw new Error('Never');
return {
path: a.path,
lang: a.lang
Expand Down

0 comments on commit e0e1ba1

Please sign in to comment.