MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / updateQueueStatus

Method updateQueueStatus

pkg/unpackerr/folder.go:629–662  ·  view source on GitHub ↗

updateQueueStatus for an on-going tracked extraction. This is called from a channel callback to update status in a single go routine. This is used by apps and Folders in a few other places as well.

(data *newStatus, now time.Time, sendHook bool)

Source from the content-addressed store, hash-verified

627// This is called from a channel callback to update status in a single go routine.
628// This is used by apps and Folders in a few other places as well.
629func (u *Unpackerr) updateQueueStatus(data *newStatus, now time.Time, sendHook bool) *Extract {
630 if _, ok := u.Map[data.Name]; !ok {
631 // This is a new Folder being queued for extraction.
632 // Arr apps do not land here. They create their own queued items in u.Map.
633 u.Map[data.Name] = &Extract{
634 Path: data.Name,
635 App: FolderString,
636 Status: QUEUED,
637 Updated: now,
638 IDs: map[string]any{"title": data.Name}, // required or webhook may break.
639 }
640
641 u.Map[data.Name].XProg = &ExtractProgress{Extract: u.Map[data.Name]}
642
643 if sendHook {
644 u.runAllHooks(u.Map[data.Name])
645 }
646
647 return u.Map[data.Name]
648 }
649
650 if data.Resp != nil {
651 u.Map[data.Name].Resp = data.Resp
652 }
653
654 u.Map[data.Name].Status = data.Status
655 u.Map[data.Name].Updated = now
656
657 if sendHook {
658 u.runAllHooks(u.Map[data.Name])
659 }
660
661 return u.Map[data.Name]
662}

Callers 7

extractTrackedItemMethod · 0.95
folderXtractrCallbackMethod · 0.95
checkFolderStatsMethod · 0.95
deleteAfterReachedMethod · 0.95
checkQueueChangesMethod · 0.95
checkExtractDoneMethod · 0.95
handleXtractrCallbackMethod · 0.95

Calls 1

runAllHooksMethod · 0.95

Tested by

no test coverage detected