Skip to content
Snippets Groups Projects
Commit 5d1d586f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better access enforcement to files in batch download queues

If a file gets added to a batch download queue that a user doesn't have download-access to (at the time of batch download), deal with that gracefully and consistently.

start_batch_download():
- Now checks current user access to download the file in both single-file and batch modes
- Now performs credit-check in single-file mode (wasn't doing so previously)
- totalsize of multi-file batch download queue is now calculated again (apparently removed/broken in the new filebase conversion of v3.19), so download ETA should be calculated more accurately (?) again
- Use gettimetodl() to calculate each file's download time for multi-file downloads
- Using new putnode_download() method to write node downloading "action" and ETA-in-aux fields
- The node status wasn't being updated at all before start of download in single-file mode - fixed

create_batchdn_lst() :
- Checks each file still downloadable by the user and if not, removes from the queue (and the generated list file).
- Performs credit check and removes files that exceed available user credit
- returns true only when 1 or more files is added to the batch download list file

addtobatdl()
- Removed redundant 'D' restriction check - this is handled by can_user_download() check already.
- Use the 'reason' out parameter from can_user_download() to determine which error string to display (not always CantDownloadFromDir).
parent c0ef762a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3894 passed
Status
Pipeline
Created by
Stages
Actions
Passed

00:06:59

avatar
Download artifacts

No artifacts found

Passed

00:07:15

avatar
Download artifacts

No artifacts found

Passed

00:07:03

avatar
Download artifacts

No artifacts found