• Stefy Lanza (nextime / spora )'s avatar
    take an upload even with no output directory configured (v0.4.87) · e79ccd03
    Stefy Lanza (nextime / spora ) authored
    POST /v1/files/upload exists so a client sends a file once and then names it:
    inlining a 40 MB clip in every request is the waste it was built to remove. But
    it stored its content-addressed files in the output directory and answered 501
    when there was none configured -- so on such an install the only way to send
    media was the inlining the endpoint replaces, and a client that had already
    switched to uploading saw its photo edits fail outright.
    
    An install always has a cache directory, so uploads fall back to it
    (media.uploads_dir()). With an output directory nothing moves: an upload still
    lands there beside the generated files. Both stores stay in the lookup path, so
    an install that gains --file-path later does not lose track of what it already
    holds, and /v1/files/<name> serves from the cache store only for up- names --
    the cache directory does not quietly become a second public output directory.
    501 now means there is nowhere at all to write; a non-writable store answers
    507 rather than a 500 out of makedirs.
    
    Composing a new video still needs an output directory, since there has to be
    somewhere to write the result.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01S8LAP3ueNzQJtwzhgVbq66
    e79ccd03
test_uploads_without_output_dir.py 5.48 KB