Skip to content

Commit

Permalink
bug: set download directory to existing directory
Browse files Browse the repository at this point in the history
This should fix #36
  • Loading branch information
fedorov committed May 14, 2024
1 parent 32b04e7 commit 79091c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions IDCBrowser/IDCBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def downloadFromQuery(self, query, downloadDestination):
manifest_path = os.path.join(downloadDestination,'manifest.csv')
manifest_df = self.IDCClient.sql_query(query)
manifest_df.to_csv(manifest_path, index=False, header=False)
logging.info("Will download to "+downloadDestination)
self.IDCClient.download_from_manifest(manifest_path, downloadDestination)

def onDownloadButton(self):
Expand Down Expand Up @@ -1015,10 +1016,8 @@ def addSelectedToDownloadQueue(self):
# create download queue
#if not any(selectedSeries == s for s in self.previouslyDownloadedSeries):
if True:
downloadFolderPath = os.path.join(self.storagePath, str(len(self.previouslyDownloadedSeries)),
selectedSeries) + os.sep
self.makeDownloadProgressBar(selectedSeries, n)
self.downloadQueue[selectedSeries] = downloadFolderPath
self.downloadQueue[selectedSeries] = self.storagePath
self.seriesRowNumber[selectedSeries] = n

self.seriesTableWidget.clearSelection()
Expand Down Expand Up @@ -1060,7 +1059,7 @@ def downloadSelectedSeries(self):
f.close()
fileName = downloadFolderPath + 'images.zip'
logging.debug("Downloading images to " + fileName)
self.extractedFilesDirectory = downloadFolderPath + 'images'
self.extractedFilesDirectory = downloadFolderPath
self.progressMessage = "Downloading Images for series InstanceUID: " + selectedSeries
self.showStatus(self.progressMessage)
#seriesSize = self.getSeriesSize(selectedSeries)
Expand Down

0 comments on commit 79091c9

Please sign in to comment.