Skip to content

Commit

Permalink
feat: add pdf support (close #45)
Browse files Browse the repository at this point in the history
  • Loading branch information
mason1900 authored and umonaca committed Mar 22, 2021
1 parent 061c1b4 commit b369536
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions filesystem/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const getTrackList = (id, dir) => recursiveReaddir(dir)
return (ext === '.mp3' || ext === '.ogg' || ext === '.opus' || ext === '.wav' || ext === '.aac'
|| ext === '.flac' || ext === '.webm' || ext === '.mp4'|| ext === '.m4a'
|| ext === '.txt' || ext === '.lrc' || ext === '.srt' || ext === '.ass'
|| ext === '.pdf'
|| ext === '.jpg' || ext === '.jpeg' || ext === '.png' || ext === '.webp');
});

Expand Down Expand Up @@ -123,6 +124,15 @@ const toTree = (tracks, workTitle, workDir, rootFolder) => {
mediaStreamUrl,
mediaDownloadUrl
});
} else if (track.ext === '.pdf') {
fatherFolder.push({
type: 'other',
hash: track.hash,
title: track.title,
workTitle,
mediaStreamUrl,
mediaDownloadUrl
});
} else {
fatherFolder.push({
type: 'file',
Expand Down

0 comments on commit b369536

Please sign in to comment.