protected override async Task <int> OnExecuteTorrentSpecificAsync(QBittorrentClient client, CommandLineApplication app, IConsole console)
            {
                var contents = await client.GetTorrentContentsAsync(Hash);

                var viewModels = contents.Select((c, i) => new TorrentContentViewModel(c, i));

                Print(viewModels, true);
                return(ExitCodes.Success);
            }
Beispiel #2
0
                protected override async Task <int> OnExecuteTorrentSpecificAsync(QBittorrentClient client, CommandLineApplication app, IConsole console)
                {
                    if (Enum.TryParse(Value, true, out TorrentContentPriority priority))
                    {
                        await client.SetFilePriorityAsync(Hash, File, priority);
                    }
                    else
                    {
                        var contents = (await client.GetTorrentContentsAsync(Hash))?.ToList();
                        console.WriteLineColored(contents?[File]?.Priority.ToString(), ColorScheme.Current.Normal);
                    }

                    return(ExitCodes.Success);
                }
Beispiel #3
0
        public async Task GetTorrentContent()
        {
            string hash = "6C4182E5495D49382A529ABFB1C7A5A766416D68";

            await EnsureLoggedInAsync();

            var torrents = await _client.GetTorrentContentsAsync(hash);

            var torrentsdInfo = await _client.GetTorrentListAsync();

            foreach (TorrentContent content in torrents)
            {
                Console.WriteLine(content.ToString());
            }

            //await _client.SetFilePriorityAsync(hash, 0, TorrentContentPriority.Skip);

            await _client.RenameFileAsync(hash, 10, "mytest.jpg");
        }