Database API

Query and modify the database.

get
Get Statistics

http://lrr.tvc-16.science/api/database/stats
Get tags from in the database, in order of importance.
Request
Response
Request
Response
200: OK
JSON Array of {tag; weight} objects. Higher weight = Tag is more prevalent in the DB.
[
{"namespace":"character","text":"jeanne alter","weight":2},
{"namespace":"character","text":"xuanzang","weight":1},
{"namespace":"artist","text":"wada rco","weight":2},
{"namespace":"parody","text":"fate grand order","weight":3},
{"namespace":"group","text":"wadamemo","weight":2},
{"namespace":"","text":"artbook","weight":2},
]

post
🔑Clean the Database

http://lrr.tvc-16.science/api/database/clean
Cleans the Database, removing entries for files that are no longer on the filesystem.
Request
Response
Request
Response
200: OK
The database is cleaned, and the API returns how many items were removed/unlinked.
{
"operation": "clean_database",
"success": 1,
"deleted": 0,
"unlinked": 0
}

post
🔑Drop the Database

http://lrr.tvc-16.science/api/database/drop
Delete the entire database, including user preferences. This is a rather dangerous endpoint, invoking it might lock you out of the server as a client!
Request
Response
Request
Response
200: OK
LIVING IN THE DA TA BASE WOW WOW
{
"operation":"drop_database",
"success":1
}

get
🔑Get a backup JSON

http://lrr.tvc-16.science/api/database/backup
Scans the entire database and returns a backup in JSON form. This backup can be reimported manually through the Backup and Restore feature.
Request
Response
Request
Response
200: OK
Prints a backup JSON.
[
{
"arcid": "e4c422fd10943dc169e3489a38cdbf57101a5f7e",
"title": "rohan",
"tags": "language:english, parody:jojos bizarre adventure, character:rohan kishibe, date_added:1541778455",
"thumbhash": "f0a335a3562da03b61d69242b9562592eade06b9",
"filename": "rohan"
},
{
"arcid": "e69e43e1355267f7d32a4f9b7f2fe108d2401ebf",
"title": "saturn",
"tags": " language:english, parody:sailor moon, character:sailor saturn, date_added:1553537268",
"thumbhash": "631fb75a5aed97ee977783472e7d6b093c6df87d",
"filename": "saturn"
},
{
"arcid": "d1858d5dc36925aa66be072a97817650d39de166",
"title": "test title",
"tags": "",
"thumbhash": "9846bb6d62949b56545c42e88d8010446b65702e",
"filename": "[Memes]9B789D38B0784C5FBC9D59A9F24D20F2"
},
{
"arcid": "28697b96f0ac5858be2614ed10ca47742c9522fd",
"title": "Fate GO MEMO",
"tags": "parody:fate grand order, group:wadamemo, artist:wada rco, artbook, full color, super:test, date_added:1553537258",
"thumbhash": "ec2a0ca3a3da67a9390889f0910fe494241faa9a",
"filename": "FateGOMEMO"
}
]

delete
🔑Clear all "New" flags

http://lrr.tvc-16.science/api/database/isnew
Clears the "New!" flag on all archives.
Request
Response
Request
Response
200: OK
New flags are successfully removed
{
"operation":"clear_new_all",
"success":1
}