Patch/default thumbnail#1439
Conversation
…prove thumbnail URL serialization
0efe96d to
7e41ed4
Compare
LoicBonavent
left a comment
There was a problem hiding this comment.
Holà,
Sur le coup, la vignette par défaut est celle affichée pour une vidéo sans thumbnail; cela ne peut-être alors un logo d'Esup-Pod, mais plutôt d'un icône media/vidéo/plecture... ou ce genre de choses.
Sinon, code nickel, comme d'habitude 👍
Je t’avoue que je ne savais pas trop quoi mettre par défaut, mais au moins on peut choisir, comme ça si une université veut mettre son logo ou autre. |
LoicBonavent
left a comment
There was a problem hiding this comment.
C'est vrai que dans tous les cas, la vignette par défaut devait être changé vis-à-vis des couleurs et autres spécificités du site. Çà roule.
Badatos
left a comment
There was a problem hiding this comment.
Merci pour cette petite PR.
Ca va simplifier les personnalisations si chaque établissement peut adapter facilement le thumbnail par défaut ;)
There was a problem hiding this comment.
Est-ce possible de mettre l'image par défaut en svg plutot que png ?
| url | ||
| and request | ||
| and not (url.startswith("http://") or url.startswith("https://")) | ||
| ): |
There was a problem hiding this comment.
est-ce qu'on peut simplifier en mettant simplement and not url.startswith("http") ?
Patch/default thumbnail
This PR improves the logic for resolving video thumbnails. It introduces a modern fallback image while allowing administrators to customize the default thumbnail through the application's settings.
The
thumbnail_urlproperty now follows this priority hierarchy:Custom thumbnail (
thumbnail): highest priority (user upload).Automatic preview (
overview): image generated by the runner during encoding.Default thumbnail (
DEFAULT_THUMBNAIL): configurable fallback via settings (default:img/default_thumbnail.png).Support for absolute URLs in the API
The
VideoSerializernow uses aSerializerMethodFieldforthumbnail_url.Returned URLs are now absolute (e.g.
https://pod.univ.fr/static/img/...) when the request context is available, making integration with front-end clients easier.Configuration and assets
Asset: added
src/apps/core/static/img/default_thumbnail.png(new visual identity for videos without an image).Settings:
DEFAULT_THUMBNAILis defined indefaults.py, making the fallback image fully configurable.Before sending your pull request, make sure the following are done
dev_v5branch.draftif it’s still a work in progress.