Kara classification V2 + Implications on implementation
Principle
Try a new way to store the kara types/categories. This will be applied later to kurisu. Try to break the changes in multiple MR!
The TODO list
MKV
We don't place tags in the MKV, too complicated. We will save it in the DB or in a JSON file…
In the future, we can opt for an offline distribution of the base, and pack everything in a tar or zip file, but the installation of that database will be done with another executable and not lektord
/amadeus
.
We can use the same files as the patch files, the video files will have a path computed by the name of the repo and the id in that repo.
LKT
-
Be more modular for types/categories with lkt
-
lkt
may querylektord
for available categories/types/languages -
lkt
may do the query without checking for the type/category/language existence → verify thatlektord
is OK with invalid URIs
Lektord
-
Tag/Sticker edition should be a protected command, only admins should be able to do it. -
Add a way to identify who do some commands → add an author for playlists, etc. -
Add a link table, which is just a (kara_id, kara_id)
list of tuples, forming a non-oriented graph between the karas.
URI change
-
Add a way to return the links alongside a search. We can add the query+link://
URI for example, which will be like thequery://
but will also return the first level of links of matched karas.
Amadeus-rs
-
Allow for editing tags locally, and generate a (JSON+TOML, it won't make any difference from the rust code) patch to be sent to kurisu or other servers to be approved by admins and integrated in their database. The structure of the described data would be : - the name and the date and a little description
- one table per repo (in the example, we patch repo "kurisu" and "bakaback")
- for each table, the key is the ID local to the repo
- for each kara we have the mandatory fields and a "tags" sub-table with which fields to add or remove if they are set to
false
- we use the same mechanism for languages, the one to add are marked as true, the ones to remove are marked as false
-
We will use such files to have offline installs of the database.
To generate a file to export/import tags modifications through amadeus (without touching to lektor), we can:
- override fields in Amadeus, overwriting what lektor send to the client
- generate a TOML file for all the changes, or filter by database
- anyone can take that file and import it into Amadeus or admins can use it for Kurisu
- when an override does not change a field in a kara, we delete it from the local client override list (to avoid having growing sizes of overrides)
The plus for TOML file is that they could be even be written by hand.
The TOML format can be something like that
author = "Bakateux"
date = 4567898765456789
description = "Random patches..."
[kurisu.4100]
name = "toto"
source = "tata"
karamakers = [ "1", "2", "3" ]
type = "OP"
origin = "anime"
[kurisu.4100.language]
fx = true
ot = false
[kurisu.4100.tags]
vo = true
version = "short"
number = 10
platform = "PS4"
[bakaback.5]
type = "ED"
[bakaback.100.tags]
vo = false
The JSON equivalent could be something like that
{
"author": "Bakateux",
"date": 4567898765456789,
"description": "Random patches...",
"kurisu": {
"4100": {
"name": "toto",
"source": "tata",
"karamakers": [ "1", "2", "3" ],
"type": "OP",
"origin": "anime",
"languages": {
"fx": true,
"ot": false
},
"tags": {
"vo": true,
"version": "short",
"number": 10,
"platform": "PS4"
}
}
}
}
To read TOML file, we can parse them manually or use something like the following, which are 0.4 compliant. In the example above, we are only using TOML in version 0.4 (from the TOML wiki pages). Here, the plus for php-toml
is that it's a one file library. We could also use a python script, python 3.11 contains tomllib
as part of the standard library.
- PHP (@betrixed) - https://github.com/betrixed/Toml-Pun8
- PHP (@leonelquinteros) - https://github.com/leonelquinteros/php-toml.git
- PHP (@yosymfony) - https://github.com/yosymfony/toml
The new classification be like
Fields
Mandatory single fields:
- Source name: the name of the serie, the game, the album, the franchise, etc
- Title: the title of the song
A list of karamakers, because multiple persons can have contributed to the kara or edited it:
- Karamakers
Special counters
The favorites
counter tels the number of playlists in which the kara is present in. It is automatically computed.
Flags
-
is_dl
: mark if a kara was downloaded or not. If a kara is not downloaded, it can return its links, but won't be listed for the user. -
is_virtual
: mark if a kara is virtual. A virtual kara will never be listed, but its links will be returned if the virtual kara matches a search.
Type (only one)
-
OP
→ Anime/Games/VN openings -
ED
→ same, but with endings -
IS
→ Insert Song -
MV
→ Music Video -
OT
→ other
Origin (only one)
The music can only have one origin. If a music is present in a game and an anime, either the first version is chosen or the version that is timed.
-
anime
→ old vo+va -
vn
→ part of cdg -
game
→ part of cdg -
music
→ will contain MV -
autre
→ Joker
Language (at least one)
-
jp
,fr
,en
,ru
: ISO 639-1, tout, tout… + other meta-languages -
ie
: multiple language -
fx
: other language that is defined -
ot
: the joker language, for something that is not fictional but is not a real language - all unknown languages that are still present on kurisu will be added, but the ISO flag will be
false
, and the macro one will betrue
. The description will be generated likeCustom language: {insert custom code}
.
Tag (multiple is possible, or none)
Tags are *
relations, they are entirely optional. They are just present to facilitate researching the database. No constraints are applied to them, they are just (kara_id, tag_name, tag_value)
tuples.
Present or not:
-
vo
→ Original version -
va
→ 'version autre', a modified version, because it's from another country, etc -
amv
→ animated music video -
voca
→ vocaloid -
vtuber
→ VtUbEr -
pv
→ trailers -
live
→ with real human beings -
cdg
→ the good old cdg, handy to have -
movie
→ Movie/Series with real humans -
western
→ western animation -
official
→ official things -
meme
→ meme / internet spoiler
epilepsy
nsfw
With fixed value:
-
version
:short
|long
|cover
|alternative
Counters. Note that no check will be done on whether the counter is in fact an integer, the only thing that matters is that it's a valid UTF8 string. With that, we can have openings with non-numerical ordering, like OP 1A
or ED alternative
. While it's not recommended, it's still possible.
-
number
:\d+
With arbitrary values, in lists:
-
platform
: DS/Switch/PS3/PC98/… -
artist
: … -
singer
: … -
songwriter
: … -
studio
: … -
serie
: … -
label
: …