Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server v2 #167

Draft
wants to merge 153 commits into
base: cuttingedge
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
7e54577
Added initial documentation for API Calls
estradalab Apr 6, 2024
dd965d8
Revert "Added initial documentation for API Calls"
db-2001 Apr 6, 2024
7628510
Documentation for API Calls
db-2001 Apr 6, 2024
6f5fb7e
API rewrite to parse JSON body for POST and DELETE
db-2001 Apr 7, 2024
dbc1b94
Merge branch 'cuttingedge' into json-api
db-2001 Apr 18, 2024
33b8ede
Use new requestParams variable for AprilFoolsMode setting
db-2001 Apr 18, 2024
2768ab3
Merge remote-tracking branch 'upstream/cuttingedge' into json-api
db-2001 Apr 18, 2024
01bab62
Log request if unknown
db-2001 Apr 18, 2024
a8aa7d3
Okay, actually write request variables to log.
db-2001 Apr 18, 2024
7e5fa6c
API v2
C9Glax Apr 19, 2024
f5cecb9
Github Reference Link Style
C9Glax Apr 19, 2024
0313d81
Return JobIds instead of full jobs.
C9Glax Apr 19, 2024
238395a
Return JobIds instead of full jobs.
C9Glax Apr 19, 2024
595051b
Merge remote-tracking branch 'origin/Server-V2' into Server-V2
C9Glax Apr 19, 2024
d22b49c
Change Method Header for Handlers to return the response to HandleReq…
C9Glax Apr 19, 2024
bd14722
Merge remote-tracking branch 'refs/remotes/db-2001/json-api' into Ser…
C9Glax Apr 19, 2024
2828fec
Merge
C9Glax Apr 19, 2024
f79743e
actually use v2 API
C9Glax Apr 19, 2024
fa25980
Hard cutover https://github.com/C9Glax/tranga/pull/167#issuecomment-2…
C9Glax Apr 20, 2024
630e507
#74 API Documentation
C9Glax Apr 20, 2024
011af9c
#114 API Documentation
C9Glax Apr 20, 2024
5e64709
Spelling
C9Glax Apr 20, 2024
c41f04d
All Valid Request Paths return "Not Implemented".
C9Glax Apr 20, 2024
a610eff
Merge branch 'refs/heads/cuttingedge' into Server-V2
C9Glax Apr 20, 2024
e96dd07
Link API Documentation in README.md
C9Glax Apr 20, 2024
9a02859
Docker Image build
C9Glax Apr 20, 2024
8b9769b
Merge branch 'refs/heads/master' into Server-V2
C9Glax Apr 20, 2024
b3fb53f
Corrected link
C9Glax Apr 20, 2024
4cb7c94
Implemented /v2/Connector/<ConnectorName>/GetManga
C9Glax Apr 21, 2024
4104169
Fix path excluding symbols that are used in requests
C9Glax Apr 21, 2024
6d48a10
Implemented GET
C9Glax Apr 21, 2024
49cfff8
Changed the Creation Job API to a single Endpoint /v2/Job/Create/<Type>
C9Glax Apr 21, 2024
b6ffb97
Merge branch 'refs/heads/cuttingedge' into Server-V2
C9Glax Apr 22, 2024
3adb103
Fix API-Path prematurely triggering match.
C9Glax Apr 22, 2024
cce4901
Implement all /v2/Settings
C9Glax Apr 22, 2024
6448293
Implemented GET /v2/LogFile
C9Glax Apr 22, 2024
03e90ec
No longer require connector name to create job
C9Glax Apr 22, 2024
c323132
nullable
C9Glax Apr 22, 2024
ea866e0
Added Endpoint /v2/Manga lists all known Manga
C9Glax Apr 22, 2024
e360037
Add "(?:/?)" to the end of all Regex RequestPaths
C9Glax Apr 22, 2024
8c66bbc
Use publicationCache to store and update Manga
C9Glax Apr 22, 2024
bce7718
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Apr 22, 2024
cee7870
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Apr 22, 2024
a56555e
Add LibraryConnector.Test to see if requests can be made to endpoint.
C9Glax Apr 22, 2024
0ced3a7
Implement /v2/LibraryConnector/*
C9Glax Apr 22, 2024
2651a0c
Implemented /v2/NotificationConnector/*
C9Glax Apr 22, 2024
3d08b1f
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Apr 25, 2024
28a0efe
Add Endpoint /v2/Manga/internalId/Chapters/Latest
C9Glax Apr 25, 2024
80dc8fb
Resolves #176 Return 409 conflict if job already exists.
C9Glax Apr 25, 2024
061da1b
Add field customFolder and startChapter to CreateJob Endpoint
C9Glax Apr 25, 2024
8887cea
Add Endpoint POST /v2/Manga/internalId/ignoreChaptersBelow #167
C9Glax Apr 25, 2024
2e1f633
Add Endpoint POST /v2/Manga/internalId/moveFolder #167
C9Glax Apr 25, 2024
5b22246
Add Endpoint GET /v2/Job returns list of jobs specified by jobid
C9Glax Apr 25, 2024
0735e2c
Change GET /v2/Manga to /v2/Mangas
C9Glax Apr 25, 2024
49a9b7c
Corrected Job->Manga in return
C9Glax Apr 25, 2024
7f95ab9
Add Endpoint GET /v2/Manga to request multiple Manga from internalIds…
C9Glax Apr 25, 2024
7ed3846
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Apr 25, 2024
4021237
Add Endpoint GET /v2/Manga/Search GlobalSearch
C9Glax Apr 25, 2024
017f31c
Clean
C9Glax Apr 26, 2024
2cfc7ac
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Apr 27, 2024
27a5598
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax May 26, 2024
5c30913
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax May 26, 2024
beb4553
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax May 26, 2024
8ccb6c0
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax May 26, 2024
6ae3918
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jun 1, 2024
4f14903
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jun 1, 2024
790e77b
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jun 1, 2024
ee6de66
Merge branch 'refs/heads/C9Glax-tranga-issue-187' into Server-V2
C9Glax Jun 15, 2024
fd20b9f
NTFY use Username and Password
C9Glax Jun 15, 2024
fab30dc
Documentation
C9Glax Jun 15, 2024
8607bd2
#187 NTFY JsonConverter
C9Glax Jun 15, 2024
f3e0959
Merge pull request #198 from C9Glax/master
C9Glax Jun 29, 2024
5bc2a89
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jun 29, 2024
d221532
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jun 29, 2024
d73bf70
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jul 11, 2024
6b9ddca
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Jul 31, 2024
cf242f8
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Aug 10, 2024
9dd5217
Update MangaHere bad ManhuaPlus to v2 architecture
C9Glax Aug 10, 2024
8145abb
Fix workign Directory in TrangaArgsMain
C9Glax Aug 10, 2024
b18f8e4
Fix GET /v2/Job/Types
C9Glax Aug 10, 2024
2f36701
Reduce Logspam
C9Glax Aug 10, 2024
1ee9b64
Fix Permissions for manga-directory
C9Glax Aug 10, 2024
6520aeb
Cleanup MangaCache
C9Glax Aug 10, 2024
960d3f7
Fix Cover location
C9Glax Aug 10, 2024
fc884ad
Fix HandleRequest trying to send more than one response
C9Glax Aug 10, 2024
032ee95
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Aug 26, 2024
3c3f7bb
Merge recent changes to TrangaSettings backend
C9Glax Aug 26, 2024
e95eb04
#229 Resize cover Images if requested
C9Glax Aug 26, 2024
054c887
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Aug 26, 2024
06cdbbd
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Aug 26, 2024
75eea8c
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Aug 26, 2024
217700d
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 9, 2024
190fa8c
Fix #239 multiple enumeration on Export
C9Glax Sep 9, 2024
3b9d4a6
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 11, 2024
77bb309
Fix #248 double closing OutputStream in response
C9Glax Sep 16, 2024
99df9a9
Fix #248
C9Glax Sep 16, 2024
c6cfd9e
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 16, 2024
73ad881
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 16, 2024
18edcef
Resolve #247
C9Glax Sep 16, 2024
c36204c
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 16, 2024
96e2845
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 16, 2024
be68ddc
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 16, 2024
7b6724a
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 18, 2024
a92eba2
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 21, 2024
32ecdcd
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 23, 2024
48ab44c
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 27, 2024
26a07f4
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 27, 2024
1c5f105
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 27, 2024
4871bc8
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Sep 28, 2024
d80fcd9
Manga website url nullable
C9Glax Sep 30, 2024
225db8b
Change return type of api request to get Connectors to get connector-…
C9Glax Oct 17, 2024
6a4d454
Extend Types.md documentation
C9Glax Oct 17, 2024
d4af068
Add BaseUris: string[] field to MangaConnector, to match Connector to…
C9Glax Oct 17, 2024
575fb73
typo
C9Glax Oct 17, 2024
2c9bd25
Fix order of RequestPaths
C9Glax Oct 18, 2024
8670863
Add Job and ProgressToken Types to docs
C9Glax Oct 18, 2024
00c4f05
Update documentation
C9Glax Oct 18, 2024
1a63136
Use Sixlabors.Imagesharp for resizing coverimages.
C9Glax Oct 18, 2024
70993a6
Add ReleaseStatus to docs/types.md
C9Glax Oct 18, 2024
27f823c
GET V2Manga with internalIds return distinct array.
C9Glax Oct 19, 2024
a88b85e
Add numbers to JobTypes (and type documentation)
C9Glax Oct 19, 2024
26b2910
Add GET /v2/Jobs/Standby
C9Glax Oct 19, 2024
240af81
Add doc types chapter
C9Glax Oct 20, 2024
f9a30f2
Types documentation add quotation marks
C9Glax Oct 20, 2024
f57667b
add documentation types settings
C9Glax Oct 20, 2024
582b3af
Add docs types LibraryConnector
C9Glax Oct 20, 2024
93696fb
docs Types documentation NotificationConnector
C9Glax Oct 20, 2024
9d47445
Assign numbers to ProgressToken.State
C9Glax Oct 20, 2024
96b5921
GET LibraryTypes Create and Test set url to lowercase
C9Glax Oct 23, 2024
2db85e5
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Oct 27, 2024
fb7ed21
Update Types doc with last merge for Chapters
C9Glax Oct 27, 2024
febce6b
Downloaded Image processing:
C9Glax Oct 27, 2024
585d7e3
Fix order of startup: Load Manga first, the jobs
C9Glax Oct 27, 2024
07c6081
#236
C9Glax Oct 27, 2024
3e581e2
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Oct 30, 2024
1cb8899
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Oct 31, 2024
f7daacf
Use Robidoux algorithm for resizing covers
C9Glax Oct 31, 2024
b7bc04a
Add zstd compression to all API Traffic
C9Glax Oct 31, 2024
3f37eef
Include modified date in image responses for cachecontrol
C9Glax Oct 31, 2024
c7dc5e7
Add "Expires" Header to image responses
C9Glax Oct 31, 2024
5018800
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Nov 2, 2024
bc44a53
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Nov 2, 2024
483dcc4
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Nov 2, 2024
1bd9145
Asuratoon Server-V2
C9Glax Nov 11, 2024
29f3f1a
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
C9Glax Nov 28, 2024
b5b45d0
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 4, 2024
44ff158
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 4, 2024
7daebcb
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 12, 2024
4040b58
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 12, 2024
afcc2ca
merge
C9Glax Dec 12, 2024
9d6a8ed
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 13, 2024
57df419
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 14, 2024
bf9fe51
Merge branch 'cuttingedge-merge-ServerV2' into Server-V2
C9Glax Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'refs/heads/cuttingedge-merge-ServerV2' into Server-V2
# Conflicts:
#	Tranga/Server.cs
  • Loading branch information
C9Glax committed Jun 29, 2024
commit 5bc2a8909d2011a5e4f843186bfe740ef62e9bd6
14 changes: 9 additions & 5 deletions Tranga/Chapter.cs
Original file line number Diff line number Diff line change
@@ -91,18 +91,22 @@ internal bool CheckChapterIsDownloaded(string downloadLocation)
{
if (!Directory.Exists(Path.Join(downloadLocation, parentManga.folderName)))
return false;
FileInfo[] archives = new DirectoryInfo(Path.Join(downloadLocation, parentManga.folderName)).GetFiles();
FileInfo[] archives = new DirectoryInfo(Path.Join(downloadLocation, parentManga.folderName)).GetFiles().Where(file => file.Name.Split('.')[^1] == "cbz").ToArray();
Regex volChRex = new(@"(?:Vol(?:ume)?\.([0-9]+)\D*)?Ch(?:apter)?\.([0-9]+(?:\.[0-9]+)*)");

Chapter t = this;
return archives.Select(archive => archive.Name).Any(archiveFileName =>
string thisPath = GetArchiveFilePath(downloadLocation);
FileInfo? archive = archives.FirstOrDefault(archive =>
{
Match m = volChRex.Match(archiveFileName);
Match m = volChRex.Match(archive.Name);
string archiveVolNum = m.Groups[1].Success ? m.Groups[1].Value : "0";
string archiveChNum = m.Groups[2].Value;
return archiveVolNum == t.volumeNumber &&
archiveChNum == t.chapterNumber;
return archiveVolNum == t.volumeNumber && archiveChNum == t.chapterNumber ||
archiveVolNum == "0" && archiveChNum == t.chapterNumber;
});
if(archive is not null && thisPath != archive.FullName)
archive.MoveTo(thisPath);
return archive is not null;
}
/// <summary>
/// Creates full file path of chapter-archive
1 change: 1 addition & 0 deletions Tranga/MangaConnectors/MangaConnector.cs
Original file line number Diff line number Diff line change
@@ -299,6 +299,7 @@ protected string SaveCoverImageToCache(string url, string mangaInternalId, Reque
RequestResult coverResult = downloadClient.MakeRequest(url, requestType);
using MemoryStream ms = new();
coverResult.result.CopyTo(ms);
Directory.CreateDirectory(settings.coverImageCache);
File.WriteAllBytes(saveImagePath, ms.ToArray());
Log($"Saving cover to {saveImagePath}");
return saveImagePath;
9 changes: 6 additions & 3 deletions Tranga/MangaConnectors/Mangaworld.cs
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ private Manga ParseSinglePublicationFromHtml(HtmlDocument document, string publi

string posterUrl = document.DocumentNode.SelectSingleNode("//img[@class='rounded']").GetAttributeValue("src", "");

string coverFileNameInCache = SaveCoverImageToCache(posterUrl, publicationId, RequestType.MangaCover);
string coverFileNameInCache = SaveCoverImageToCache(posterUrl, publicationId.Replace('/', '-'), RequestType.MangaCover);

string description = document.DocumentNode.SelectSingleNode("//div[@id='noidungm']").InnerText;

@@ -153,10 +153,13 @@ private List<Chapter> ParseChaptersFromHtml(Manga manga, HtmlDocument document)
{
foreach (HtmlNode volNode in document.DocumentNode.SelectNodes("//div[contains(concat(' ',normalize-space(@class),' '),'volume-element')]"))
{
string volume = volNode.SelectNodes("div").First(node => node.HasClass("volume")).SelectSingleNode("p").InnerText.Split(' ')[^1];
string volume = Regex.Match(volNode.SelectNodes("div").First(node => node.HasClass("volume")).SelectSingleNode("p").InnerText,
@"[Vv]olume ([0-9]+).*").Groups[1].Value;
foreach (HtmlNode chNode in volNode.SelectNodes("div").First(node => node.HasClass("volume-chapters")).SelectNodes("div"))
{
string number = chNode.SelectSingleNode("a").SelectSingleNode("span").InnerText.Split(" ")[^1];

string number = Regex.Match(chNode.SelectSingleNode("a").SelectSingleNode("span").InnerText,
@"[Cc]apitolo ([0-9]+).*").Groups[1].Value;
string url = chNode.SelectSingleNode("a").GetAttributeValue("href", "");
ret.Add(new Chapter(manga, null, volume, number, url));
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.