summaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)AuthorFilesLines
2019-11-10ulist: Use lower numbers for custom labels + add VN listingYorhel1-54/+17
2019-11-10ulist: Add data model for new lists + Perl/Elm for label managementYorhel2-0/+135
Very much experimental. I'm not sure this is even the right model.
2019-11-08Wikidata: Add support for doujinshi.org author linksYorhel2-1/+3
2019-11-02Add character age field + conversionYorhel2-8/+31
2019-11-02Add character cup size field + conversion + filterYorhel3-2/+57
2019-10-17Fix the devdumpYorhel1-2/+2
2019-10-13Sort languages by name rather than tagYorhel1-1/+1
https://vndb.org/t950.634
2019-10-10rewards: Add user settingsYorhel3-5/+23
They don't do anything yet.
2019-10-07SQL: Improve performance of update_vnpopularity()Yorhel1-15/+12
Goes from 1.5 minutes to 1.5 seconds. Temporary views instead of CTEs and self-joins instead of window functions. That code was *old*.
2019-10-07SQL: Perform incremental updates on traits_chars when characters are editedYorhel2-9/+22
Same thing as 65ed955890c7ee7250a2bce4467c8c092c1bbbbe, with the same limitations (except this does take hiding/unhiding characters into account).
2019-10-07SQL: Perform incremental updates on tags_vn_inherit when tags are modifiedYorhel2-10/+22
This has some limitations: - tags.c_items is not updated, so that may be out of sync. (The UPDATE takes about 400ms, so doing that more regularly from Multi::Maintenance should be a viable option) - When the hidden flag of a VN is changed, the tags will also be out of sync. - I don't see a way to do fast incremental updates when tag entries themselves are changed, e.g. to handle changes in the tag tree or searchable flag
2019-10-07SQL: Adjust tag_vn_inherit and trait_chars calculationsYorhel5-53/+51
Most importantly, downvoted parent tags are now still included for searching as per https://vndb.org/t12750 - in particular, a downvoted tag is considered to be exactly the same thing as a tag with no votes at all. Also made a few other adjustments: - Removed the "ignore child tags/traits if parent has its own value" rule. This was done because the 'spoiler' rating would get inherited using the average, but that should just have been the minimum (i.e. if a single child tag is not a spoiler, then neither is the parent). https://vndb.org/t10082 - The score of a parent tag is now avg(avg(votes_on_child_tags)) rather than avg(votes_on_child_tags), i.e. tags with more votes don't have more weight than tags with fewer votes. I don't think vote counts really matter in determining the parent score. - Deleted VNs now don't count towards tag statistics (this is consistent with traits). - Performance improvements: Smaller indices and more clever querying.
2019-10-03Disallow changing email address to one already used by another accountYorhel2-2/+3
2019-10-03Require email confirmation when changing email addressYorhel3-8/+29
This ensures that the email address linked to a user is always valid and actually belong(s|ed) to that user.
2019-10-03SQL: Add session types + use sessions for password reset tokensYorhel3-22/+41
This improves the password reset workflow a bit. The users.passwd field is now no longer used for reset tokens, meaning that the current password isn't affected until the user actually clicks the link and changes it. It is now also possible to have multiple active password reset tokens, in case one of the emails got lost. All existing tokens are invalidated when the user finally changes their password. Tokens are now valid for at most 1 week instead of indefinitely.
2019-10-03SQL: Change sessions.lastused into sessions.expiresYorhel4-13/+18
This will be helpful when adding other types of sessions with different expiration.
2019-10-03Fix spoilers preference to be a smallint rather than booleanYorhel2-3/+3
And for those who (like me) already applied update_20191003.sql, here's a partial fix: alter table users alter column spoilers drop default; alter table users alter column spoilers type smallint using (case when spoilers then 1 else 0 end); alter table users alter column spoilers set default 0; But you'll still need to import the old preference for users who had spoilers=2, because those will have been lost.
2019-10-03SQL: Get rid of the users_prefs table, store preferences in users tableYorhel7-43/+84
This bloats the users table a little bit, but that's fine. The main advantage of this change is that we now have a proper schema for user preferences, rather than the schemaless key-value mess we had before. This commit also splits the 'tags_cat' preference up into tags_cont, tags_ero and tags_tech bools, as that's more compact to store and easier to work with. This commit also changes the 'notify_nodbedit' preference to 'notify_dbedit' with inverted meaning. The reason the value was negated in the first place was because the old schemaless approach did not support positive defaults.
2019-09-27Add Malay languageYorhel2-1/+2
Sorry for re-using update_20190923.sql, but I'm not sure anyone even uses those scripts. For documentation purposes it's neat to have similar things in a short time window combined, anyway.
2019-09-26Disallow usernames that look like DB identifiers + minor BBCode fixYorhel1-3/+3
A '-' before or after a DB identifier now counts as a "word character", meaning in "d5-something" won't turn that "d5" into a link.
2019-09-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-2/+36
Most of this is copied from v3. I did improve on a few aspects: - db_edit() and db_entry() use VNDB::Schema rather than dynamically querying the DB. This has the minor advantage of a faster startup. - The Elm code generator now writes to multiple files, this avoids the namespace pollution seen in v3's Lib.Gen and makes the dependency graph a bit more lean (i.e. faster incremental builds). - The Elm code generator doesn't update the timestamp of files that haven't been modified. This also speeds up incremental builds, the elm compiler can now skip rebuilding unmodified files. - The Elm API response generator code now uses plain functions rather than code references and all possible responses are now defined in Elm.pm. Turns out most API responses were used from more than a single place, so it makes sense to have them centrally defined. The doc page preview function is also much nicer; I'd like to apply this to all BBCode textareas as well. (Elm.pm itself is ugly as hell though. And we will prolly need some HTML form generation functions in Elm to make that part less verbose)
2019-09-24Add language: Scottish GaelicYorhel2-1/+2
2019-09-23Add 4 new languagesYorhel2-1/+5
https://vndb.org/t12897.6
2019-09-18v2rw: Convert authentication code to VNWeb::AuthYorhel1-53/+33
More churn! Also converted v3 to use VNWeb::Auth, considering the API is pretty much the same. Converted VNWeb::* to use VNDB::Config directly rather than read from tuwf->{}, converted VNWeb::HTML to use VNWeb::Auth, and updated util/vndb.pl with the new code style. I tested as much as I could, but I'm sure I broke something.
2019-09-17v2rw: Initial start on an incremental rewrite; Layout HTML firstYorhel1-1/+1
I copied and modified VN3::DB to VNWeb::DB, but it isn't used yet. Now that I think about it, that module isn't "web" specific at all and should perhaps be in the VNDB:: namespace. Oh well.
2019-09-17Rename VNDBSchema to VNDB::Schema and let it figure out the root path itselfYorhel3-7/+7
I always avoided using the VNDB::* schema for non-web related utility modules, but thats pretty silly (especially as I'm slowly trying to move away from the old VNDB::* web code).
2019-09-17Don't send db edit notifications for changes made by MultiYorhel1-0/+1
2019-09-14SQL: Replace "shop_*.found" with "deadsince" timestampYorhel2-4/+23
Has the inverted meaning. Keeping track of how long we've been unable to find a certain shop link is useful in weeding out temporary unavailability when querying for dead links.
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel5-51/+24
This gets rid of global.pl, config.pl and config3.pl and uses the cleaner config3.pl format for the config file. The config is easily accessible from anywhere by importing the new VNDB::Config module; The global $VNDB::S,O,M,ROOT variables have been removed. Sorry for all the churn...
2019-09-12VNDB::Types: Convert medium & resolutionYorhel1-7/+7
2019-09-12VNDB::Types: Convert age_rating and release_typeYorhel1-2/+2
2019-09-12VNDB::Types: Convert animated & voicedYorhel1-2/+2
2019-09-11VNDB::Types: Convert vn_lengths, anime_types and tag_categoriesYorhel1-1/+1
2019-09-11VNDB::Types: Convert char_roles, blood_types and gendersYorhel1-3/+3
2019-09-11VNDB::Types: Convert (wishlist|rlist|vnlist)_statusYorhel1-1/+1
I did create a function to export arrays, but ended up exporting them as hashes. That ought to simplify a conversion to an enum type. Which will likely never happen because I'd rather switch to dynamic user-defined statuses, but that's quite a step further...
2019-09-11VNDB::Types: Convert platforms into %PLATFORMYorhel1-1/+1
2019-09-11VNDB::Types: Convert languages into %LANGUAGEYorhel1-1/+1
2019-09-11VNDB::Types: Convert staff_roles into %CREDIT_TYPEYorhel1-1/+4
Part one in converting data/global.pl lists into a separate VNDB::Types module. This is basically what I had started with VN3::Types, but it looks like a gradual rewrite/cleanup may be more successful. At least it'll be more useful on the short term.
2019-09-09spritegen.pl: Move compression to "make prod"Yorhel1-10/+1
I think this is the last one. 'make' in a development environment is now beautifully fast and 'make prod' generates nicely small assets. (arguably we could have an even faster dev setup by not generating an icons.png in the first place, but then we'd need more code to differentiate between dev & prod, which is also a pain) This change does remove the "slow" option that would use the compressed image size in the optimization algorithm, but I hadn't used that option for a while anyway, it takes an hour and only saves about 100 bytes.
2019-09-09JS/Build: Move minification and compression to "make prod"Yorhel1-29/+3
Similar to previous commit.
2019-09-09CSS/Build: Move minification and compression to "make prod"Yorhel1-17/+10
This rather significantly speeds up development builds. Also simplifies skingen.pl and its config a bit. The new compressed files are written to /s/*/style.min.css{,.gz}, it is up to the web server to serve those instead of /s/*/style.css.
2019-09-09CSS: Get rid of boxbg.png and Image::Magick dep in skingen.plYorhel1-20/+31
Should improve page loading time, reduce server load and speed up CSS generation by a totally insignificant amount. I did run into some trouble with the removal of boxbg.png, because apparently there was something magical about that image that made browsers render it in a different color than the one specified upon creation. I've adjusted the boxbg color of the 'angel' skin accordingly, but other skins may also have a slight color difference with this change. Some details are at http://s.blicky.net/19/colortest.html
2019-09-03Add Pixiv ID to staff entriesYorhel2-2/+28
2019-09-03Now with the update scriptYorhel1-0/+7
2019-09-03Fetch some more IDs from Wikidata + display IGDB & Pixiv linksYorhel1-1/+8
2019-09-03Clean up old update scriptsYorhel64-4273/+0
These have no value anymore at this point. And if they have, they'll still be in the git history.
2019-09-02Minor cleanup of l_wp/l_encubed link codeYorhel1-4/+4
The fields are still there in order to keep the edit history somewhat sensible, but we don't need this additional code.
2019-09-02Allow multiple Gyutto & DMM links per releaseYorhel2-4/+16
To handle https://vndb.org/t12755.37
2019-09-01Add ErogeTrailers.com links to releasesYorhel2-4/+8
2019-09-01Add EGS links to releasesYorhel2-2/+8