* refresh Item.image on details page when missing
The home page reads Item.image from the database, which is only written
when the Item is first created. The details page fetches metadata live
from the provider, so the two can drift out of sync — most visibly when
a TV season has no thumbnail at creation time and never updates after.
Add a helper that opportunistically refreshes Item.image whenever a
details view has freshly-fetched metadata and the stored image is empty
or IMG_NONE. Apply it to the primary item in media_details and
season_details, and to tracked items surfaced through related sections
(e.g. the seasons listed on a TV details page).
Fixes#1365.
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* address PR review: bulk_update + select_related
- enrich_items_with_user_data now collects items needing an image
refresh and issues a single Item.objects.bulk_update at the end
instead of one save per item. Lookup building was extracted to
_build_user_media_lookup to keep complexity in check.
- filter_media_prefetch now select_relateds 'item' so accessing
current_instance.item in the details views doesn't trigger an
extra query.
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
---------
Co-authored-by: David Davis <86290+daviddavis@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* add an auto-login option
* apply review suggestions
* add tests for auto-login middleware
* only auto-login with active users
* document the new env variable `YAMTRACK_AUTO_LOGIN_USERNAME`
* fix auto login middleware tests
---------
Co-authored-by: FuzzyGrim <stromed_chariotman@aleeas.com>
* change /medialist to /username and change view to not require login and go by username in url not logged in user
* adjust sidebar to reference username and grid/list to not show edit icons when not viewing your own page
* update tests to account for changed medialist url
* private profile checkbox in account page and 404 on visit if profile is private and not logged in as the user
* added test to check profile 404s if private and is visible otherwise
* remove extra movie item creation as it was unnecessary
* clean up code according to code bot suggestions
* pre-commit run and fixes
* add migration file to support private field
* add correct params to medialist endpoint calls
* mid-commit improving functionality for logged in and anonymous users
* fix ui for anonymous and external viewers of a list
* use target_user wherever needed in media list components
* redirect if user doesn't have that media type enabled and error if there are no media types
* hide browse/add buttons if not the target user and there is nothing tracked and add redirect to signin button
* remove references to unused variable
* remove behaviour for anonymous users from base template
* use view instead of hardcoded url
* use blocks to override segments of sidebar instead of duplicating the whole sidebar code
* make profile private by default
* make profile private by default
* fix import ordering
---------
Co-authored-by: FuzzyGrim <stromed_chariotman@aleeas.com>
* Use user date format for episodes
* Add long EU date format option
* add date format choice migration
* fix date format migration order
---------
Co-authored-by: FuzzyGrim <stromed_chariotman@aleeas.com>