mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 03:48:19 +02:00
Compare commits
3 Commits
7f9bea00a4
...
57cb48cbd0
Author | SHA1 | Date | |
---|---|---|---|
57cb48cbd0 | |||
611e8a04df | |||
6231f9a842 |
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,13 +1,13 @@
|
|||||||
name: Bug Report
|
name: Bug Report
|
||||||
description: File a bug report
|
description: File a bug report
|
||||||
title: "[It broke]: "
|
title: "[Tranga broke]: <title>"
|
||||||
labels: ["bug"]
|
labels: ["bug"]
|
||||||
body:
|
body:
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: What is broken?
|
label: What is broken?
|
||||||
description: What happened? How did we get here?
|
description: What happened? How did we get here?
|
||||||
placeholder: The place where you tell me what you expected to happen, and what happened instead.
|
placeholder: Tell me what you expected to happen, and what happened instead.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
13
.github/ISSUE_TEMPLATE/new_connector.yml
vendored
13
.github/ISSUE_TEMPLATE/new_connector.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: New Connector Request
|
name: New Connector Request
|
||||||
description: Request a new site to be added
|
description: Request a new site to be added
|
||||||
title: "[New Connector]: "
|
title: "[New Connector]: <title>"
|
||||||
labels: ["New Connector"]
|
labels: ["New Connector"]
|
||||||
body:
|
body:
|
||||||
- type: input
|
- type: input
|
||||||
@@ -9,15 +9,12 @@ body:
|
|||||||
placeholder: https://
|
placeholder: https://
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Is the Website free to access?
|
|
||||||
description: We can't support pay-to-use sites, or captcha-proxied sites as Cloudflare.
|
|
||||||
options:
|
|
||||||
- label: The Website is freely accessible.
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Anything else?
|
label: Anything else?
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
If you want implement this read [Contributing](https://github.com/C9Glax/tranga#contributing). Thank you!
|
31
.github/PULL_REQUEST_TEMPLATE/new_connector.yml
vendored
Normal file
31
.github/PULL_REQUEST_TEMPLATE/new_connector.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: New Connector Implementation
|
||||||
|
description: New Connector
|
||||||
|
title: "<title>"
|
||||||
|
labels: ["New Connector"]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thank you for contributing. Please make sure you have read [Contributing](https://github.com/C9Glax/tranga#contributing).
|
||||||
|
Just for the sake of completion:
|
||||||
|
- type: checkboxes
|
||||||
|
id: Contributing
|
||||||
|
attributes:
|
||||||
|
label: Contributing
|
||||||
|
description: I have checked
|
||||||
|
options:
|
||||||
|
- label: Formatting (if not done yet, mark this PR as draft)
|
||||||
|
required: false
|
||||||
|
- label: I have read https://github.com/C9Glax/tranga#if-you-want-to-add-a-new-website-connector
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
attributes:
|
||||||
|
label: Existing Issue
|
||||||
|
placeholder: #<Issue number>
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Anything else?
|
||||||
|
validations:
|
||||||
|
required: false
|
62
README.md
62
README.md
@@ -88,7 +88,7 @@ Endpoints are documented in Swagger. Just spin up an instance, and go to `http:/
|
|||||||
## Built With
|
## Built With
|
||||||
|
|
||||||
- ASP.NET
|
- ASP.NET
|
||||||
- Entity Framework Core
|
- Entity Framework Core (EF Core)
|
||||||
- [PostgreSQL](https://www.postgresql.org/about/licence/)
|
- [PostgreSQL](https://www.postgresql.org/about/licence/)
|
||||||
- [Ngpsql](https://github.com/npgsql/npgsql/blob/main/LICENSE)
|
- [Ngpsql](https://github.com/npgsql/npgsql/blob/main/LICENSE)
|
||||||
- [Swagger](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/LICENSE)
|
- [Swagger](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/LICENSE)
|
||||||
@@ -140,7 +140,7 @@ Downloads (default) are stored in - but this can be configured in `settings.json
|
|||||||
- Linux `/Manga`
|
- Linux `/Manga`
|
||||||
- Windows `%currentDirectory%/Downloads`
|
- Windows `%currentDirectory%/Downloads`
|
||||||
|
|
||||||
#### Prerequisits
|
### Prerequisits
|
||||||
|
|
||||||
[.NET-Core 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
|
[.NET-Core 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
|
||||||
|
|
||||||
@@ -149,15 +149,54 @@ Downloads (default) are stored in - but this can be configured in `settings.json
|
|||||||
|
|
||||||
If you want to contribute, please feel free to fork and create a Pull-Request!
|
If you want to contribute, please feel free to fork and create a Pull-Request!
|
||||||
|
|
||||||
General rules:
|
### General rules
|
||||||
- Strongly-type your variables. This improves readability.
|
|
||||||
```csharp
|
|
||||||
var xyz = Object.GetSomething(); //Do not do this. What type is xyz (without looking at Method returns etc.)?
|
|
||||||
Manga[] zyx = Object.GetAnotherThing(); //I can now easily see that zyx is an Array.
|
|
||||||
```
|
|
||||||
Tranga is using a code-first Entity-Framework Core approach. If you modify the db-table structure you need to create a migration.
|
|
||||||
|
|
||||||
**A broad overview of where is what:**<br />
|
- Strong-type your variables. This improves readability.
|
||||||
|
- **DO**
|
||||||
|
```csharp
|
||||||
|
Manga[] zyx = Object.GetAnotherThing(); //I can see that zyx is an Array, without digging through more code
|
||||||
|
```
|
||||||
|
- **DO _NOT_**
|
||||||
|
```csharp
|
||||||
|
var xyz = Object.GetSomething(); //What is xyz? An Array? A string? An object?
|
||||||
|
```
|
||||||
|
|
||||||
|
- Indent your `if` and `for` blocks
|
||||||
|
- **DO**
|
||||||
|
```csharp
|
||||||
|
if(true)
|
||||||
|
return false;
|
||||||
|
```
|
||||||
|
- **DO _NOT_**
|
||||||
|
```csharp
|
||||||
|
if(true) return false;
|
||||||
|
```
|
||||||
|
<details>
|
||||||
|
<summary>Because try reading this</summary>
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
if (s.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || s.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) return s;
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- When using shorthand, _this_ improves readability for longer lines (at some point just use if-else...):
|
||||||
|
```csharp
|
||||||
|
bool retVal = xyz is true
|
||||||
|
? false
|
||||||
|
: true;
|
||||||
|
```
|
||||||
|
```csharp
|
||||||
|
bool retVal = xyz?
|
||||||
|
?? abc?
|
||||||
|
?? true;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Database and EF Core
|
||||||
|
|
||||||
|
Tranga is using a **code-first** EF-Core approach. If you modify the database(context) structure you need to create a migration.
|
||||||
|
|
||||||
|
### A broad overview of where is what:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -167,7 +206,8 @@ Tranga is using a code-first Entity-Framework Core approach. If you modify the d
|
|||||||
- `MangaDownloadClients/**` Networking-Clients for Scraping
|
- `MangaDownloadClients/**` Networking-Clients for Scraping
|
||||||
- `Controllers/**` ASP.NET Controllers (Endpoints)
|
- `Controllers/**` ASP.NET Controllers (Endpoints)
|
||||||
|
|
||||||
If you want to add a new Website-Connector: <br />
|
##### If you want to add a new Website-Connector:
|
||||||
|
|
||||||
1. Copy one of the existing connectors, or start from scratch and inherit from `API.Schema.MangaConnectors.MangaConnector`.
|
1. Copy one of the existing connectors, or start from scratch and inherit from `API.Schema.MangaConnectors.MangaConnector`.
|
||||||
2. Add the new Connector as Object-Instance in `Tranga.cs` to the MangaConnector-Array `connectors`.
|
2. Add the new Connector as Object-Instance in `Tranga.cs` to the MangaConnector-Array `connectors`.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user