diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-08-07 08:33:38 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-08-07 08:33:38 -0500 |
| commit | 49d2a78b0edc5237411f770bb8584b96c361d9c1 (patch) | |
| tree | 99ce55f01e4ca00126d7554006c81970e6b4652b /src | |
| parent | 9ed3362fa62038cf3f455469a44833c00039fb1a (diff) | |
| download | slskd-49d2a78b0edc5237411f770bb8584b96c361d9c1.tar.gz | |
stub EventBus
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/EventBus.cs | 42 | ||||
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 3 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/slskd/Core/EventBus.cs b/src/slskd/Core/EventBus.cs new file mode 100644 index 00000000..b90e3fc2 --- /dev/null +++ b/src/slskd/Core/EventBus.cs @@ -0,0 +1,42 @@ +// <copyright file="EventBus.cs" company="slskd Team"> +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// </copyright> + +using System.Threading.Tasks; + +namespace slskd; + +public enum EventType +{ + NOOP, + DOWNLOAD_FILE_COMPLETE, + DOWNLOAD_DIRECTORY_COMPLETE, +} + +public class EventData +{ +} + +/// <summary> +/// The application event bus. +/// </summary> +public class EventBus +{ + public async Task RaiseAsync<T>(EventType type, T data) + { + + } +}
\ No newline at end of file diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index 32903bf9..69e2d2c4 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -331,6 +331,9 @@ namespace slskd.Transfers.Downloads _ = Relay.NotifyFileDownloadCompleteAsync(finalFilename); } + // todo: raise DOWNLOAD_FILE_COMPLETE + // todo: determine if there are any pending transfers in this same directory, and if not raise DOWNLOAD_DIRECTORY_COMPLETE + if (OptionsMonitor.CurrentValue.Integration.Ftp.Enabled) { _ = FTP.UploadAsync(finalFilename); |
