711a0ae4

Author: Michael Lynch <git@mtlynch.io>

Committer: Michael Lynch <mtlynch@noreply.codeberg.org>

Move media publishing out of the upload handlers (#401)

The image and video upload handlers each built a MediaItem inline, ran
the processor, and inserted the database row. That sequence was
duplicated across both paths and tied HTTP request handling directly to
media processing and storage, making the publish workflow awkward to
test without driving the full server.

Introduce a media.Service that owns the publish workflow end to end: it
constructs the MediaItem, processes the upload into its file variants,
then records the media row. Handlers now depend on a narrow
MediaPublisher interface and hand off the parsed request via
PublishImage/PublishVideo.

This keeps the write-files-before-insert ordering (which leaves orphaned
files rather than a gallery entry pointing at missing files on a failed
insert) in one place and lets the publishing logic be tested directly,
without the HTTP layer.

Reviewed-on: https://codeberg.org/mtlynch/little-moments/pulls/401