Skip to content

Database

RobbWatershed edited this page Oct 2, 2018 · 11 revisions

Database model (dev branch)

Attribute table

This table describes all the attributes of all books. If many books have the same attribute, it only appears once in that table; the N-N links are managed through the content_attribute table.

NB : The "url" field is not usable, as it only contains the url from the first site it was downloaded from. In other words, if you download two books tagged with "elf" : one from site A and the other from site B, the line describing the tag "elf" will only refer to the url for tag "elf" in site A. Site B url will completely be ignored.

Field Description Example
id Primary key / unique identifier 198120505
url Relative url to attribute page in the first site where the attribute was first downloaded from /tag/sole-male/
name Attribute name sole male
type Attribute type - See AttributeType class : ARTIST(0), PUBLISHER(1), LANGUAGE(2), TAG(3), TRANSLATOR(4), SERIE(5), UPLOADER(6), CIRCLE(7), CHARACTER(8), CATEGORY(9) 3

Content-Attribute table

Used to handle N-N relationship between content and attribute tables

Field Description Example
content_id Part of primary key; refers to the id field in the content table -922656221
attribute_id Part of primary key; refers to the id field in the attribute table 198120505

Content table

Content describes a book in your collection

Field Description Example
id Primary key / unique identifier. Value is the hashCode of the url field -922656221
unique_site_id Unique identifier of the book in its original site 36257
category If any related attribute is of type "Category", it is displayed here doujinshi
url Relative url of the book in its origin site /229071/
html_description unused
title Title of the book Fate/Luck GEAR material
qty_pages Number of pages 30
upload_date unused 0
download_date Timestamp of the moment when the book was downloaded in the library 1520406092301
status Download status of the book - See StatusContent class : SAVED(0), DOWNLOADED(1), DOWNLOADING(2), PAUSED(3), ERROR(4), MIGRATED(5), IGNORED(6), UNHANDLED_ERROR(7), CANCELED(8) 1
cover_image_url Absolute URL of the cover picture of the book in its origin site http://a.com/5/cover.jpg
site Code of the origin site - See Site class : FAKKU(0), PURURIN(1), HITOMI(2), NHENTAI(3), TSUMINO(4), HENTAICAFE(5), ASMHENTAI(6), ASMHENTAI_COMICS(7) 1
author If any related attribute is of type "Artist" or "Circle", it is displayed here kakao
storage_folder Relative folder (to the Hentoid root folder) where the images of the book are stored /Pururin/[35925]

Image file table

Used to keep track of download progression of a given book by tracking the download status of each of its pages

Field Description Example
id Primary key / unique identifier -2077566210
content_id Refers to the id field in the content table -922656221
order_file order of the page in the corresponding book 5
url url of the image in the origin site http://a.com/5/05.jpg
name Name of the image file to be created on the phone 005
status Download status of the image - See StatusContent class : SAVED(0), DOWNLOADED(1), DOWNLOADING(2), PAUSED(3), ERROR(4), MIGRATED(5), IGNORED(6), UNHANDLED_ERROR(7), CANCELED(8) 1

Queue table

Describes the contents of the current download queue

Field Description Example
content_id Refers to the id field in the content table -922656221
rank order of the book in the download queue 1

NB : There is no guarantee that the ranks will start from 1 and increment by 1; the idea is to have an order regardless of the actual values