Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple files with same name with "Save Tabs as Files" #214

Closed
tobbez opened this issue Sep 15, 2018 · 2 comments
Closed

Multiple files with same name with "Save Tabs as Files" #214

tobbez opened this issue Sep 15, 2018 · 2 comments
Labels

Comments

@tobbez
Copy link

tobbez commented Sep 15, 2018

Short description

In some cases, when using the 'Save Tabs as Files' feature on multiple tabs that contain files with the same base name, MTH will try to download them to the same local path.

Steps to reproduce

  1. Start Firefox with clean profile.
  2. Install MTH.
  3. Open two tabs with URLs that have the same base name, for example example.com/directory1/file.jpg and example.com/directory2/file.jpg.
  4. Make sure your Saved Tabs directory doesn't already have a file with the same name (file.jpg in the example).
  5. Select both the tabs using MTH and invoke the 'Save Tabs as Files' action.

Expected result

MTH attempts to download both files into the same local path (file.jpg in the example).

Actual result

MTH should download the files into separate paths (file.jpg and file(1).jpg in the example).

Note that the problem does not seem to occur if a file of the same name already exists before you invoke the action (in that case, the files correctly get (1), (2), ... added to the file names).

Environment

  • Platform (OS): Windows 10
  • Version of Firefox: 63.0b4
  • Version (or revision) of Multiple Tab Handler: 2.1.4
@tobbez
Copy link
Author

tobbez commented Sep 15, 2018

After looking a bit at it, there doesn't seem to be much code in MTH concering downloads (basically just a call to browser.downloads.download), so maybe this is a bug in Firefox?

Even if that is the case though, it might be mitigated by waiting until the promise returned by browser.downloads.download) resolves before calling browser.downloads.download for the next file.

@piroor
Copy link
Owner

piroor commented Sep 20, 2018

Thanks. By the commit 82cc1e4 now downloaded files will have unique name.

@piroor piroor added the fixed label Sep 20, 2018
@piroor piroor closed this as completed Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants