Skip to content

Commit

Permalink
1.2.0.0 Release
Browse files Browse the repository at this point in the history
Adds new features, optimizations and under-the-hood changes.

In this PR includes the changes:
[Feature] Construct series from command
[Feature] Support multiple IDs to be processed on `get` command
[Improvements] Skip already existing files upon retrying after failure or cancel
[Improvements] Add configuration options (see wiki)
[Framework] Update dependencies to latest
[Framework] Migrates to .NET 7
[Code] Refactored command parsers
[Code] Refactored downloader
[Fix] Fixes issue where when tachiyomi layout is enabled may produce empty directory compression.
[Docs] Moved docs to wiki
  • Loading branch information
fumiichan committed Mar 12, 2023
2 parents a858c30 + 2efd105 commit f96e05a
Show file tree
Hide file tree
Showing 114 changed files with 2,537 additions and 1,799 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
jobs:
build:
docker:
- image: mcr.microsoft.com/dotnet/sdk:6.0
- image: mcr.microsoft.com/dotnet/sdk:7.0
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Mac
.DS_Store

# User-specific files
*.rsuser
*.suo
Expand Down Expand Up @@ -359,4 +362,4 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
10 changes: 0 additions & 10 deletions Api/Responses/GalleryImageObjectResponse.cs

This file was deleted.

15 changes: 0 additions & 15 deletions Api/Responses/GalleryImageResponse.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Api/Responses/GalleryListResponse.cs

This file was deleted.

28 changes: 0 additions & 28 deletions Api/Responses/GalleryResponse.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Api/Responses/GallerySearchResponse.cs

This file was deleted.

21 changes: 0 additions & 21 deletions Api/Responses/GalleryTagResponse.cs

This file was deleted.

15 changes: 0 additions & 15 deletions Api/Responses/GalleryTitleResponse.cs

This file was deleted.

78 changes: 34 additions & 44 deletions AsukaApplication.cs
Original file line number Diff line number Diff line change
@@ -1,62 +1,52 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using asuka.Commandline;
using asuka.Commandline.Options;
using CommandLine;
using asuka.CommandOptions;
using asuka.CommandParsers;
using asuka.Output;
using asuka.Output.Writer;

namespace asuka;

public class AsukaApplication
{
private readonly IGetCommandService _getCommand;
private readonly IRecommendCommandService _recommendCommand;
private readonly ISearchCommandService _searchCommand;
private readonly IRandomCommandService _randomCommand;
private readonly IFileCommandService _fileCommand;
private readonly IConsoleWriter _console;
private readonly IConfigureCommand _configureCommand;
private readonly ICommandLineParserFactory _command;

public AsukaApplication(
IGetCommandService getCommand,
IRecommendCommandService recommendCommand,
IConsoleWriter console,
ISearchCommandService searchCommand,
IRandomCommandService randomCommand,
IFileCommandService fileCommand,
IConfigureCommand configureCommand)
public AsukaApplication(IConsoleWriter console, ICommandLineParserFactory command)
{
_getCommand = getCommand;
_recommendCommand = recommendCommand;
_console = console;
_searchCommand = searchCommand;
_randomCommand = randomCommand;
_fileCommand = fileCommand;
_configureCommand = configureCommand;
_command = command;
}

public async Task RunAsync(IEnumerable<string> args)
{
try
{
var parser = Parser.Default
.ParseArguments<GetOptions, RecommendOptions, SearchOptions, RandomOptions, FileCommandOptions, ConfigureOptions>(args);
await parser.MapResult(
async (GetOptions opts) => { await _getCommand.RunAsync(opts); },
async (RecommendOptions opts) => { await _recommendCommand.RunAsync(opts); },
async (SearchOptions opts) => { await _searchCommand.RunAsync(opts); },
async (RandomOptions opts) => { await _randomCommand.RunAsync(opts); },
async (FileCommandOptions opts) => { await _fileCommand.RunAsync(opts); },
async (ConfigureOptions opts) => { await _configureCommand.RunAsync(opts); },
_ => Task.FromResult(1));
_console.SuccessLine("Task completed.");
}
catch (Exception err)
{
_console.ErrorLine($"An exception occured. Error: {err.Message}");
_console.ErrorLine("Full Error:");
_console.WriteLine(err);
}
var parser = Parser.Default
.ParseArguments<GetOptions, RecommendOptions, SearchOptions, RandomOptions, FileCommandOptions, ConfigureOptions, SeriesCreatorCommandOptions, CookieConfigureOptions>(args);
await parser.MapResult(
async (GetOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Get); },
async (RecommendOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Recommend); },
async (SearchOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Search); },
async (RandomOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Random); },
async (FileCommandOptions opts) => { await RunCommand(opts, CommandLineParserTokens.File); },
async (ConfigureOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Configure); },
async (SeriesCreatorCommandOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Series); },
async (CookieConfigureOptions opts) => { await RunCommand(opts, CommandLineParserTokens.Cookie); },
errors =>
{
foreach (var error in errors)
{
_console.ErrorLine($"An error occured. Type: {error.Tag}");
}
return Task.FromResult(1);
});
}

private async Task RunCommand(object opts, CommandLineParserTokens token)
{
var service = _command.GetInstance(token);
await service.RunAsync(opts);

_console.SuccessLine("Task completed.");
}
}
25 changes: 0 additions & 25 deletions CommandOptions/ConfigureOptions.cs

This file was deleted.

11 changes: 0 additions & 11 deletions CommandOptions/IRequiresInputOption.cs

This file was deleted.

74 changes: 0 additions & 74 deletions CommandParsers/ConfigureCommand.cs

This file was deleted.

Loading

0 comments on commit f96e05a

Please sign in to comment.