summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2015-12-30Add release filters to VN browserYorhel9-33/+71
2015-12-29Multi::API: Add support for TLSYorhel1-8/+23
2015-11-28VNPage: Generalize seiyuu listing to character summary listingYorhel3-74/+80
The comment already suggested this: I wonder whether it's better to just ask database for character list instead of doing this manual group/sort So yeah, let's just do that.
2015-11-26Modified cast block layout.morkt1-18/+24
2015-11-26Handler::VNPage: Fix character listing tabYorhel1-1/+1
2015-11-26Handler::Discussions: Fix display of username when editing postYorhel1-1/+1
2015-11-26Handler::VNPage: Move staff tab into main VN page + some styling changesYorhel2-51/+24
The styling of the staff info can be a bit awkward at times, but it looks slightly better than a table, IMO. I didn't really know what to do with the the seiyuu info - it wastes a lot of screen space in its current implementation, but I can't think of anything better at the moment.
2015-11-26Handler::Releases: Fix bug when editing release with lots of VNsYorhel1-1/+1
2015-11-26Multi::IRC: Fix auth bypass bug + make !quote admin-onlyYorhel1-2/+2
2015-11-14DB::VN: Fix undeterministic ordering on tag score in VN listingsYorhel1-1/+1
2015-11-11Misc poll improvementsYorhel4-210/+173
- Merged polls table into threads table. Not much of a storage/performance difference, and it's a bit simpler this way. - Merged DB::Polls into DB::Discussions. Mainly because of the above change in DB structure. - Add option to remove an existing poll. - Allow preview and recast to be changed without deleting the votes - Set preview option by default. Because personal preferences. :) - Minor form validation differences
2015-11-10Merge branch 'poll' of https://github.com/morkt/vndb into pollsYorhel4-1/+259
2015-11-10various fixes.morkt1-45/+46
2015-11-10Show full date/time at edit history and thread listingsYorhel2-2/+2
Having the time display is quite useful. It does make the listings look more cluttered, but meh.
2015-11-10Merge branch 'master' into pollmorkt30-767/+820
2015-11-10Add 'has screenshots' filter to VN browserYorhel1-1/+1
2015-11-10Add language filter to staff browserYorhel2-1/+2
2015-11-02DB::VN: Fix dbVNHasStaff() query when VN has only seiyuu and no staffYorhel1-1/+1
2015-11-01Util::LayoutHTML: Suppress warning when $o{search} isn't definedYorhel1-1/+1
2015-11-01Remove 'you need to be logged in to edit this page' messageYorhel1-5/+1
While helpful, it's also rather dominant. We're not that desperate for new contributes anymore.
2015-11-01Use HTML5 'placeholder' attribute for main search boxYorhel1-1/+1
Instead of the JS hack.
2015-11-01Image viewer: Use HTML5 data- attribute instead of 'rel' for dataYorhel1-2/+2
The possible values of the rel attribute is fixed, it's not supposed to be a free-form field.
2015-11-01Switch to HTML5 doctype + s/acronym/abbr/ + s/ / /eYorhel6-20/+15
I'd have preferred to stick with XHTML 1.0, but unfortunately browsers won't allow you to use modern Javascript APIs with an older doctype. Note that most pages don't actually validate correctly as HTML5, I'm relying on browsers to be lenient. In either case, I'd like VNDB to stay valid XML (XHTML5, then), and luckily that shouldn't be a problem.
2015-11-01DB::(Producers|VN): Convert svg column to perl encoding when fetchingYorhel2-0/+3
DBD::Pg doesn't recognize the 'xml' data type as textual data, and thus doesn't decode it for us. This fixes the display of non-ASCII characters.
2015-11-01Removed support for sha256-hashed passwordsYorhel2-26/+3
They had to be deleted from the database at some point, otherwise we still have thousands of easily-cracked password hashes in the database. Note that I could have opted to use scrypt on top of the sha256 hashes so the passwords would remain secure without needing to reset everything, but doing that after one year of switching to scrypt is likely not worth it. Everyone who still actively uses his account has already been converted to scrypt, everyone else should just reset their password whevener they decide to come back.
2015-11-01Remove deprecated 'staffedit' permission flagYorhel2-4/+2
2015-11-01Handler::VNEdit: Also increase size of title fields in VN add formYorhel1-2/+2
2015-10-28Handler::(Releases|VNEdit): Increase width of title/orig input fieldsYorhel2-4/+4
2015-10-28Handler::Users: Don't hide list stats from own user or usermodsYorhel1-3/+4
2015-10-25DB::Discussions: Fix bug in 'notusers' queryYorhel1-1/+1
'<> ANY' doesn't work that way. NOT EXISTS() is also pretty fast and does what we want.
2015-10-25Multi::Anime: Avoid dead state when trying to fetch anime infoYorhel1-2/+2
Turns out the anime data hasn't been updated in a few months. Oops.
2015-10-25DB::ULists: Revert change from 'numeric' to 'float' to fix vote graphsYorhel1-2/+2
Broken in bbe989de364ddc654bfc6385e22f1eaff23faad1. I forgot that floats can't accurately represent some .5 numbers.
2015-10-25DB::Discussions: Minor improvement to post <-> board filter query2.25Yorhel1-1/+1
I don't know why I didn't apply this one before, I did make this change when benchmarking the fulltext search queries and with the introduction of the bb_tsvector() function this change pretty much always improves performance.
2015-10-25Staff: Add error msg when removing used alias + fix bug in alias editingYorhel2-3/+9
The new database schema doesn't allow an alias to be removed when it is still linked to a VN.
2015-10-24DB::Staff: Fix 'aid' filter, used when editing VN staff infoYorhel1-1/+1
This broken filter would cause all staff info to be deleted from a VN upon edit. Not so nice.
2015-10-24SQL: Throwing around some indicesYorhel1-2/+2
These indices provide a significant speed-up of /v+ and /u+ pages, and improve some other stuff as well.
2015-10-24Improve several discussion board SQL queriesYorhel1-8/+14
An index on threads_posts.date was necessary to speed up some very common "recent posts" queries on both the homepage and the thread index. Postgres thought that the same index could be used to speed up the full-text search (because it's ordered by date, after all), but that completely killed performance. That was solved with a bb_tsvector() wrapper to tell the query planner that not using the full-text index is incredibly show, which in turn improved the search performance beyond what it was. Many thread-related queries are still somewhat slow, but that seems to be a limitation in the schema. I'll just keep monitoring to see if that's worth fixing in the future. Interestingly, dbThreadCount() needs to use a sequential scan, but it's still remarkably fast.
2015-10-21Improve SQL in dbRevisionGet()Yorhel3-49/+35
Two main improvements: - Filtering on (non)hidden items now doesn't join any of the item tables, instead it looks up the latest revision from the changes table itself, using the index on (type,itemid,rev). It's still not super fast, but a pretty large improvement nonetheless. - The item titles/names are obtained in a separate query. I tried to modify the main query in various ways, but couldn't make it as fast as I'd have liked. I also removed the 'what' flag while I was at it, all uses of the method request all information anyway.
2015-10-21SQL: Fix Multi to use the new DB schemaYorhel5-163/+145
That should be the last thing to convert to the new schema.
2015-10-21SQL: Fix editing + func.sql + triggers.sql + autocreate editing funcsYorhel10-52/+51
This changes quite a bit to the way the editing functions work. Because these functions are very repetitive and it's easy to keep things out of sync, I created a script to generate them automatically. I had to rename a few function and table names for consistency to make this work. Since database entries don't have a 'latest' column anymore, and since the order in which tables are updated doesn't have to be fixed, I dropped many of the SQL triggers and replaced them with a edit_committed() function which is called from edit_*_commit() and checks for stuff to be done. Don't forget to run 'make' before importing the update script.
2015-10-18discussion board polls.morkt3-1/+163
2015-10-18discussion board polls.morkt1-0/+95
2015-10-17SQL: Fix all browsing queries to use the new schemaYorhel19-436/+540
This basically makes VNDB browsable again, but editing entries is still broken. I split off the get-old-revision functionality from the db*Get() methods into db*GetRev(). This split makes sense even with the old SQL schema: db*Get() had to special-case some joins/filters when fetching an older revision, and none of the other filters would work in that case. This split does cause some code duplication in that all db*GetRev() methods look very much alike, and that the columns they fetch is almost identical to the db*Get() methods. Not sure yet how to avoid the duplication elegantly. I didn't do a whole lot of query optimization yet (most issues require extra indices, I'll investigate later which indices will make a big difference), but I did fix some low hanging fruit whenever I encountered something. I don't think I've worsened anything, performance-wise.
2015-10-12Notifications: Allow max 500 notifies per user + add SQL index on uidYorhel1-0/+2
Turns out that fetching whether or not you have unread notifications (done on every pageview if you're logged in) was pretty slow. The index speeds up both that query and the "my notifications" view. The extra purge for old notifications for users with more than 500 notifications ensures that the index stays effective for the unread notifications count. Otherwise it'll have to read half of the notifications table anyway to check the 'unread' filter.
2015-10-11VNDBUtil: Add some tildes to VN search normalizationYorhel1-1/+1
2015-10-03formValidate: Add json_(maxitems|unique|sort) options to json templateYorhel2-38/+13
Adds slightly more strict validation and simplifies further processing.
2015-10-03js: Minor fixesYorhel1-1/+1
2015-10-03Handle JSON data natively when processing form dataYorhel5-37/+45
No more need for extra json_encode/json_decode calls, and the form_compare() function is more lenient w.r.t. integer/string comparison. This is the improvement I described in commit ed86cfd12b0bed7352e2be525b8e63cb4d6d5448
2015-10-03Rewrote screenshot uploader to support multiple files + use jsonYorhel2-28/+24
This might have broken the screenshot uploader on some crappy browsers, but it's much cleaner than the old iframe hack. The ability to upload multiple files in one go is also very convenient.
2015-10-01VNEdit: Give error on duplicate alias + improved msg on id/page errorYorhel2-9/+10