python-20 / video-downloader

A python application to download videos
GNU General Public License v3.0
10 stars 10 forks source link

Feature Request: Showing file download locations when successfully downloaded the video #25

Closed cherylli closed 4 years ago

cherylli commented 4 years ago

Also possibly a button to open the folder location of the downloaded file(s)

RyanSamman commented 4 years ago

What exactly is this again? You added the button to open the file location, now we want to display the file location?

cherylli commented 4 years ago

I think it's more like a message to show "the file has been downloaded to ...." And maybe a button to open the location.

RyanSamman commented 4 years ago

Completed, this issue can be closed now, just make sure this bug isn't reproducible (The gap in the directory) Capture

@chonix take a quick look at the code to see if you can spot any errors?

    def getSaveLocation(self):
        """ Get user selected directory when the get location button is clicked.
        """
        global directory
        directory = str(QFileDialog.getExistingDirectory(
            self, "Select Directory"))
        self.lineEditDownloadLocation.setText(directory)
        self.logger.info(f"function: getSaveLocation - directory: {directory}")

    def onSaveLocationChange(self):
        """ Get save location by user text input
        """
        global directory
        entered_directory = self.lineEditDownloadLocation.text()
        # check if directory exist
        if not os.path.isdir(entered_directory):
            self.lineEditDownloadLocation.setText("")
            self.showPopUp("Directory is not valid. Please re select")
        else:
            directory = entered_directory
        self.logger.info(
            f"function: onSaveLocationChange - directory: {directory}")
chonix commented 4 years ago

That gap comes from the popup in pyqt.py. There' a \ there. On line 150. Sorry but cant point it out on mobile right now.

self.showPopUp( f"{ytube.title} - has been downloaded successfully to \ {os.path.abspath(location)}")