Example #1
0
        /// <summary>
        /// Removes finished torrents in the torrent service and
        /// notifies the media processor that files are ready to process.
        /// </summary>
        public async Task CompleteFinishedDownloads()
        {
            IEnumerable <QBitTorrent> completeTorrents = await _torrentClient.GetCompletedTorrentsAsync();

            if (completeTorrents.Any())
            {
                await _torrentClient.TryDeleteAsync(completeTorrents.Select(x => x.Hash));

                // Allow a pause for file handler / lock release.
                await Task.Delay(1000);

                TryNotifyToProcessFiles(completeTorrents.Select(x => x.Name));
            }
        }