mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 11:27:32 +01:00
Merge remote-tracking branch 'origin/cuttingedge-merge-ServerV2' into cuttingedge-merge-ServerV2
This commit is contained in:
commit
895128a462
@ -38,7 +38,7 @@ jobs:
|
|||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
2
.github/workflows/docker-image-dev.yml
vendored
2
.github/workflows/docker-image-dev.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
2
.github/workflows/docker-image-serverv2.yml
vendored
2
.github/workflows/docker-image-serverv2.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
|||||||
context: ./
|
context: ./
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
@ -58,8 +58,9 @@ public readonly struct Chapter : IComparable
|
|||||||
|
|
||||||
public int CompareTo(object? obj)
|
public int CompareTo(object? obj)
|
||||||
{
|
{
|
||||||
if (obj is Chapter otherChapter)
|
if(obj is not Chapter otherChapter)
|
||||||
{
|
throw new ArgumentException($"{obj} can not be compared to {this}");
|
||||||
|
|
||||||
if (float.TryParse(volumeNumber, GlobalBase.numberFormatDecimalPoint, out float volumeNumberFloat) &&
|
if (float.TryParse(volumeNumber, GlobalBase.numberFormatDecimalPoint, out float volumeNumberFloat) &&
|
||||||
float.TryParse(chapterNumber, GlobalBase.numberFormatDecimalPoint, out float chapterNumberFloat) &&
|
float.TryParse(chapterNumber, GlobalBase.numberFormatDecimalPoint, out float chapterNumberFloat) &&
|
||||||
float.TryParse(otherChapter.volumeNumber, GlobalBase.numberFormatDecimalPoint,
|
float.TryParse(otherChapter.volumeNumber, GlobalBase.numberFormatDecimalPoint,
|
||||||
@ -67,21 +68,15 @@ public readonly struct Chapter : IComparable
|
|||||||
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
|
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
|
||||||
out float otherChapterNumberFloat))
|
out float otherChapterNumberFloat))
|
||||||
{
|
{
|
||||||
|
return volumeNumberFloat.CompareTo(otherVolumeNumberFloat) switch
|
||||||
switch (volumeNumberFloat.CompareTo(otherVolumeNumberFloat))
|
|
||||||
{
|
{
|
||||||
case < 0:
|
<0 => -1,
|
||||||
return -1;
|
>0 => 1,
|
||||||
case > 0:
|
_ => chapterNumberFloat.CompareTo(otherChapterNumberFloat)
|
||||||
return 1;
|
};
|
||||||
default:
|
|
||||||
return chapterNumberFloat.CompareTo(otherChapterNumberFloat);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else throw new FormatException($"Value could not be parsed");
|
else throw new FormatException($"Value could not be parsed");
|
||||||
}
|
}
|
||||||
throw new ArgumentException($"{obj} can not be compared to {this}");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if a chapter-archive is already present
|
/// Checks if a chapter-archive is already present
|
||||||
|
@ -128,11 +128,20 @@ public struct Manga
|
|||||||
public void MovePublicationFolder(string downloadDirectory, string newFolderName)
|
public void MovePublicationFolder(string downloadDirectory, string newFolderName)
|
||||||
{
|
{
|
||||||
string oldPath = Path.Join(downloadDirectory, this.folderName);
|
string oldPath = Path.Join(downloadDirectory, this.folderName);
|
||||||
this.folderName = newFolderName;
|
this.folderName = newFolderName;//Create new Path with the new folderName
|
||||||
string newPath = CreatePublicationFolder(downloadDirectory);
|
string newPath = CreatePublicationFolder(downloadDirectory);
|
||||||
if(Directory.Exists(oldPath))
|
if (Directory.Exists(oldPath))
|
||||||
|
{
|
||||||
|
if (Directory.Exists(newPath)) //Move/Overwrite old Files, Delete old Directory
|
||||||
|
{
|
||||||
|
IEnumerable<string> newPathFileNames = new DirectoryInfo(newPath).GetFiles().Select(fi => fi.Name);
|
||||||
|
foreach(FileInfo fileInfo in new DirectoryInfo(oldPath).GetFiles().Where(fi => newPathFileNames.Contains(fi.Name) == false))
|
||||||
|
File.Move(fileInfo.FullName, Path.Join(newPath, fileInfo.Name), true);
|
||||||
|
Directory.Delete(oldPath);
|
||||||
|
}else
|
||||||
Directory.Move(oldPath, newPath);
|
Directory.Move(oldPath, newPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateLatestDownloadedChapter(Chapter chapter)//TODO check files if chapters are all downloaded
|
public void UpdateLatestDownloadedChapter(Chapter chapter)//TODO check files if chapters are all downloaded
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,6 @@ namespace Tranga.MangaConnectors;
|
|||||||
internal class ChromiumDownloadClient : DownloadClient
|
internal class ChromiumDownloadClient : DownloadClient
|
||||||
{
|
{
|
||||||
private IBrowser browser { get; set; }
|
private IBrowser browser { get; set; }
|
||||||
private const string ChromiumVersion = "1154303";
|
|
||||||
private const int StartTimeoutMs = 30000;
|
private const int StartTimeoutMs = 30000;
|
||||||
private readonly HttpDownloadClient _httpDownloadClient;
|
private readonly HttpDownloadClient _httpDownloadClient;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user