aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 4c794179..46c21ff7 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -483,6 +483,18 @@ namespace slskd
throw new DownloadEnqueueException("File not shared.");
}
+ // in order to properly determine if the requested file would exceed any limits, we need to know the size of the file
+ (string Host, string Filename, long Size) resolved;
+
+ try
+ {
+ resolved = await Shares.ResolveFileAsync(filename);
+ }
+ catch (NotFoundException)
+ {
+ throw new DownloadEnqueueException("File not shared.");
+ }
+
// get the user's group. this will be the name of the user's group, if they have been added to a
// user defined group, or one of the built-ins; 'default', 'privileged', 'leecher', or 'blacklisted'
var group = await Users.GetOrFetchGroupAsync(username);