Skip to content

Fix DownloadManager, improve some network code#2363

Open
mick-lue wants to merge 5 commits intoModOrganizer2:masterfrom
mick-lue:fix_download_manager
Open

Fix DownloadManager, improve some network code#2363
mick-lue wants to merge 5 commits intoModOrganizer2:masterfrom
mick-lue:fix_download_manager

Conversation

@mick-lue
Copy link
Copy Markdown

Problem

Issues with downloads getting stuck, not starting, or not correctly updating the download list.

Changes explained

downloadmanager

  • remove duplicate includes
  • Avoid dangling DownloadInfo in memory in createFromMeta
  • explicitely set the redirect policy
  • Do not create a meta file on download start, only on download end
  • remove calling aboutToUpdate() when not using update(-1)
  • Always connect the finished() signal from the NetworkReply so we don't miss it on very fast downloads (also check for fast finished downloads afterwards)
  • the if statement in addNXMDownload was ignoring the first statement because of the comma
  • add a simple fallback to getFileNameFromNetworkReply that uses the filename from the URL if it contains at least one char for the name and one char for the file extension
  • generate random Download IDs instead of using the number of active downloads
    • QRandomGenerator is seeded the first time it gets used, so we don't need to do that ourselves
  • rewrite downloadFinished to make it more consistent
  • rewrite writeData so it does preliminary checks itself and the caller does not need to handle it
    • also removed m_hasData as it is unneeded in this setup

nexusinterface

  • improved redirect handling
  • add debug message for redirects

nxmaccessmanager

organizer_en.ts

  • As I added and edited translatable messages, I figured I'd include it.

My testing experience so far

I haven't had stuck downloads for the last 500 or so files. Before that, most files would instantly get stuck as my download folder was already quite full.

@mick-lue
Copy link
Copy Markdown
Author

This is the last commit to this PR for now. I forgot to bring 2 changes over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants