Skip to contents

Main server logic for the upload module. Handles artwork table display, wizard workflow, async pipeline processing, collection management, and purchase link editing. Uses `future::plan(future::multisession)` for background artwork processing.

Usage

modUploadServer(id, r)

Arguments

id

Character scalar. Shiny namespace ID for the module. Used by [shiny::NS()] to create unique element IDs and prevent conflicts with other modules or the parent app. Must match between UI and server calls.

r

Reactive list from parent application. Must contain:

`r$artist`

Character. Artist UUID (format: `"746bxxxx-..."`).

`r$artwork`

Character. Current artwork UUID (format: `"99xxxxxx-..."`), if any.

`r$appdata`

List. Complete artist context from [artutils::get_appdata()]. Contains `r$appdata$artist$artDT` (data.table of artworks), `r$appdata$artist$collections` (named list of collection UUIDs), and `r$appdata$artist$info` (artist metadata).

Value

The `r` reactive list (unchanged). Enables parent app to observe changes to `r$artwork` and `r$appdata`.

Details

The server manages: - Multi-step wizard with shinyvalidate validation - Async artwork processing via [new_pipeline_task()] - Collection creation and management - Artwork table with edit/view/download/delete actions - Purchase link updates via [updateProjectServer()] sub-module - Demo mode protection for all write operations

See also

* [modUploadUI()] for UI function * [new_pipeline_task()] for async processing * [validator_step_1()] and [validator_step_2()] for input validation * [updateProjectServer()] for purchase link editing sub-module

Other upload-core: modUploadUI()

Examples

if (FALSE) { # \dontrun{
library(shiny)

server <- function(input, output, session) {
  r <- reactiveValues(
    artist = "746b8207-72f5-4ab6-8d19-a91d03daec3d"
  )

  observe({
    r$appdata <- artutils::get_appdata(r$artist, r$artwork)
  })

  modUploadServer("upload", r)
}
} # }