@ctrl/sabnzbd
    Preparing search index...

    Class Sabnzbd

    Implements

    Index
    state: SabnzbdState = {}
    • Adds an NZB to the queue by file upload.

      Calls SABnzbd mode=addfile.

      Parameters

      • nzb: string | Uint8Array<ArrayBufferLike>

        NZB XML content as text or bytes.

      • options: SabAddOptions = {}

        Optional SAB add fields; defaults include category="*", script="Default", priority=-100, and postProcess=-1.

      Returns Promise<SabAddResponse>

      The raw SAB add response containing status and optional nzo_ids.

    • Adds an NZB to the queue from a URL.

      Calls SABnzbd mode=addurl.

      Parameters

      • url: string

        Remote NZB URL.

      • options: SabAddOptions = {}

        Optional SAB add fields; defaults include category="*", script="Default", priority=-100, and postProcess=-1.

      Returns Promise<SabAddResponse>

      The raw SAB add response containing status and optional nzo_ids.

    • Cancels post-processing of a job.

      Calls SABnzbd mode=cancel_pp.

      Parameters

      • id: string

        SAB job identifier (nzo_id) currently in post-processing.

      Returns Promise<boolean>

      true when SABnzbd cancels post-processing.

    • Changes a queue job category.

      Calls SABnzbd mode=change_cat.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • category: string

        SAB category name.

      Returns Promise<boolean>

      true when SABnzbd accepts the category change.

    • Changes queue job post-processing options.

      Calls SABnzbd mode=change_opts. SAB only accepts explicit modes here, so UsenetPostProcess.default throws instead of being sent; there is no API to reset a job back to its category default.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • postProcess: UsenetPostProcess

        Normalized post-processing mode to apply.

      Returns Promise<boolean>

      true when SABnzbd accepts the option change.

    • Changes queue job priority.

      Calls SABnzbd mode=queue with name=priority.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • priority: UsenetPriority

        Shared normalized priority value.

      Returns Promise<number | undefined>

      The new queue position when reported by SABnzbd, otherwise undefined.

    • Changes a queue job post-processing script.

      Calls SABnzbd mode=change_script.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • script: string

        SAB configured script name.

      Returns Promise<boolean>

      true when SABnzbd accepts the script change.

    • Clears currently active warnings.

      Calls SABnzbd mode=warnings with name=clear.

      Returns Promise<boolean>

      true when SABnzbd accepts the warning clear command.

    • Deletes a history job by its SAB nzo_id.

      Calls SABnzbd mode=history with name=delete. SAB archives the job by default instead of deleting it permanently, and del_files only removes the incomplete download folder of failed jobs.

      Parameters

      • id: string

        SAB history job identifier (nzo_id).

      • deleteFiles: boolean = false

        When true, also remove leftover files of failed jobs; defaults to false.

      • Optionalarchive: boolean

        When false, permanently delete instead of archiving; defaults to SAB's setting.

      Returns Promise<boolean>

      true when SABnzbd accepts the delete command.

    • Deletes a queue job by its SAB nzo_id.

      Calls SABnzbd mode=queue with name=delete.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • deleteFiles: boolean = false

        When true, also remove downloaded data files; defaults to false.

      Returns Promise<boolean>

      true when SABnzbd accepts the delete command.

    • Export the current state of the client. Can be restored with createFromState.

      Returns Jsonify<SabnzbdState>

    • Triggers immediate RSS processing.

      Calls SABnzbd mode=rss_now.

      Returns Promise<boolean>

      true when SABnzbd accepts the RSS trigger command.

    • Retrieves configured SABnzbd categories.

      Calls SABnzbd mode=get_cats.

      Returns Promise<Category[]>

      Categories normalized to shared Category objects.

    • Lists files for a queue job.

      Calls SABnzbd mode=get_files.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      Returns Promise<SabFilesResponse>

      The raw file listing payload.

    • Loads full server and queue status details from SABnzbd.

      Calls SABnzbd mode=fullstatus with skip_dashboard=1.

      Returns Promise<SabFullStatus>

      The full status payload.

    • Retrieves configured SABnzbd post-processing scripts.

      Calls SABnzbd mode=get_scripts.

      Returns Promise<Script[]>

      Scripts normalized to shared Script objects.

    • Retrieves per-server traffic totals from SABnzbd.

      Calls SABnzbd mode=server_stats.

      Returns Promise<SabServerStats>

      Aggregate and per-server transfer statistics.

    • Reads the SABnzbd version string.

      Calls SABnzbd mode=version.

      Returns Promise<string>

      The SABnzbd version.

    • Retrieves the current SABnzbd warning list.

      Calls SABnzbd mode=warnings.

      Returns Promise<SabWarning[]>

      All active warnings.

    • Lists history entries, optionally filtered and paged.

      Calls SABnzbd mode=history.

      Parameters

      • Optionalquery: Omit<SabHistoryQuery, "lastHistoryUpdate">

        Optional history filters, pagination, and archive controls.

      Returns Promise<SabHistory>

      The raw history payload including slots, or false when lastHistoryUpdate matches SAB's current last_history_update and nothing changed.

    • Lists history entries, optionally filtered and paged.

      Calls SABnzbd mode=history.

      Parameters

      • query: SabHistoryQuery

        Optional history filters, pagination, and archive controls.

      Returns Promise<false | SabHistory>

      The raw history payload including slots, or false when lastHistoryUpdate matches SAB's current last_history_update and nothing changed.

    • Lists queue entries, optionally filtered and paged.

      Calls SABnzbd mode=queue.

      Parameters

      • query: SabQueueQuery = {}

        Optional queue filters and pagination controls.

      Returns Promise<SabQueue>

      The raw queue payload including slots.

    • Moves a queue job to a target position.

      Calls SABnzbd mode=switch.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • position: number

        Target zero-based queue position.

      Returns Promise<boolean>

      true when SABnzbd accepts the move command.

    • Pauses a queue job by its SAB nzo_id.

      Calls SABnzbd mode=queue with name=pause.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      Returns Promise<boolean>

      true when SABnzbd accepts the job pause command.

    • Pauses post-processing tasks.

      Calls SABnzbd mode=pause_pp.

      Returns Promise<boolean>

      true when SABnzbd accepts the post-processing pause command.

    • Pauses the global download queue.

      Calls SABnzbd mode=pause.

      Returns Promise<boolean>

      true when SABnzbd accepts the pause command.

    • Pauses the queue and resumes it automatically after minutes.

      Calls SABnzbd mode=config with name=set_pause.

      Parameters

      • minutes: number

        Minutes to pause for.

      Returns Promise<boolean>

      true when SABnzbd accepts the timed pause.

    • Removes all queue jobs, optionally only those whose name contains search. Downloaded files are deleted too.

      Calls SABnzbd mode=queue with name=purge.

      Parameters

      • Optionalsearch: string

        Optional case-insensitive name filter.

      Returns Promise<string[]>

      The removed queue ids.

    • Removes a job from the queue, falling back to history when the id is not queued.

      Parameters

      • id: string
      • removeData: boolean = false

      Returns Promise<boolean>

    • Renames a queue job and optionally sets an archive password.

      Calls SABnzbd mode=queue with name=rename.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      • name: string

        New queue job name.

      • Optionalpassword: string

        Optional archive password; left unchanged when omitted.

      Returns Promise<boolean>

      true when SABnzbd accepts the rename command.

    • Resets SABnzbd quota counters.

      Calls SABnzbd mode=reset_quota.

      Returns Promise<boolean>

      true when SABnzbd accepts the quota reset command.

    • Requests a standard SABnzbd restart.

      Calls SABnzbd mode=restart.

      Returns Promise<boolean>

      true when SABnzbd accepts the restart command.

    • Requests SABnzbd restart with queue repair.

      Calls SABnzbd mode=restart_repair.

      Returns Promise<boolean>

      true when SABnzbd accepts the repair restart command.

    • Resumes a queue job by its SAB nzo_id.

      Calls SABnzbd mode=queue with name=resume.

      Parameters

      • id: string

        SAB queue job identifier (nzo_id).

      Returns Promise<boolean>

      true when SABnzbd accepts the job resume command.

    • Resumes post-processing tasks.

      Calls SABnzbd mode=resume_pp.

      Returns Promise<boolean>

      true when SABnzbd accepts the post-processing resume command.

    • Resumes the global download queue.

      Calls SABnzbd mode=resume.

      Returns Promise<boolean>

      true when SABnzbd accepts the resume command.

    • Re-queues every retryable failed history job.

      Calls SABnzbd mode=retry_all.

      Returns Promise<string[]>

      The new queue ids.

    • Re-queues a failed history job.

      Calls SABnzbd mode=retry.

      Parameters

      • id: string

        SAB history job identifier (nzo_id).

      • Optionalpassword: string

        Optional archive password for the retried job.

      Returns Promise<string>

      The new queue id. SAB removes the history entry.

    • Triggers an immediate scan of the watched folder.

      Calls SABnzbd mode=watched_now.

      Returns Promise<boolean>

      true when SABnzbd accepts the watched-folder scan command.

    • Sets the global download speed limit.

      Calls SABnzbd mode=config with name=speedlimit.

      Parameters

      • limit: string | number

        Speed limit value passed directly to SABnzbd.

      Returns Promise<boolean>

      true when SABnzbd accepts the speed limit update.

    • Requests SABnzbd shutdown.

      Calls SABnzbd mode=shutdown.

      Returns Promise<boolean>

      true when SABnzbd accepts the shutdown command.

    • Sorts the queue. SAB keeps priority ordering, sorting only within each priority.

      Calls SABnzbd mode=queue with name=sort.

      Parameters

      Returns Promise<boolean>

      true when SABnzbd accepts the sort command.