-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
80 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)负责。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters