Skip to content

Bug: Canceling a Download Affects All Users Globally #32

@windoze95

Description

@windoze95

Description

In app/api/videos.py, the /api/videos/{video_id}/cancel endpoint sets the global Video.status to CATALOGED.

@router.post("/{video_id}/cancel")
async def cancel_download(...):
    ...
    video.status = "CATALOGED"
    await db.commit()

Impact

Since NullFeed is a multi-user media center, a video download might be requested by or relevant to multiple users. If User A cancels a download, it instantly changes the status for User B as well. Furthermore, it doesn't actually stop the running Celery background task, leading to state inconsistencies (the file might still finish downloading and get cataloged).

Suggested Fix

Instead of changing the global video status, cancel requests should manage a user-specific reference (e.g., in UserVideoRef). The global download task should only be canceled if no users are actively tracking it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood-first-issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions