2022-02-10 23:57:44 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.CommandLine;
|
|
|
|
using System.CommandLine.Invocation;
|
2022-09-29 05:10:49 +00:00
|
|
|
using System.CommandLine.NamingConventionBinder;
|
2022-02-10 23:57:44 +00:00
|
|
|
using System.Linq;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.Extensions.Logging;
|
2022-10-14 22:08:21 +00:00
|
|
|
using Wabbajack.CLI.Builder;
|
2022-02-10 23:57:44 +00:00
|
|
|
using Wabbajack.Common;
|
2022-02-11 05:05:51 +00:00
|
|
|
using Wabbajack.Downloaders.Bethesda;
|
2022-02-10 23:57:44 +00:00
|
|
|
using Wabbajack.DTOs;
|
2022-02-11 05:05:51 +00:00
|
|
|
using Wabbajack.DTOs.DownloadStates;
|
|
|
|
using Wabbajack.DTOs.Logins.BethesdaNet;
|
2022-02-10 23:57:44 +00:00
|
|
|
using Wabbajack.Networking.BethesdaNet;
|
|
|
|
using Wabbajack.Paths;
|
|
|
|
|
|
|
|
namespace Wabbajack.CLI.Verbs;
|
|
|
|
|
2022-10-14 22:08:21 +00:00
|
|
|
public class ListCreationClubContent
|
2022-02-10 23:57:44 +00:00
|
|
|
{
|
|
|
|
private readonly ILogger<ListCreationClubContent> _logger;
|
|
|
|
private readonly Client _client;
|
2022-02-11 05:05:51 +00:00
|
|
|
private readonly BethesdaDownloader _downloader;
|
2022-02-10 23:57:44 +00:00
|
|
|
|
2022-02-11 05:05:51 +00:00
|
|
|
public ListCreationClubContent(ILogger<ListCreationClubContent> logger, Client wjClient, Wabbajack.Downloaders.Bethesda.BethesdaDownloader downloader)
|
2022-02-10 23:57:44 +00:00
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
_client = wjClient;
|
2022-02-11 05:05:51 +00:00
|
|
|
_downloader = downloader;
|
2022-02-10 23:57:44 +00:00
|
|
|
}
|
|
|
|
|
2022-10-01 01:35:36 +00:00
|
|
|
public static VerbDefinition Definition =
|
|
|
|
new("list-creation-club-content", "Lists all known creation club content", Array.Empty<OptionDefinition>());
|
|
|
|
|
2022-02-10 23:57:44 +00:00
|
|
|
public async Task<int> Run(CancellationToken token)
|
|
|
|
{
|
|
|
|
_logger.LogInformation("Getting list of content");
|
|
|
|
var skyrimContent = (await _client.ListContent(Game.SkyrimSpecialEdition, token))
|
|
|
|
.Select(f => (Game.SkyrimSpecialEdition, f));
|
|
|
|
var falloutContent = (await _client.ListContent(Game.Fallout4, token))
|
|
|
|
.Select(f => (Game.Fallout4, f));
|
|
|
|
|
2022-02-11 05:05:51 +00:00
|
|
|
foreach (var (game, content) in skyrimContent.Concat(falloutContent).OrderBy(f => f.f.Content.Name))
|
2022-02-10 23:57:44 +00:00
|
|
|
{
|
|
|
|
Console.WriteLine($"Game: {game}");
|
2022-02-11 05:05:51 +00:00
|
|
|
Console.WriteLine($"Name: {content.Content.Name}");
|
|
|
|
Console.WriteLine($"Download Size: {content.Content.DepotSize.ToFileSizeString()}");
|
|
|
|
Console.WriteLine($"Uri: {_downloader.UnParse(content.State)}");
|
2022-02-10 23:57:44 +00:00
|
|
|
Console.WriteLine("-----------------------------------");
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|