You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/docs/scanner.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,13 @@ This return value is also used as a reference for subsequent scripts.
104
104
Parameters of `Scanner.scan`:
105
105
106
106
*`path`: file/directory path for the input comic.
107
-
*`id`: Unique ID generated by ComicLib, do not attempt to write this value.
108
-
*`metadata`: Metadata obtained after processing by the previous script. The fields include `title`, `subtitle``source`, `pagecount`, `tags`, `categories`. The initial values are `None` or `set()`. scanners write the resulting metadata into this `dict`.
107
+
*`id`: The unique ID pre-generated by ComicLib, which is a hash of the relative path to `CONTENT`. The database uses the ID given by `metadata[id]` instead, see the description of custom ID below.
108
+
*`metadata`: Metadata obtained after processing by the previous script. The fields include `id`, `title`, `subtitle``source`, `pagecount`, `tags`, `categories`. The initial values are `None` or `set()`, except for `id`. scanners write the resulting metadata into this `dict`.
109
109
*`prev_scanners`: The name of the script that previously returned `True`.
110
+
111
+
!!! example "custom ID (Experimental)"
112
+
ComicLib first pre-generates a unique ID based on the path, starting with `00` as the value of the parameter `id`. Initially this ID is the same as `metadata[id]`.
113
+
The scanner can generate a new ID based on `id`, `metadata[id]` modified by the previous scanning script and other information, and write it into `metadata[id]`.
114
+
It is generally agreed that the first two characters of the ID represent the meaning of the ID. For example, the built-in scanner 30-importEHdb.py uses `EH` to represent its designed ID with ehentai gid information.
115
+
The final `metadata[id]` is written to the database as a unique identifier for the comic.
116
+
ID must be unique, and be 40 characters. Custom IDs will not work for updating metadata during rescanning
0 commit comments