Commit graph

160 commits

Author SHA1 Message Date
76a69b6340 chore: replace TypeVar with native syntax 2024-05-19 02:57:13 +02:00
1ea09c1a45 feat: use Alembic to initialize the database
This completely removes the previous DB patching mechanism.
When this is first run for an existing installation of Unwind, depending
on its version it might lead to problems because the database's schema
won't match the code.
To avoid that issue, when upgrading Unwind to this version make sure to
STOP the old application, install this new version but DON'T start it,
instead use `alembic upgrade head` to run the outstanding patches, and
only then start the application.
2024-05-19 02:25:36 +02:00
5e4e70c9dc fix: setting the log level should only affect Unwind itself
Calling Unwind with DEBUG=1 caused a lot of debug messages from
dependencies like HTTPX, aiosqlite, etc.
2024-05-19 00:15:30 +02:00
22c44bfa60 chore: move existing CLI commands into separate files 2024-05-19 00:12:06 +02:00
f7fc84c050 feat: add CLI command to load IMDb charts
This introduces a generalized module interface for CLI commands.
2024-05-18 23:46:56 +02:00
1789b2ce45 fix: encode query params for GQL request 2024-05-18 23:38:33 +02:00
0747ca5658 fix: always use named constraints in SQLAlchemy 2024-05-18 23:35:07 +02:00
f102e07256 feat: add a table to store award information 2024-05-18 23:32:10 +02:00
5eb7211b59 fix: SQL integer column types
We used NUMBER[sic!] as column type in our SQL, which does not exist.
The way SQLite works this mapped to NUMERIC, which is not what we meant,
we really wanted INTEGER here.
2024-05-18 18:54:46 +02:00
feb60bf658 feat: add Alembic
This adds the `ratings_index` to code, which so far wasn't reflected in
SQLAlchemy's metadata.
2024-05-18 18:54:46 +02:00
538e901fcb rename scripts 2024-05-11 19:45:39 +02:00
f46ab98ac2 Merge branch 'feat/charts' 2024-05-11 19:10:33 +02:00
8fc594b947 fix: some lint reported by Ruff 2024-05-11 19:00:27 +02:00
e9a58ed40e fix: movie updates were not imported because of a broken timestamp
IMDb changed their exports. The timestamp of the file in their gzipped
export is now always 0, i.e. 1970-01-01T00:00:00Z.
2024-05-11 17:38:16 +02:00
3ab5898f98 feat: add cli task to add a new user 2024-05-11 17:29:36 +02:00
05d387a6b5 fix: tests sometimes failed because of missing sorting 2024-05-11 17:29:30 +02:00
1a7d85b31d feat: add support for new ratings page
Genres are no longer available for ratings, so we make them optional.
Adds support for validating generics in union types.
2024-05-11 17:13:48 +02:00
06e60fb212 refactor: use .python-version for docker build 2024-05-10 17:01:18 +02:00
d385860ca9 fix: find next rating page 2024-05-10 00:13:32 +02:00
738799cc74 chore: update dependencies & scripts 2024-05-10 00:13:01 +02:00
2bf5607183 feat: add functions to retrieve IMDb chart lists
These charts are
- the top 250 highest rated movies
- the top 100 most popular movies
- the bottom 100 lowest rated movies
2024-05-10 00:12:25 +02:00
4fbdb26d9c Merge branch 'feat/sqlalchemy' 2023-11-29 18:01:24 +01:00
78b531ad8c add scripts to build & run with Docker
Or set DOCKER_BIN=podman to use Podman.
2023-11-29 18:01:01 +01:00
4981de4a04 remove databases, use SQLAlechemy 2.0 instead
Among the many changes we switch to using SQLAlchemy's connection pool,
which means we are no longer required to guard against multiple threads
working on the database.
All db funcs now receive a connection to use as their first argument,
this allows the caller to control transaction & rollback behavior.
2023-11-27 23:24:35 +01:00
c63bee072f respect API_HOST & API_PORT env vars for dev
Using Vite's proxy option allows us to avoid CORS issues when the host
for Uvicorn doesn't match the host for Vite, e.g. localhost vs. 127.0.0.1.
2023-11-26 19:43:56 +01:00
1f42538481 make the shared connection internal to the db module
This should make it easier to refactor the code for removing the
databases package.
2023-11-26 18:41:32 +01:00
22ea553f48 improve typing 2023-11-26 18:28:17 +01:00
6d0c61fceb upgrade to Python 3.12
This includes only the most basic steps of the upgrade, to make the
existing code run with Python 3.12. No refactoring to make use of new
features is included.
2023-11-26 17:09:07 +01:00
79068f2f10 add honcho as explicit dev dependency 2023-11-26 16:46:38 +01:00
2c65436df5 add .python-version file 2023-11-26 15:11:24 +01:00
7665dfe769 switch from black/isort/autoflake to ruff 2023-11-26 15:10:16 +01:00
b5a93cb92f update Npm dependencies 2023-07-22 20:19:23 +02:00
25f31db756 improve strict typing 2023-07-22 20:13:46 +02:00
86c3030e31 remove unused classvars 2023-07-22 20:07:58 +02:00
91d06f607c update Python dependencies 2023-07-22 20:07:58 +02:00
2963a1d3f6 improve strict typing 2023-03-28 23:32:24 +02:00
8b5cbdf903 make sure WAL mode is active 2023-03-28 23:06:14 +02:00
37e8d53b78 migrate db.current_patch_level to SQLAlchemy 2023-03-28 23:03:35 +02:00
e27b57050a remove unused functions 2023-03-28 22:05:14 +02:00
84bbe331ee migrate db.find_movies to SQLAlchemy 2023-03-28 21:50:15 +02:00
1fd7e730b3 migrate db.ratings_for_movies to SQLAlchemy 2023-03-28 21:50:15 +02:00
1a3528e096 migrate db.find_ratings to SQLAlchemy 2023-03-28 21:50:14 +02:00
d4933bf1a6 migrate db.ratings_for_movie_ids to SQLAlchemy 2023-03-23 23:33:59 +01:00
b91fcd3f55 migrate db.add, db.update, db.remove to SQLA 2023-03-23 22:49:17 +01:00
6f6354cfac migrate db.get to SQLAlchemy 2023-03-20 21:37:50 +01:00
af9c166124 migrate db.get_many to SQLAlchemy 2023-03-19 23:14:59 +01:00
a444909b1f minor refactoring 2023-03-19 22:59:08 +01:00
f1bafbb4a2 report code coverage for tests 2023-03-19 22:36:36 +01:00
1dd7bab4aa migrate db.get_all to pure SQLAlchemy 2023-03-19 22:36:33 +01:00
5015815097 add SQLAlchemy table definitions to models 2023-03-18 23:51:40 +01:00