Skip to content

Commit

Permalink
prioritize single sub file over zip
Browse files Browse the repository at this point in the history
  • Loading branch information
GodPepe7 committed Jul 19, 2024
1 parent 1ad45a0 commit 9504106
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ async function getSubs(animeTitle: string, episode: number) {
if (typeof subs === "string") {
return subs;
}
const { url, name } = subs[0]
const nonZipSub = subs.find(sub => !sub.name.endsWith(".zip"))
const { url, name } = nonZipSub ? nonZipSub : subs[0]
chrome.downloads.download({
url,
filename: name,
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const entryPoints = {
injectScript: './src/injectScript.ts'
};

module.exports = {
module.exports = {1
entry: entryPoints,
module: {
rules: [
Expand Down

0 comments on commit 9504106

Please sign in to comment.