DJDoubleD / QobuzDownloaderX-MOD

Downloads streams directly from Qobuz. Experimental refactoring of QobuzDownloaderX by AiiR
GNU General Public License v3.0
406 stars 14 forks source link

[Enhancement] if download fails the program mentions it #78

Open orbittwz opened 3 months ago

orbittwz commented 3 months ago

Overall, the program does indicate if the download fails in the program window. But, if a user download many items, and closes the program, he needs to figure out what was downloaded OK and not. The logs do mention this, but it's tedious to browse each log... whereas if you start the program the next day the logs are deleted and if you didn't looked at them you are kinda lost. So my suggestion for improvement is doing either one or more of the following:

  1. for each missing or failed download, instead of suffix of the audio file, it will be changed to ".bad" or ".missing".
  2. add in the folder path of the item the prefix "(bad)-" or "(missing)-".
  3. combination of both.

I prefer the 1st option since you don't need to handle the folder names for now... it's an easy if statement at most. thank you very much!

DJDoubleD commented 3 months ago

The download logs aren't deleted by the program, I used specific timestamps in the log file names to both prevent logs from being overridden and to facilitate sorting. The login error and general error logs are overridden because generally one would expect the user to notice when he can't log in (duh) or when the program has crashed. And also because I didn't feel there was a need to create a system to generate session id's and create persistent error logs per session (can't use the same timestamp system as for the download logs since an error log only needs to be created for a session once an error actually occurred), because the user would notice a crash or check the error log after closing the program.

Personally I don't really see that much difference from doing a global search for "missing" or "error" in the download log files and going through the folders looking for files that have a certain fake extension and then checking why that content is missing.

Also, the 1st option isn't really that simple a fix since it would require additional code to create dummy files for "missing" tracks & appropriate error handling to determine if the dummy file should be ".missing" or ".bad". (and even then an error might occur before the dummy file could be created..., very hard to cover all bases) There is already an existing issue (#23) asking to detect/indicate partly downloaded files and that's not easy as there can be a multitude of reasons why a download was interrupted and I would have to do some more research on how it's even possible to detect if a downloaded file is a partial file. If that's an easy check, I could probably implement a retry x times system.

orbittwz commented 3 months ago

Logs are being deleted, just ran the program and it deleted the yesterday logs, keeping today's logs only... I can't rely on log files when they aren't kept. It's the best option to create a dummy file for missing tracks or change the suffix to failed tracks. If you do implement retry system, then maybe the missing tracks is the issue here

DJDoubleD commented 3 months ago

Logs are being deleted

Ah yes, I had forgotten that I implemented an automatic purge of log files older then 1 day, just to keep the log folder from infinitely growing. Just a question, would it help if the logs were kept longer? I had foreseen this as a parameter in the code (DeleteFilesByAge(logDirPath, 1);) with the intention of at some point adding a sort of "General Settings" screen somewhere to give the user control over stuff like this.

I just really don't like the idea of creating unneeded dummy files, which will then in turn require proper management to clean up and will cause it's own extra layer of complexity. Proper, usable logging combined with decent error handling is the preferred solution for stuff like this.

orbittwz commented 3 months ago

Your decision, it's not a very good workaround, most people don't know how to mass search through files... Whereas the dummy files can indicate there is a problem with the downloaded item.