bbappserver / hydrus-userpatch

Community patches for Hydrus, a personal booru-style media tagger that can import files and tags from your hard drive and popular websites. Content can be shared with other users via user-run servers.
http://hydrusnetwork.github.io/hydrus/
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Collection Support #15

Open bbappserver opened 5 years ago

bbappserver commented 5 years ago

A collection may have ordered or unordered members, and may have a single parent( could be multiple but that complicates things)

For example

franchise: {manga series x, manga series y}
manga_series x: [volume x1, volume x2] { special xx, special xy}
manga_series y: [volume y1, volume y2] { special yx, special yy}
volume x1: [page 1, page 2, ...] {pinup page}

Here franchise has no parent, and contains two unordered elements manga_series has two volumes that go in order, and two specials that go in any order and those volumes have pages that go in order and some extra material.

In sqlite that looks like this

CREATE TABLE collection(id int,parent_id int NULL REFERENCES collection(id),name text);
CREATE TABLE file_collection(file_id REFERENCES file(id),
collection_id int REFERENCES collection(id),index unsigned int NULL);

Display the first leaf as a cover photo and the name, when clicked, pop open a new thumb grid, maintaining the stack of thumb grids and a breadcrumb at the top.