Adds a preferences JSON field on the user plus GET/POST /api/auth/preferences/ (merge semantics, validated keys), surfaced in /auth/me/ and typed on the frontend. The Account page gains a Browsing preferences card: landing page, default rating filter, default sort, items per page and thumbnail size. Signed-in users also sync these while browsing (the Library sidebar's rating/sort/per-page controls and the new thumbnail slider), debounced; on load the account's values seed the local UI state, so settings follow the user across browsers. Guests keep the existing localStorage behaviour. The thumbnail size drives the media grids (Library, Online, pool detail) between 140 and 320px columns. Verified the API against the dev server: merge keeps untouched keys, invalid values 400, values round-trip through /auth/me/.
19 lines
392 B
Python
19 lines
392 B
Python
# Generated by Django 6.1.1 on 2026-09-18 03:32
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('accounts', '0004_user_avatar'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='user',
|
|
name='preferences',
|
|
field=models.JSONField(blank=True, default=dict),
|
|
),
|
|
]
|