Commit graph

31 commits

Author SHA1 Message Date
5514a8d1e1 fix utc datetime generator
m(
2021-07-25 18:06:17 +02:00
fe5db535a9 add route to check state of latest IMDb movie import 2021-07-25 18:06:17 +02:00
1fd592cb1d fix imdb data dir in script 2021-07-25 18:06:17 +02:00
8d20cc040e add IMDb vote count to movies 2021-07-25 18:06:17 +02:00
af25d9c5a2 change the container to be more production ready
This includes the code files in the docker image and creates a separate
data dir, which means we don't need to manually mount files into the
container anymore.
2021-07-25 18:06:17 +02:00
24aabd43f2 exclude *.local from git 2021-07-25 18:06:17 +02:00
4193c32955 add locking & progress report to IMDb import (web) 2021-07-25 18:06:15 +02:00
5ad4946f5b fix percentage reporting semantics
This wasn't actually (much) broken, but we got burnt because percent
should mean [0, 100], not [0, 1].
2021-07-11 18:59:01 +02:00
cc0ba96a9e add route for admins to list all groups 2021-07-11 17:24:52 +02:00
88fa1355cd remove transaction from imdb import
Removing the transaction will allow other (async) operations to succeed
while the import is running, otherwise the database will be locked.
It also actually speeds up the import process, and there's no good
reason to roll back if the import aborts mid run.
2021-07-11 17:23:19 +02:00
294e311aff add new admin routes to trigger database updates
The two routes offer reloading the whole movie database from IMDb, and
reloading all users' IMDb ratings.
These functions (or very similar) were already available using the CLI,
but now they can be triggered remotely by an admin.
2021-07-10 19:32:08 +02:00
1805282d41 refactor loading of imdb ratings to yield loaded ratings 2021-07-10 01:43:24 +02:00
1ad7a79d33 add a Relation type to models to store related model data
Any field marked as Relation is ignored by all model operations (like
converting to and from plain form).  Fields marked as Relation are
meant to store the actual model data for foreign keys stored on the
model.
2021-07-10 01:34:38 +02:00
b081371d27 use decorator to add routes 2021-07-08 21:19:43 +02:00
edb2fa5069 add auth using bearer tokens
These tokens are used to gain global admin rights, or to gain more
resource specific capabilities, like adding users to a group.
2021-07-08 14:38:08 +02:00
cd42b95e49 remove imdb users from config, load from db 2021-07-08 09:57:33 +02:00
60f0152f9d add route to list all users 2021-07-08 09:50:13 +02:00
75391b1ca2 replace legacy ratings route with group ratings 2021-07-08 09:48:54 +02:00
a39a0e6442 fix elapsed to always use floating point notation 2021-07-07 22:58:52 +02:00
2c30a67e83 add sql patching facilities
This includes the patches to get from the initial version of the
database to its current state - for the purpose of documentation.

Beware, if you already have an existing database, running this code
will likely result in an error and/or lead to some minor data loss.
You need to follow these steps to fix your DB:
1. delete all *.sql files from unwind/sql/
2. remove the .disabled suffix from unwind/sql/00000001-fix-db.sql.disabled
3. start the application once, this will fix up the database
4. revert all changes to unwind/sql/ – or leave it, it doesn't matter.
2021-07-05 23:15:48 +02:00
ea8d97f901 optimize runtime
The vast majority of time was spent loading each movie individually.
We always need to load every movie to check if it needs updating, or
if it maybe doesn't exist yet.  We can drastically increase performance
by loading the movies in large batches.
2021-07-04 23:17:53 +02:00
2e73b335c9 optimize runtime
- Postpone setting an ID for a Movie until it's added to the database.
- Use larger chunks to count the lines of an input file.
- Skip creating temporary objects for the score-map.
2021-07-04 21:32:13 +02:00
9f6baa99b0 optimize runtime
A `RatingRow`'s `id` and `updated` are never used, but creating them
a million+ times is quite expensive, so initializing them with `None`
saves a lot of time.
`dataclasses`' `fields` function is also quite expensive; loading the
fields from a row directly saves a lot of CPU cycles.
2021-07-04 18:47:26 +02:00
1038b4eaff add exact matching option 2021-06-24 22:26:47 +02:00
c823c51721 add elapsed processing time to response 2021-06-23 22:57:09 +02:00
0a21cb4420 add web API option to limit the number of results 2021-06-22 12:22:50 +02:00
f602542f43 fix discarding ratings
We want to limit the number of movies, not ratings.  By limiting the
number of movie IDs before loading all ratings with those movie IDs
we can achieve this.
2021-06-22 12:14:30 +02:00
a6adfefdd8 allow year relative filtering 2021-06-22 10:19:15 +02:00
d09880438d add more filtering options 2021-06-21 23:48:36 +02:00
7dd10f8bc3 add imdb full import mode 2021-06-21 18:54:03 +02:00
b5cb22822e init with some kind of working prototype 2021-06-15 19:09:21 +02:00