diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-02-21 15:06:43 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-02-21 15:06:43 -0600 |
| commit | 78de996773715bcd5ade7e6176bf29913d1df03e (patch) | |
| tree | 637b32972ca147ba1797dc681685547d6788104e | |
| parent | d3f4c1d58101b0288c3caa70b3114e0da599daf9 (diff) | |
| download | slskd-78de996773715bcd5ade7e6176bf29913d1df03e.tar.gz | |
watch users prior to uploads
| -rw-r--r-- | src/slskd/Application.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 840ed1ba..47bcd6c9 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -590,12 +590,12 @@ namespace slskd // uploads would be handled separately. Task.Run(async () => { - // prime the privileges cache for this user - // this must be done prior to each upload, or we risk not correctly categorizing - // privileged users as such. - if (await Users.IsPrivilegedAsync(username)) + // users with uploads must be watched so that we can keep informed of their + // online status, privileges, and statistics. this is so that we can accurately + // determine their effective group. + if (Users.Users.Any(u => u.Username == username)) { - Log.Debug("User {Username} is privileged; upload will be prioritized", username); + await Users.WatchAsync(username); } using var stream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read); @@ -857,7 +857,7 @@ namespace slskd private void State_OnChange((State Previous, State Current) state) { - Log.Debug("State changed from {Previous} to {Current}", state.Previous.ToJson(), state.Current.ToJson()); + //Log.Debug("State changed from {Previous} to {Current}", state.Previous.ToJson(), state.Current.ToJson()); _ = ApplicationHub.BroadcastStateAsync(state.Current); } |
