Skip to content

Commit

Permalink
v0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
URenko committed Jan 16, 2024
1 parent 5494190 commit 2847313
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 38 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on:
push:
branches:
- master
tags: [ 'v*.*.*' ]
workflow_dispatch:

jobs:
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
English | [中文](https://github.com/comiclib/comiclib/blob/master/README.zh.md)

# ✨ Features
- 📁 Support [multiple archive formats](https://comiclib.github.io/comiclib/en/supported-formats/)
- 🏷️ Support tag and category metadata import and management
- 🔌 Support [plugins](https://comiclib.github.io/comiclib/en/scanner/)
- 🖼️ Support JPEG XL
- 📁 Support [multiple archive formats](https://comiclib.github.io/comiclib/en/supported-formats/), including folders
- 🏷️ Customizable tag and category metadata import and management with [plugins](https://comiclib.github.io/comiclib/en/scanner/)
- 💻 [LANraragi](https://github.com/Difegue/LANraragi)-compatible API
- 📜 scroll / book mode reader ([eHunter](https://github.com/hanFengSan/eHunter))
- 🔁 Tag translation ([EhTagTranslation](https://github.com/EhTagTranslation/Database))
- 🖼️ Support JPEG XL

# 🚀 Installation
Make sure you have 🐍 Python ⩾ 3.9 installed, and install 📚 ComicLib with the following command
Expand Down
7 changes: 3 additions & 4 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
中文 | [English](https://github.com/comiclib/comiclib/blob/master/README.md)

# ✨ 特点
- 📁 支持[多种存档格式](https://comiclib.github.io/comiclib/zh/supported-formats/)
- 🏷️ 支持tag和分类元数据导入和管理
- 🔌 支持[插件](https://comiclib.github.io/comiclib/zh/scanner/)
- 🖼️ 支持JPEG XL
- 📁 支持[多种存档格式](https://comiclib.github.io/comiclib/zh/supported-formats/),包括文件夹
- 🏷️ 可通过[插件](https://comiclib.github.io/comiclib/zh/scanner/)自定义 tag 和分类元数据的导入和管理
- 💻 与 [LANraragi](https://github.com/Difegue/LANraragi) 兼容的API
- 📜 卷轴式/书本式阅读器([eHunter](https://github.com/hanFengSan/eHunter)
- 🔁 标签翻译([EhTagTranslation](https://github.com/EhTagTranslation/Database)
- 🖼️ 支持JPEG XL

# 🚀 安装
确保你安装了 🐍 Python ⩾ 3.9,并通过如下命令安装 📚 ComicLib
Expand Down
2 changes: 1 addition & 1 deletion comiclib/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.4"
__version__ = "0.0.5"
print(f" >>> ComicLib v{__version__}")

from .scan import watch, scannow
Expand Down
9 changes: 5 additions & 4 deletions docs/en/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ pip install -U "comiclib[full] @ git+https://github.com/comiclib/comiclib.git"

### Docker (Experimental)

!!! tip inline end "Minimal installation"
Image with tag `v0.0.5` (without `-full` suffix) does not ship the ehentai metadata database, therefore its size is much smaller. You can download the ehentai metadata database to `/userdata` if you need it.

``` bash
docker run -p 8000:8000 \
--mount type=bind,source=<YOUR_COMIC_DIRECTORY_HERE>,target=/root/comiclib \
--mount type=bind,source=<USER_DATA_PATH>,target=/userdata \
ghcr.io/comiclib/comiclib:master
ghcr.io/comiclib/comiclib:v0.0.5-full
```
ComicLib now runs at http://localhost:8000 . If you want to use `api_dump.sqlite`, please put it under `/userdata`.

Or you can use images with `-full` suffix to include `api_dump.sqlite` in the image, however the image size is much larger.
ComicLib now runs at http://localhost:8000 .

P.S.: Monitoring comic folders is disabled by default for Docker currently.

Expand Down
7 changes: 3 additions & 4 deletions docs/en/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<p align="center"><sup>Manage, read and share your comic/manga library</sup></p>

## ✨ Features
- 📁 Support [multiple archive formats](supported-formats.md)
- 🏷️ Support tag and category metadata import and management
- 🔌 Support plugins
- 🖼️ Support JPEG XL
- 📁 Support [multiple archive formats](supported-formats.md), including folders
- 🏷️ Customizable tag and category metadata import and management with [plugins](scanner.md)
- 💻 [LANraragi](https://github.com/Difegue/LANraragi)-compatible API
- 📜 scroll / book mode reader ([eHunter](https://github.com/hanFengSan/eHunter))
- 🔁 Tag translation ([EhTagTranslation](https://github.com/EhTagTranslation/Database))
- 🖼️ Support JPEG XL

👉 [Get started](getting-started.md) now

Expand Down
25 changes: 25 additions & 0 deletions docs/en/docs/scan&watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Details about scanning and watching

## Triggers of scanning

Scanning can be triggered in the following four ways:

* When starting ComicLib, perform a full scan
* After ComicLib is started, if `watch=True`, creation/modification events (only files) are monitored in the directory indicated by the `content` environment variable.
* Manually run the `comicscan` command for a full scan
* Call the `scan` interface to scan a single file/folder, e.g.:

``` python
from comiclib.scan import scan
scan("content/comic/to/scan") # The path should be a subpath to the directory indicated by the `content` environment variable
# For folders, this means trying to treat the folder itself as a comic rather than searching for multiple comics in it
```

Use the same environment variables when executing the above command. If the setting involves relative paths, keep the working directory consistent.

## Scanning process

* All files/folders in the directory indicated by the `content` environment variable are candidates for comics
* Relative paths are an important identifier of comics. This means that if a comic is moved elsewhere, ComicLib will think it is another comic; comics with the same path will be skipped when rescanning, unless `skip_exists=False`; move the entire comic library elsewhere and modify the `content` environment variable to keep the relative relationship unchanged will not need a rescanning.
* The main part of ComicLib is only responsible for traversing the comic library. The judgment of comic files are completed through scanners.
* [Scanner script](scanner.md) is also responsible for metadata analysis and thumbnail extraction of comics.
7 changes: 2 additions & 5 deletions docs/en/docs/scanner.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Scanner

The main part of ComicLib is only responsible for traversing the comic library. The judgment and analysis of comic files are all completed through scanners.
Please read [Details about scanning and watching](scan&watch.md) first.

Scanners are divided into [built-in scanners](https://github.com/ComicLib/comiclib/tree/master/comiclib/scanner) and external scanners. All *.py files in the working directory will be loaded as external scanners.

For each candidate comic file (folder), scanners are executed sequentially in the order of the file name (regardless of whether it is built-in or not) to complete different tasks, like an assembly line.

You can find some external scanners in the [official repository](https://github.com/ComicLib/scanner), or download those written by others. In addition, you can write it by yourself as long as you know some simple Python.

By default, in addition to scanning once at startup, the comic library will also be monitored at runtime.
Comics that have been scanned into the database will be skipped.
See [Settings](settings.md) to change the behavior.

## Built-in scanners

### 10-zip.py
Expand Down Expand Up @@ -52,6 +48,7 @@ Environment variable settings:
| `importEHdb_thumb` | Whether to import thumbnails from it (`True`/`False`) | `True` |
| `importEHdb_matchtitle` | Whether to match based on the title (`True`/`False`/`exact`), `exact` for exact matching, `True` for fuzzy matching | `True` |
| `importEHdb_matchtorrent` | Whether to match based on the torrent file names (`True`/`False`) | `True` |
| `importEHdb_database_URI` | [URI](https://www.sqlite.org/uri.html) of the ehentai metadata database | `file:api_dump.sqlite?mode=rw` |

Matching based on ehentai gid is always enabled.

Expand Down
10 changes: 6 additions & 4 deletions docs/zh/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ pip install -U "comiclib[full] @ git+https://github.com/comiclib/comiclib.git"

### Docker(试验性)

!!! tip inline end "最小安装"
使用 tag `v0.0.5`(没有`-full`后缀)的镜像不自带 ehentai 元数据库,其大小会小很多。可手动下载 ehentai 元数据库并将其放在 `/userdata` 下。

``` bash
docker run -p 8000:8000 \
--mount type=bind,source=你的漫画库路径,target=/root/comiclib \
--mount type=bind,source=你的数据路径,target=/userdata \
ghcr.io/comiclib/comiclib:master
--mount type=bind,source=将要存放数据的路径,target=/userdata \
ghcr.io/comiclib/comiclib:v0.0.5-full
```
现在 ComicLib 运行在了 http://localhost:8000 。如果你想要使用 `api_dump.sqlite`, 请手动下载并将其放在 `/userdata` 下。

或者你可以使用带有 `-full` 后缀的镜像,其中包含了 `api_dump.sqlite`,但镜像大小会大很多
现在 ComicLib 运行在了 http://localhost:8000

注:目前监视漫画文件夹默认对 Docker 禁用。

Expand Down
7 changes: 3 additions & 4 deletions docs/zh/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<p align="center"><sup>管理、阅读、分享你的漫画库</sup></p>

## ✨ 特点
- 📁 支持[多种存档格式](supported-formats.md)
- 🏷️ 支持 tag 和分类元数据导入和管理
- 🔌 支持[插件](scanner.md)
- 🖼️ 支持 JPEG XL
- 📁 支持[多种存档格式](supported-formats.md),包括文件夹
- 🏷️ 可通过[插件](scanner.md)支持 tag 和分类元数据导入和管理
- 💻 与 [LANraragi](https://github.com/Difegue/LANraragi) 兼容的API
- 📜 卷轴式/书本式阅读器([eHunter](https://github.com/hanFengSan/eHunter)
- 🔁 标签翻译([EhTagTranslation](https://github.com/EhTagTranslation/Database)
- 🖼️ 支持 JPEG XL

马上 👉 [开始使用](getting-started.md)

Expand Down
25 changes: 25 additions & 0 deletions docs/zh/docs/scan&watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 扫描与监视的细节

## 扫描的时机

扫描会通过以下四种方式触发:

* 启动 ComicLib 时,进行一次完整扫描
* ComicLib 启动后,当 `watch=True` 时,监视到 `content` 环境变量指示的目录下发生创建/修改事件(仅限于文件)
* 手动运行 `comicscan` 命令进行完整扫描
* 调用 `scan` 接口进行单一文件/文件夹扫描,如:

``` python
from comiclib.scan import scan
scan("content/comic/to/scan") # 路径应为 `content` 环境变量指示的目录的子路径
# 对于文件夹,这意味着尝试将该文件夹本身作为一个漫画,而不是搜寻其下的多个漫画
```

执行以上命令时使用相同的环境变量。如果设置涉及到相对路径,也要保持工作目录一致。

## 扫描的流程

* `content` 环境变量指示的目录下的所有文件/文件夹都是漫画的候选者
* 相对路径是漫画的重要标识。这意味着如果一本漫画被移动到了别处,ComicLib 会认为这是另一本漫画;重新扫描时会跳过同一路径的漫画,除非 `skip_exists=False`;将漫画库整体移到别处并修改 `content` 环境变量保持相对关系不变则不需要重新扫描。
* ComicLib 的主体仅负责遍历漫画库,漫画文件的判断都是通过[扫描脚本](scanner.md)完成的。当有一个[扫描脚本](scanner.md)承认该路径是漫画则计入数据库。
* 漫画的元数据解析、缩略图提取也是由[扫描脚本](scanner.md)负责。
7 changes: 2 additions & 5 deletions docs/zh/docs/scanner.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# 扫描脚本

ComicLib 的主体仅负责遍历漫画库,漫画文件的判断、解析等都是通过扫描脚本完成的
请先阅读 [扫描与监视的细节](scan&watch.md)

扫描脚本分为[内置脚本](https://github.com/ComicLib/comiclib/tree/master/comiclib/scanner)和外置脚本,所有工作目录下的 *.py 文件都会作为外置脚本加载。

对于每个候选漫画文件(夹),扫描脚本按照文件名的顺序(与是否内置无关)像流水线一样依次执行,完成不同的任务。

可以在[官方仓库](https://github.com/ComicLib/scanner)找到一些外置扫描脚本,也可以下载其他人编写的。另外,只要会一些简单的 Python 就可以自己编写。

默认情况下除了在启动时扫描一遍,也会在运行时监视漫画库。
遇到曾扫入数据库的漫画会跳过。
参考[设置](settings.md)以变更行为。

## 内置扫描脚本

### 10-zip.py
Expand Down Expand Up @@ -51,6 +47,7 @@ ComicLib 的主体仅负责遍历漫画库,漫画文件的判断、解析等
| `importEHdb_thumb` | 是否从中导入缩略图(`True`/`False`| `True` |
| `importEHdb_matchtitle` | 是否根据标题匹配(`True`/`False`/`exact`),`exact`为精准匹配,`True`模糊匹配 | `True` |
| `importEHdb_matchtorrent` | 是否根据种子标题匹配(`True`/`False`| `True` |
| `importEHdb_database_URI` | ehentai 元数据库的 [URI](https://www.sqlite.org/uri.html) | `file:api_dump.sqlite?mode=rw` |

根据 ehentai gid 匹配总是启用。

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "comiclib"
version = "0.0.4"
version = "0.0.5"
authors = [
{ name="URenko" },
]
Expand Down

0 comments on commit 2847313

Please sign in to comment.