diff options
author | Yorhel <git@yorhel.nl> | 2021-02-12 10:16:02 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-03-01 10:16:33 +0100 |
commit | fc3721171f021807d1c8b23a5257fc1ac1809ea5 (patch) | |
tree | bcd63e797e26e17d73be02d90ea52b4f5c2da497 /lib/VNWeb/Elm.pm | |
parent | 86d0191251fc80205dce92369b9b661cb40a3707 (diff) |
SQL: vndbid data type conversion for most DB entries
I had wanted to split this up into multiple commits and roll out in
stages, but couldn't really find a natural way to do so. There are
several places that take a generic identifier and expect it to work the
same for all entries they support, so changing one entry at a time
wasn't going to be any easier. Only the tags & traits haven't been
updated yet, I'll convert those later.
While this is a major change and affects a lot of code, the individual
changes are all pretty simple. I'm surprised how much code did not have
to be updated at all. No doubt I've missed a few places, though, so this
commit will almost certainly break something.
Diffstat (limited to 'lib/VNWeb/Elm.pm')
-rw-r--r-- | lib/VNWeb/Elm.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/VNWeb/Elm.pm b/lib/VNWeb/Elm.pm index 04a05100..62f7aaf0 100644 --- a/lib/VNWeb/Elm.pm +++ b/lib/VNWeb/Elm.pm @@ -58,7 +58,7 @@ our %apis = ( name => {}, } } ], Releases => [ { aoh => { # Response to 'Release' - id => { id => 1 }, + id => { vndbid => 'r' }, title => {}, original => { required => 0, default => '' }, released => { uint => 1 }, @@ -77,8 +77,8 @@ our %apis = ( count => { uint => 1 }, } } ], BoardResult => [ { aoh => { # Response to 'Boards' - btype => {}, - iid => { required => 0, default => 0, id => 1 }, + btype => { enum => \%BOARD_TYPE }, + iid => { required => 0, vndbid => ['p','v','u'] }, title => { required => 0 }, } } ], TagResult => [ { aoh => { # Response to 'Tags' @@ -99,29 +99,29 @@ our %apis = ( group_name => { required => 0 }, } } ], VNResult => [ { aoh => { # Response to 'VN' - id => { id => 1 }, + id => { vndbid => 'v' }, title => {}, original => { required => 0, default => '' }, hidden => { anybool => 1 }, } } ], ProducerResult => [ { aoh => { # Response to 'Producers' - id => { id => 1 }, + id => { vndbid => 'p' }, name => {}, original => { required => 0, default => '' }, hidden => { anybool => 1 }, } } ], StaffResult => [ { aoh => { # Response to 'Staff' - id => { id => 1 }, + id => { vndbid => 's' }, aid => { id => 1 }, name => {}, original => { required => 0, default => '' }, } } ], CharResult => [ { aoh => { # Response to 'Chars' - id => { id => 1 }, + id => { vndbid => 'c' }, name => {}, original => { required => 0, default => '' }, main => { required => 0, type => 'hash', keys => { - id => { id => 1 }, + id => { vndbid => 'c' }, name => {}, original => { required => 0, default => '' }, } } @@ -132,7 +132,7 @@ our %apis = ( original => { required => 0, default => '' }, } } ], ImageResult => [ { aoh => { # Response to 'Images' - id => { }, # image id... + id => { vndbid => ['ch','cv','sf'] }, token => { required => 0 }, width => { uint => 1 }, height => { uint => 1 }, @@ -150,7 +150,7 @@ our %apis = ( } }, votes => { unique => 0, aoh => { user => {}, - uid => { uint => 1, required => 0 }, + uid => { vndbid => 'u', required => 0 }, sexual => { uint => 1 }, violence => { uint => 1 }, ignore => { anybool => 1 }, |