Add move to destination functionality

This commit is contained in:
2023-03-13 10:32:20 +10:30
parent ba87b943ea
commit b40dd218f1
5 changed files with 74 additions and 18 deletions

View File

@@ -285,12 +285,9 @@ func fetchInfoOneRESTHandler(w http.ResponseWriter, r *http.Request) {
// nil means (probably) that they chose "don't move" - which is fine,
// and maps to nil on the Download (the default state).
destination := configService.Config.DestinationCalled(thisReq.Destination)
dm.ChangeDestination(thisDownload, destination)
thisDownload.Lock.Lock()
thisDownload.Destination = destination
thisDownload.Lock.Unlock()
log.Printf("%#v", thisDownload)
// log.Printf("%#v", thisDownload)
succRes := successResponse{Success: true, Message: "destination changed"}
succResB, _ := json.Marshal(succRes)