Skip to content

Commit

Permalink
Merged v0.5.1 develop into main.
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Feb 11, 2022
2 parents 41096d6 + d745049 commit 150479e
Show file tree
Hide file tree
Showing 256 changed files with 6,903 additions and 1,838 deletions.
103 changes: 103 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Bug Report
description: Create a report to help us improve
title: ""
labels: ["needs-triage"]
assignees:
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: markdown
attributes:
value: |
If you have a feature request, please go to our [Feature Requests](https://feats.kavitareader.com) page.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what steps you took so we can try to reproduce.
placeholder: Tell us what you see!
value: ""
validations:
required: true
- type: textarea
id: what-was-expected
attributes:
label: What did you expect?
description: What did you expect to happen?
placeholder: Tell us what you expected to see!
value: ""
validations:
required: true
- type: textarea
id: version
attributes:
label: Version
description: What version of our software are you running?
placeholder: Can be found by going to Server Settings > System
value: ""
validations:
required: true
- type: dropdown
id: OS
attributes:
label: What OS is Kavita being run on?
multiple: false
options:
- Docker
- Windows
- Linux
- Mac
- type: dropdown
id: desktop-OS
attributes:
label: If issue being seen on Desktop, what OS are you running where you see the issue?
multiple: false
options:
- Windows
- Linux
- Mac
- type: dropdown
id: desktop-browsers
attributes:
label: If issue being seen on Desktop, what browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: dropdown
id: mobile-OS
attributes:
label: If issue being seen on Mobile, what OS are you running where you see the issue?
multiple: false
options:
- Android
- iOS
- type: dropdown
id: mobile-browsers
attributes:
label: If issue being seen on Mobile, what browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
id: anything-else
attributes:
label: Additional Notes
description: Any other information about the issue not covered in this form?
placeholder: e.g. Running Kavita on a raspberry pi
value: ""
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
122 changes: 61 additions & 61 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,68 +36,68 @@ jobs:
name: csproj
path: Kavita.Common/Kavita.Common.csproj

# test:
# name: Install Sonar & Test
# needs: build
# runs-on: windows-latest
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# include-prerelease: True
# dotnet-version: '6.0'
#
# - name: Install dependencies
# run: dotnet restore
#
# - name: Set up JDK 11
# uses: actions/setup-java@v1
# with:
# java-version: 1.11
#
# - name: Cache SonarCloud packages
# uses: actions/cache@v1
# with:
# path: ~\sonar\cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
#
# - name: Cache SonarCloud scanner
# id: cache-sonar-scanner
# uses: actions/cache@v1
# with:
# path: .\.sonar\scanner
# key: ${{ runner.os }}-sonar-scanner
# restore-keys: ${{ runner.os }}-sonar-scanner
#
# - name: Install SonarCloud scanner
# if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
# shell: powershell
# run: |
# New-Item -Path .\.sonar\scanner -ItemType Directory
# dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
#
# - name: Sonar Scan
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# shell: powershell
# run: |
# .\.sonar\scanner\dotnet-sonarscanner begin /k:"Kareadita_Kavita" /o:"kareadita" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
# dotnet build --configuration Release
# .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
#
# - name: Test
# run: dotnet test --no-restore --verbosity normal
test:
name: Install Sonar & Test
needs: build
runs-on: windows-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
include-prerelease: True
dotnet-version: '6.0'

- name: Install dependencies
run: dotnet restore

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Sonar Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Kareadita_Kavita" /o:"kareadita" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build --configuration Release
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Test
run: dotnet test --no-restore --verbosity normal

version:
name: Bump version on Develop push
needs: [ build ]
needs: [ build, test ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
steps:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:

develop:
name: Build Nightly Docker if Develop push
needs: [ build, version ]
needs: [ build, test, version ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
steps:
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:

stable:
name: Build Stable Docker if Main push
needs: [ build ]
needs: [ build, test ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ UI/Web/dist/
/API.Tests/Extensions/Test Data/modified on run.txt

# All config files/folders in config except appsettings.json
/API/config-bak/
/API/config-bak/*.*
/API/config-bak/**/
/API/config/covers/
/API/config/logs/
/API/config/backups/
Expand Down
21 changes: 5 additions & 16 deletions API.Benchmark/ParserBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,26 @@ public ParserBenchmarks()
Console.WriteLine($"Performing benchmark on {_names.Count} series");
}

private static void NormalizeOriginal(string name)
{
Regex.Replace(name.ToLower(), "[^a-zA-Z0-9]", string.Empty);
}

private static void NormalizeNew(string name)
private static string Normalize(string name)
{
// ReSharper disable once UnusedVariable
var ret = NormalizeRegex.Replace(name, string.Empty).ToLower();
var normalized = NormalizeRegex.Replace(name, string.Empty).ToLower();
return string.IsNullOrEmpty(normalized) ? name : normalized;
}



[Benchmark]
public void TestNormalizeName()
{
foreach (var name in _names)
{
NormalizeOriginal(name);
Normalize(name);
}
}


[Benchmark]
public void TestNormalizeName_New()
{
foreach (var name in _names)
{
NormalizeNew(name);
}
}

[Benchmark]
public void TestIsEpub()
{
Expand Down
1 change: 0 additions & 1 deletion API.Benchmark/TestBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using API.Comparators;
using API.DTOs;
using API.Extensions;
using BenchmarkDotNet.Attributes;
Expand Down
1 change: 0 additions & 1 deletion API.Tests/Extensions/SeriesExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using API.Extensions;
using API.Parser;
using API.Services.Tasks.Scanner;
using API.Tests.Helpers;
using Xunit;

namespace API.Tests.Extensions
Expand Down
2 changes: 0 additions & 2 deletions API.Tests/Helpers/CacheHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using API.Entities;
using API.Helpers;
using API.Services;
using Microsoft.Extensions.Logging;
using NSubstitute;
using Xunit;

namespace API.Tests.Helpers;
Expand Down
4 changes: 2 additions & 2 deletions API.Tests/Helpers/EntityFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public static Volume CreateVolume(string volumeNumber, List<Chapter> chapters =
};
}

public static Chapter CreateChapter(string range, bool isSpecial, List<MangaFile> files = null)
public static Chapter CreateChapter(string range, bool isSpecial, List<MangaFile> files = null, int pageCount = 0)
{
return new Chapter()
{
IsSpecial = isSpecial,
Range = range,
Number = API.Parser.Parser.MinimumNumberFromRange(range) + string.Empty,
Files = files ?? new List<MangaFile>(),
Pages = 0,
Pages = pageCount,

};
}
Expand Down
6 changes: 4 additions & 2 deletions API.Tests/Parser/ComicParserTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.IO.Abstractions.TestingHelpers;
using API.Entities.Enums;
using API.Parser;
using API.Services;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -186,6 +184,10 @@ public void ParseComicChapterTest(string filename, string expected)
[InlineData("Asterix - HS - Les 12 travaux d'Astérix", true)]
[InlineData("Sillage Hors Série - Le Collectionneur - Concordance-DKFR", true)]
[InlineData("laughs", false)]
[InlineData("Annual Days of Summer", false)]
[InlineData("Adventure Time 2013 Annual #001 (2013)", true)]
[InlineData("Adventure Time 2013_Annual_#001 (2013)", true)]
[InlineData("Adventure Time 2013_-_Annual #001 (2013)", true)]
public void ParseComicSpecialTest(string input, bool expected)
{
Assert.Equal(expected, !string.IsNullOrEmpty(API.Parser.Parser.ParseComicSpecial(input)));
Expand Down
2 changes: 0 additions & 2 deletions API.Tests/Parser/MangaParserTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using API.Entities.Enums;
using API.Parser;
using Xunit;
using Xunit.Abstractions;

Expand Down
Loading

0 comments on commit 150479e

Please sign in to comment.