Skip to content

Commit

Permalink
fix: tags & single chapter dl
Browse files Browse the repository at this point in the history
  • Loading branch information
yinyanfr committed Mar 18, 2023
1 parent 471c3e7 commit f14cce3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.DS_Store
tmp/
tmp/
asset/
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# Changelog

# 1.5.0
## 1.5.1

`2023-03-18`

### Fix

- [CLI] Fixed the error when using `--chapters` with one single index
- [Library] Fixed the bug where tags are not added to ComicInfo.xml

## 1.5.0

`2023-03-18`

### Features

- You can now download or embbed a ComicInfo.xml in chapters
- `getSerieInfo` and `list`(CLI) now displays ComicInfo fields
- [Library] added `info` (boolean) as an option for serie, you can also pass it to chapter download, but you need to provide the info object
- [Library] Added `info` (boolean) as an option for serie, you can also pass it to chapter download, but you need to provide the info object
- [Library] Added options for list so that you can generate and write ComicInfo.xml
- [CLI] added `-i, --info` flag for `dl` to write ComicInfo.xml and for `ls` to display it, use `-o` for `ls` to write the ComicInfo.xml
- [CLI] Added `-i, --info` flag for `download` to write ComicInfo.xml and for `list` to display it, use `-o` for `ls` to write the ComicInfo.xml

### Fix

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ This library is not for browsers.
- Downloading progress watch
- Generates [ComicInfo.xml](https://anansi-project.github.io/docs/comicinfo/intro)

## :framed_picture: Gallery

### List of chapters

![List of chapters](asset/ls.png)

### Downloading

![Downloading](asset/dl.png)

## :green_book: Quick Start

You need Node.js (LTS or the current version) to run this project.
Expand Down
Binary file added asset/dl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added asset/ls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 2 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zerobyw-dl",
"version": "1.5.0",
"version": "1.5.1",
"description": "Yet another batch downloader for zerobyw",
"main": "dist/index.js",
"bin": "dist/cli.js",
Expand Down Expand Up @@ -30,15 +30,13 @@
"@types/args": "^5.0.0",
"@types/jsdom": "^21.1.0",
"@types/node": "^18.15.0",
"@types/xml": "^1.0.8",
"typescript": "^4.9.5"
},
"dependencies": {
"archiver": "^5.3.1",
"args": "^5.0.3",
"axios": "^1.3.4",
"jsdom": "^21.1.1",
"xml": "^1.0.1",
"yesno": "^0.4.0"
}
}
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const downloadCommand: Command = async (name, sub, options = {}) => {
retry,
info,
chapters: chapters
? chapters.split(",").map((e) => parseInt(e))
? `${chapters}`.split(",").map((e) => parseInt(e))
: undefined,
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ interface CliOptions {
maxTitleLength: number; // max-title-length
zipLevel: number; // zip-level
retry: boolean;
chapters: string; // 1,2,4,7
chapters: string | number; // 1,2,4,7 as string or a single number
info?: boolean;
}

Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ export default class ZeroBywDownloader {
}
}
});
if (tags.length) {
info.Tags = tags.join(",");
}

const tagGroup2 = document.querySelectorAll<HTMLSpanElement>(
Selectors.tags2
Expand Down

0 comments on commit f14cce3

Please sign in to comment.