mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-01 18:04:35 -05:00
Compare commits
219 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
464b9659fe | ||
|
|
7a59d0d4dd | ||
|
|
7c3eff2ba7 | ||
|
|
300c0a8f35 | ||
|
|
51bfdc0947 | ||
|
|
a64566c0f3 | ||
|
|
dbb9a80ea6 | ||
|
|
e930c54246 | ||
|
|
dfff047cbf | ||
|
|
44fb2b02bc | ||
|
|
6a7efafd9f | ||
|
|
241abc3956 | ||
|
|
1e82c879bf | ||
|
|
a81d01d2e3 | ||
|
|
2230796504 | ||
|
|
458ca7c7cf | ||
|
|
3f91663ecf | ||
|
|
04a671382a | ||
|
|
945ec818e5 | ||
|
|
ff7ac8a785 | ||
|
|
603105e2ea | ||
|
|
5475567b48 | ||
|
|
2aec0adb08 | ||
|
|
54fc3761bf | ||
|
|
99e1912bfe | ||
|
|
ecc1cabafd | ||
|
|
1a5b847b23 | ||
|
|
d3409e7133 | ||
|
|
4e553e3eb3 | ||
|
|
4577bbc572 | ||
|
|
da8ca23496 | ||
|
|
988853be63 | ||
|
|
cde5dc5bfa | ||
|
|
b617250eff | ||
|
|
313da99536 | ||
|
|
442e245216 | ||
|
|
050ab17019 | ||
|
|
c80f488a13 | ||
|
|
cf73804c71 | ||
|
|
a90e5d13ea | ||
|
|
891fb0b479 | ||
|
|
58a623d44d | ||
|
|
0e84b8a154 | ||
|
|
a4dfcf80e4 | ||
|
|
d8567eadb2 | ||
|
|
0b88207ad5 | ||
|
|
671466a737 | ||
|
|
84881a0d52 | ||
|
|
a589049cc7 | ||
|
|
17877e0f17 | ||
|
|
1ed9bef2a1 | ||
|
|
a6dddf311c | ||
|
|
e8c2bad187 | ||
|
|
52bda2c080 | ||
|
|
607919f40f | ||
|
|
d830638ee6 | ||
|
|
106bda2097 | ||
|
|
7debb27374 | ||
|
|
05b5a7f598 | ||
|
|
3bbda7ba54 | ||
|
|
9312f5fd14 | ||
|
|
399eb07e35 | ||
|
|
eb197ebcee | ||
|
|
4c30d8ab05 | ||
|
|
3a67ddf0f6 | ||
|
|
6541c7b5b7 | ||
|
|
37f41ade43 | ||
|
|
007d20d417 | ||
|
|
00370a81fa | ||
|
|
d4599c3331 | ||
|
|
bce76bbcf3 | ||
|
|
847a5fe71b | ||
|
|
e2fa003239 | ||
|
|
0c555e88d3 | ||
|
|
bf7f1a04b3 | ||
|
|
623172af6d | ||
|
|
4fb689d9e4 | ||
|
|
6054c489c6 | ||
|
|
21719f4408 | ||
|
|
f2a650ba02 | ||
|
|
871c28b1ea | ||
|
|
d3aa32147a | ||
|
|
9a50f2e408 | ||
|
|
dcde4947e8 | ||
|
|
5b61bdc3a8 | ||
|
|
ec1d65f4c3 | ||
|
|
a0081dec07 | ||
|
|
783787e514 | ||
|
|
ac99dd55a2 | ||
|
|
c56f984952 | ||
|
|
9269ca726e | ||
|
|
eca3205dcf | ||
|
|
13f5486d0b | ||
|
|
d4e71274f9 | ||
|
|
4cc96de806 | ||
|
|
d27ef12039 | ||
|
|
f3c2ee4c40 | ||
|
|
555f73b478 | ||
|
|
544bf2ea21 | ||
|
|
54bbb5e384 | ||
|
|
b10062c73d | ||
|
|
a027d6df1b | ||
|
|
926a53a4b0 | ||
|
|
406cb46170 | ||
|
|
acc58dc892 | ||
|
|
55894c22a4 | ||
|
|
476b10b862 | ||
|
|
3cbbe446ab | ||
|
|
4cf7512ee0 | ||
|
|
ee8ec460a1 | ||
|
|
deecab3cca | ||
|
|
d2f5c1a195 | ||
|
|
dba77e26a3 | ||
|
|
fa48bafbc6 | ||
|
|
73c48694c7 | ||
|
|
0ff89d039b | ||
|
|
7a7081ee13 | ||
|
|
874aaf4e93 | ||
|
|
ebf076d9f6 | ||
|
|
073a041d4c | ||
|
|
96a9b4dabd | ||
|
|
8e4cdf2386 | ||
|
|
ab4d925a5a | ||
|
|
d9c6f52e21 | ||
|
|
0a748cd53b | ||
|
|
07314ef018 | ||
|
|
5eaebf678f | ||
|
|
80fbfa60de | ||
|
|
fbbcc9e9b6 | ||
|
|
f47dc6b9de | ||
|
|
5f8e74f017 | ||
|
|
8c1ca0ac7e | ||
|
|
9018de3c4c | ||
|
|
e7cb88c757 | ||
|
|
d6127d6811 | ||
|
|
67e09e2e1d | ||
|
|
8fbc24c751 | ||
|
|
c0948209be | ||
|
|
7237161d52 | ||
|
|
94c2e21e2b | ||
|
|
65067e6e01 | ||
|
|
39490ce7ba | ||
|
|
2f3f47c745 | ||
|
|
2195c3df76 | ||
|
|
119b9db6b4 | ||
|
|
fcbc598732 | ||
|
|
e850049e8e | ||
|
|
907adea73f | ||
|
|
2ac5c1362c | ||
|
|
8b20e2b48f | ||
|
|
c2a9820fc1 | ||
|
|
a9e5bc0c95 | ||
|
|
0fa2834d25 | ||
|
|
23f0876c00 | ||
|
|
6d88d90659 | ||
|
|
a3c366c360 | ||
|
|
3bef07eeab | ||
|
|
d029e65b8e | ||
|
|
f305ac6905 | ||
|
|
4d4a46d2a5 | ||
|
|
8218f2f830 | ||
|
|
b1bf901eac | ||
|
|
06eff55210 | ||
|
|
71730fddad | ||
|
|
f2d1c6e3cb | ||
|
|
7ae837ca3c | ||
|
|
b10908df5e | ||
|
|
4dd4d38d5b | ||
|
|
447c286b56 | ||
|
|
c71898ece9 | ||
|
|
9473e88ea9 | ||
|
|
d7663ed56e | ||
|
|
da7569e2f5 | ||
|
|
d989940a4d | ||
|
|
bd6a86b135 | ||
|
|
b38eb11503 | ||
|
|
7aef32c13d | ||
|
|
fab64b147c | ||
|
|
cc5a63205c | ||
|
|
814166a884 | ||
|
|
55240d9e9b | ||
|
|
9dc598150f | ||
|
|
21c087e273 | ||
|
|
bdf3a7014f | ||
|
|
dfea6e9b1b | ||
|
|
50eef1190e | ||
|
|
ed180121ff | ||
|
|
bdb0ad89d4 | ||
|
|
7195a30d55 | ||
|
|
5b0426a94c | ||
|
|
a6d012abd9 | ||
|
|
86f0b3f29f | ||
|
|
85e3aa34ac | ||
|
|
5bbc1dedef | ||
|
|
39b468ef06 | ||
|
|
fe17176b31 | ||
|
|
84f701c4ab | ||
|
|
047f8c176f | ||
|
|
d82e79b680 | ||
|
|
320d1ae9d8 | ||
|
|
a8892143a2 | ||
|
|
50f4532406 | ||
|
|
844454053d | ||
|
|
db5c5ed534 | ||
|
|
a26b8ecca0 | ||
|
|
5a32ccfa7a | ||
|
|
f51818b157 | ||
|
|
31a624db51 | ||
|
|
f045b18762 | ||
|
|
f5006cac7d | ||
|
|
152b193ad5 | ||
|
|
a27af0b642 | ||
|
|
44ffed3f7c | ||
|
|
fa035ad9be | ||
|
|
186ace4343 | ||
|
|
8fb1a0bb1f | ||
|
|
05513bf8b9 | ||
|
|
858784857e | ||
|
|
291a23949a |
12
.github/workflows/build_pull_request.yml
vendored
12
.github/workflows/build_pull_request.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
uses: styfle/cancel-workflow-action@0.10.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
@@ -45,13 +45,9 @@ jobs:
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
|
||||
- name: Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
|
||||
|
||||
164
.github/workflows/build_push.yml
vendored
164
.github/workflows/build_push.yml
vendored
@@ -9,28 +9,26 @@ jobs:
|
||||
check_wrapper:
|
||||
name: Validate Gradle Wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
build:
|
||||
name: Build artifacts and deploy preview
|
||||
name: Build Jar
|
||||
needs: check_wrapper
|
||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
uses: styfle/cancel-workflow-action@0.10.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout master branch
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
@@ -48,43 +46,136 @@ jobs:
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
- name: Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
env:
|
||||
ProductBuildType: "Preview"
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
|
||||
- name: Upload Jar
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: master/server/build/*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload icons
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: master/server/src/main/resources/icon
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Tar scripts dir to maintain file permissions
|
||||
run: tar -cvzf scripts.tar.gz -C master/ scripts/
|
||||
- name: Upload scripts.tar.gz
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
path: scripts.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
bundle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- debian-all
|
||||
- linux-assets
|
||||
- linux-x64
|
||||
- macOS-x64
|
||||
- macOS-arm64
|
||||
- windows-x64
|
||||
- windows-x86
|
||||
|
||||
name: Make ${{ matrix.os }} release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Jar
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: server/build
|
||||
|
||||
- name: Download icons
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: server/src/main/resources/icon
|
||||
|
||||
- name: Download scripts.tar.gz
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
|
||||
- name: Make ${{ matrix.os }} release
|
||||
run: |
|
||||
mkdir upload
|
||||
tar -xvpf scripts.tar.gz
|
||||
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||
|
||||
- name: Upload ${{ matrix.os }} release
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: upload/*
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
needs: bundle
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: debian-all
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-assets
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-arm64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x86
|
||||
path: release
|
||||
|
||||
- name: Checkout Preview branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "Suwayomi/Tachidesk-Server-preview"
|
||||
ref: main
|
||||
path: preview
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
|
||||
- name: Generate Tag Name
|
||||
id: GenTagName
|
||||
run: |
|
||||
cd master/server/build
|
||||
cd release
|
||||
genTag=$(ls *.jar | sed -e's/Tachidesk-Server-\|.jar//g')
|
||||
echo "$genTag"
|
||||
echo "::set-output name=value::$genTag"
|
||||
|
||||
- name: make bundle packages
|
||||
run: |
|
||||
cd master/scripts
|
||||
./windows-bundler.sh win32
|
||||
./windows-bundler.sh win64
|
||||
./unix-bundler.sh linux-x64
|
||||
./debian-packager.sh
|
||||
./unix-bundler.sh macOS-x64
|
||||
./unix-bundler.sh macOS-arm64
|
||||
|
||||
- name: Checkout preview branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'Suwayomi/Tachidesk-Server-preview'
|
||||
ref: main
|
||||
path: preview
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
|
||||
- name: Create Tag
|
||||
run: |
|
||||
TAG="${{ steps.GenTagName.outputs.value }}"
|
||||
@@ -92,7 +183,8 @@ jobs:
|
||||
cd preview
|
||||
echo "{ \"latest\": \"$TAG\" }" > index.json
|
||||
git add index.json
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.email \
|
||||
"github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git commit -m "Updated to $TAG"
|
||||
git push origin main
|
||||
@@ -101,10 +193,10 @@ jobs:
|
||||
git push origin $TAG
|
||||
|
||||
- name: Upload Preview Release
|
||||
uses: ncipollo/release-action@v1
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
artifacts: "master/server/build/*.jar,master/server/build/*.msi,master/server/build/*.zip,master/server/build/*.tar.gz,master/server/build/*.deb"
|
||||
owner: "Suwayomi"
|
||||
repo: "Tachidesk-Server-preview"
|
||||
tag: ${{ steps.GenTagName.outputs.value }}
|
||||
repository: "Suwayomi/Tachidesk-Server-preview"
|
||||
tag_name: ${{ steps.GenTagName.outputs.value }}
|
||||
files: release/*
|
||||
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
name: Issue closer
|
||||
name: Issue moderator
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited, reopened]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
autoclose:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Autoclose issues
|
||||
uses: arkon/issue-closer-action@v3.0
|
||||
- name: Moderate issues
|
||||
uses: tachiyomiorg/issue-moderator-action@v1
|
||||
with:
|
||||
repo-token: ${{ github.token }}
|
||||
rules: |
|
||||
duplicate-check-enabled: true
|
||||
duplicate-check-label: Source request
|
||||
existing-check-enabled: true
|
||||
existing-check-label: Source request
|
||||
auto-close-rules: |
|
||||
[
|
||||
{
|
||||
"type": "title",
|
||||
"regex": ".*<short description>*",
|
||||
"regex": ".*<short description>.*",
|
||||
"message": "You did not fill out the description in the title"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"regex": ".*(<|>)+.*",
|
||||
"message": "You did not remove Angle brackets(< and >) from the title"
|
||||
},
|
||||
{
|
||||
"type": "body",
|
||||
"regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*",
|
||||
@@ -26,7 +37,7 @@ jobs:
|
||||
},
|
||||
{
|
||||
"type": "body",
|
||||
"regex": "(Tachidesk version|Server Operating System|Server Desktop Environment|Server JVM version|Client Operating System|Client Web Browser):.*(\\(Example:|<usually).*",
|
||||
"regex": ".*(Tachidesk version|Server Operating System|Server Desktop Environment|Server JVM version|Client Operating System|Client Web Browser):.*(\\(Example:|<usually).*",
|
||||
"message": "The requested information was not filled out"
|
||||
},
|
||||
{
|
||||
152
.github/workflows/publish.yml
vendored
152
.github/workflows/publish.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: CI Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
@@ -9,27 +10,25 @@ jobs:
|
||||
check_wrapper:
|
||||
name: Validate Gradle Wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
build:
|
||||
name: Build artifacts and release
|
||||
name: Build Jar
|
||||
needs: check_wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
uses: styfle/cancel-workflow-action@0.10.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout ${{ github.ref }}
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
path: master
|
||||
@@ -44,36 +43,131 @@ jobs:
|
||||
run: |
|
||||
cd master
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
cp .github/runner-files/ci-gradle.properties \
|
||||
~/.gradle/gradle.properties
|
||||
|
||||
- name: Build and copy webUI, Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
env:
|
||||
ProductBuildType: "Stable"
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:downloadWebUI :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
|
||||
- name: Make bundle packages
|
||||
run: |
|
||||
cd master/scripts
|
||||
./windows-bundler.sh win32
|
||||
./windows-bundler.sh win64
|
||||
./unix-bundler.sh linux-x64
|
||||
./debian-packager.sh
|
||||
./unix-bundler.sh macOS-x64
|
||||
./unix-bundler.sh macOS-arm64
|
||||
|
||||
- name: Upload Release
|
||||
uses: xresloader/upload-to-github-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload Jar
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
file: "master/server/build/*.jar;master/server/build/*.msi;master/server/build/*.zip;master/server/build/*.tar.gz;master/server/build/*.deb"
|
||||
tags: true
|
||||
name: jar
|
||||
path: master/server/build/*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload icons
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: master/server/src/main/resources/icon
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Tar scripts dir to maintain file permissions
|
||||
run: tar -cvzf scripts.tar.gz -C master/ scripts/
|
||||
- name: Upload scripts.tar.gz
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
path: scripts.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
bundle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- debian-all
|
||||
- linux-assets
|
||||
- linux-x64
|
||||
- macOS-x64
|
||||
- macOS-arm64
|
||||
- windows-x64
|
||||
- windows-x86
|
||||
|
||||
name: Make ${{ matrix.os }} release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Jar
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: server/build
|
||||
|
||||
- name: Download icons
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: server/src/main/resources/icon
|
||||
|
||||
- name: Download scripts.tar.gz
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
|
||||
- name: Make ${{ matrix.os }} release
|
||||
run: |
|
||||
mkdir upload/
|
||||
tar -xvpf scripts.tar.gz
|
||||
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||
|
||||
- name: Upload ${{ matrix.os }} files
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: upload/*
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
needs: bundle
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: debian-all
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-assets
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-arm64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x86
|
||||
path: release
|
||||
|
||||
- name: Generate checksums
|
||||
run: cd release && sha256sum * > Checksums.sha256
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|
||||
draft: true
|
||||
verbose: true
|
||||
files: release/*
|
||||
|
||||
15
.github/workflows/winget.yml
vendored
Normal file
15
.github/workflows/winget.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI Publish"]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest # action can only be run on windows
|
||||
steps:
|
||||
- uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: Suwayomi.Tachidesk-Server
|
||||
installers-regex: '.*x64.msi$'
|
||||
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,7 +2,7 @@
|
||||
.gradle
|
||||
.idea
|
||||
gradle.properties
|
||||
|
||||
.fleet
|
||||
# But we need these
|
||||
!.idea/runConfigurations
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.kotlinter.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
}
|
||||
@@ -11,6 +11,9 @@ import ch.qos.logback.classic.Level
|
||||
import com.typesafe.config.Config
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import com.typesafe.config.ConfigRenderOptions
|
||||
import com.typesafe.config.ConfigValue
|
||||
import com.typesafe.config.ConfigValueFactory
|
||||
import com.typesafe.config.parser.ConfigDocumentFactory
|
||||
import mu.KotlinLogging
|
||||
import java.io.File
|
||||
|
||||
@@ -18,15 +21,17 @@ import java.io.File
|
||||
* Manages app config.
|
||||
*/
|
||||
open class ConfigManager {
|
||||
val logger = KotlinLogging.logger {}
|
||||
private val generatedModules = mutableMapOf<Class<out ConfigModule>, ConfigModule>()
|
||||
val config by lazy { loadConfigs() }
|
||||
private val userConfigFile = File(ApplicationRootDir, "server.conf")
|
||||
private var internalConfig = loadConfigs()
|
||||
val config: Config
|
||||
get() = internalConfig
|
||||
|
||||
// Public read-only view of modules
|
||||
val loadedModules: Map<Class<out ConfigModule>, ConfigModule>
|
||||
get() = generatedModules
|
||||
|
||||
val logger = KotlinLogging.logger {}
|
||||
|
||||
/**
|
||||
* Get a config module
|
||||
*/
|
||||
@@ -54,7 +59,7 @@ open class ConfigManager {
|
||||
|
||||
// Load user config
|
||||
val userConfig =
|
||||
File(ApplicationRootDir, "server.conf").let {
|
||||
userConfigFile.let {
|
||||
ConfigFactory.parseFile(it)
|
||||
}
|
||||
|
||||
@@ -86,6 +91,20 @@ open class ConfigManager {
|
||||
registerModule(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateUserConfigFile(path: String, value: ConfigValue) {
|
||||
val userConfigDoc = ConfigDocumentFactory.parseFile(userConfigFile)
|
||||
val updatedConfigDoc = userConfigDoc.withValue(path, value)
|
||||
val newFileContent = updatedConfigDoc.render()
|
||||
userConfigFile.writeText(newFileContent)
|
||||
}
|
||||
|
||||
fun updateValue(path: String, value: Any) {
|
||||
val configValue = ConfigValueFactory.fromAnyRef(value)
|
||||
|
||||
updateUserConfigFile(path, configValue)
|
||||
internalConfig = internalConfig.withValue(path, configValue)
|
||||
}
|
||||
}
|
||||
|
||||
object GlobalConfigManager : ConfigManager()
|
||||
|
||||
@@ -15,19 +15,23 @@ import kotlin.reflect.KProperty
|
||||
* Abstract config module.
|
||||
*/
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
abstract class ConfigModule(config: Config)
|
||||
abstract class ConfigModule(getConfig: () -> Config)
|
||||
|
||||
/**
|
||||
* Abstract jvm-commandline-argument-overridable config module.
|
||||
*/
|
||||
abstract class SystemPropertyOverridableConfigModule(config: Config, moduleName: String) : ConfigModule(config) {
|
||||
val overridableConfig = SystemPropertyOverrideDelegate(config, moduleName)
|
||||
abstract class SystemPropertyOverridableConfigModule(getConfig: () -> Config, moduleName: String) : ConfigModule(getConfig) {
|
||||
val overridableConfig = SystemPropertyOverrideDelegate(getConfig, moduleName)
|
||||
}
|
||||
|
||||
/** Defines a config property that is overridable with jvm `-D` commandline arguments prefixed with [CONFIG_PREFIX] */
|
||||
class SystemPropertyOverrideDelegate(val config: Config, val moduleName: String) {
|
||||
class SystemPropertyOverrideDelegate(val getConfig: () -> Config, val moduleName: String) {
|
||||
operator fun <R> setValue(thisRef: R, property: KProperty<*>, value: Any) {
|
||||
GlobalConfigManager.updateValue("$moduleName.${property.name}", value)
|
||||
}
|
||||
|
||||
inline operator fun <R, reified T> getValue(thisRef: R, property: KProperty<*>): T {
|
||||
val configValue: T = config.getValue(thisRef, property)
|
||||
val configValue: T = getConfig().getValue(thisRef, property)
|
||||
|
||||
val combined = System.getProperty(
|
||||
"$CONFIG_PREFIX.$moduleName.${property.name}",
|
||||
|
||||
@@ -1,28 +1,39 @@
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.kotlinter.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
|
||||
// Android stub library
|
||||
implementation("com.github.Suwayomi:android-jar:1.0.0")
|
||||
implementation(libs.android.stubs)
|
||||
|
||||
// XML
|
||||
compileOnly("xmlpull:xmlpull:1.1.3.4a")
|
||||
compileOnly(libs.xmlpull)
|
||||
|
||||
// Config API
|
||||
implementation(project(":AndroidCompat:Config"))
|
||||
implementation(projects.androidCompat.config)
|
||||
|
||||
// APK sig verifier
|
||||
compileOnly("com.android.tools.build:apksig:7.1.0-beta05")
|
||||
compileOnly(libs.apksig)
|
||||
|
||||
// AndroidX annotations
|
||||
compileOnly("androidx.annotation:annotation:1.3.0")
|
||||
compileOnly(libs.android.annotations)
|
||||
|
||||
// substitute for duktape-android
|
||||
implementation("org.mozilla:rhino-runtime:1.7.14") // slimmer version of 'org.mozilla:rhino'
|
||||
implementation("org.mozilla:rhino-engine:1.7.14") // provides the same interface as 'javax.script' a.k.a Nashorn
|
||||
implementation(libs.bundles.rhino)
|
||||
|
||||
// Kotlin wrapper around Java Preferences, makes certain things easier
|
||||
val multiplatformSettingsVersion = "0.8.1"
|
||||
implementation("com.russhwolf:multiplatform-settings-jvm:$multiplatformSettingsVersion")
|
||||
implementation("com.russhwolf:multiplatform-settings-serialization-jvm:$multiplatformSettingsVersion")
|
||||
implementation(libs.bundles.settings)
|
||||
|
||||
// Android version of SimpleDateFormat
|
||||
implementation("com.ibm.icu:icu4j:70.1")
|
||||
implementation(libs.icu4j)
|
||||
|
||||
// OpenJDK lacks native JPEG encoder and native WEBP decoder
|
||||
implementation(libs.bundles.twelvemonkeys)
|
||||
}
|
||||
|
||||
129
AndroidCompat/src/main/java/android/graphics/Bitmap.java
Normal file
129
AndroidCompat/src/main/java/android/graphics/Bitmap.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package android.graphics;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Iterator;
|
||||
import javax.imageio.IIOImage;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageWriteParam;
|
||||
import javax.imageio.ImageWriter;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
|
||||
public final class Bitmap {
|
||||
private int width;
|
||||
private int height;
|
||||
private BufferedImage image;
|
||||
|
||||
public Bitmap(BufferedImage image) {
|
||||
this.image = image;
|
||||
this.width = image.getWidth();
|
||||
this.height = image.getHeight();
|
||||
}
|
||||
|
||||
public BufferedImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public enum CompressFormat {
|
||||
JPEG (0),
|
||||
PNG (1),
|
||||
WEBP (2),
|
||||
WEBP_LOSSY (3),
|
||||
WEBP_LOSSLESS (4);
|
||||
|
||||
CompressFormat(int nativeInt) {
|
||||
this.nativeInt = nativeInt;
|
||||
}
|
||||
|
||||
final int nativeInt;
|
||||
}
|
||||
|
||||
public enum Config {
|
||||
ALPHA_8(1),
|
||||
RGB_565(3),
|
||||
ARGB_4444(4),
|
||||
ARGB_8888(5),
|
||||
RGBA_F16(6),
|
||||
HARDWARE(7),
|
||||
RGBA_1010102(8);
|
||||
|
||||
final int nativeInt;
|
||||
|
||||
private static Config sConfigs[] = {
|
||||
null, ALPHA_8, null, RGB_565, ARGB_4444, ARGB_8888, RGBA_F16, HARDWARE, RGBA_1010102
|
||||
};
|
||||
|
||||
Config(int ni) {
|
||||
this.nativeInt = ni;
|
||||
}
|
||||
|
||||
static Config nativeToConfig(int ni) {
|
||||
return sConfigs[ni];
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap createBitmap(int width, int height, Config config) {
|
||||
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
return new Bitmap(image);
|
||||
}
|
||||
|
||||
public boolean compress(CompressFormat format, int quality, OutputStream stream) {
|
||||
if (stream == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (quality < 0 || quality > 100) {
|
||||
throw new IllegalArgumentException("quality must be 0..100");
|
||||
}
|
||||
float qualityFloat = ((float) quality) / 100;
|
||||
|
||||
String formatString = "";
|
||||
if (format == Bitmap.CompressFormat.PNG) {
|
||||
formatString = "png";
|
||||
} else if (format == Bitmap.CompressFormat.JPEG) {
|
||||
formatString = "jpg";
|
||||
} else {
|
||||
throw new IllegalArgumentException("unsupported compression format!");
|
||||
}
|
||||
|
||||
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(formatString);
|
||||
if (!writers.hasNext()) {
|
||||
throw new IllegalStateException("no image writers found for this format!");
|
||||
}
|
||||
ImageWriter writer = (ImageWriter) writers.next();
|
||||
|
||||
ImageOutputStream ios;
|
||||
try {
|
||||
ios = ImageIO.createImageOutputStream(stream);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
writer.setOutput(ios);
|
||||
|
||||
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||
if (formatString == "jpg") {
|
||||
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||
param.setCompressionQuality(qualityFloat);
|
||||
}
|
||||
|
||||
try {
|
||||
writer.write(null, new IIOImage(image, null, null), param);
|
||||
ios.close();
|
||||
writer.dispose();
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package android.graphics;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
|
||||
public class BitmapFactory {
|
||||
public static Bitmap decodeStream(InputStream inputStream) {
|
||||
Bitmap bitmap = null;
|
||||
|
||||
try {
|
||||
ImageInputStream imageInputStream = ImageIO.createImageInputStream(inputStream);
|
||||
Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(imageInputStream);
|
||||
|
||||
if (!imageReaders.hasNext()) {
|
||||
throw new IllegalArgumentException("no reader for image");
|
||||
}
|
||||
|
||||
ImageReader imageReader = imageReaders.next();
|
||||
imageReader.setInput(imageInputStream);
|
||||
|
||||
BufferedImage image = imageReader.read(0, imageReader.getDefaultReadParam());
|
||||
bitmap = new Bitmap(image);
|
||||
|
||||
imageReader.dispose();
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static Bitmap decodeByteArray(byte[] data, int offset, int length) {
|
||||
Bitmap bitmap = null;
|
||||
|
||||
ByteArrayInputStream byteArrayStream = new ByteArrayInputStream(data);
|
||||
try {
|
||||
BufferedImage image = ImageIO.read(byteArrayStream);
|
||||
bitmap = new Bitmap(image);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
21
AndroidCompat/src/main/java/android/graphics/Canvas.java
Normal file
21
AndroidCompat/src/main/java/android/graphics/Canvas.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package android.graphics;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public final class Canvas {
|
||||
private BufferedImage canvasImage;
|
||||
private Graphics2D canvas;
|
||||
|
||||
public Canvas(Bitmap bitmap) {
|
||||
canvasImage = bitmap.getImage();
|
||||
canvas = canvasImage.createGraphics();
|
||||
}
|
||||
|
||||
public void drawBitmap(Bitmap sourceBitmap, Rect src, Rect dst, Paint paint) {
|
||||
BufferedImage sourceImage = sourceBitmap.getImage();
|
||||
BufferedImage sourceImageCropped = sourceImage.getSubimage(src.left, src.top, src.getWidth(), src.getHeight());
|
||||
canvas.drawImage(sourceImageCropped, null, dst.left, dst.top);
|
||||
}
|
||||
}
|
||||
122
AndroidCompat/src/main/java/android/graphics/Rect.java
Normal file
122
AndroidCompat/src/main/java/android/graphics/Rect.java
Normal file
@@ -0,0 +1,122 @@
|
||||
package android.graphics;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class Rect {
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
|
||||
private static final class UnflattenHelper {
|
||||
private static final Pattern FLATTENED_PATTERN = Pattern.compile(
|
||||
"(-?\\d+) (-?\\d+) (-?\\d+) (-?\\d+)");
|
||||
|
||||
static Matcher getMatcher(String str) {
|
||||
return FLATTENED_PATTERN.matcher(str);
|
||||
}
|
||||
}
|
||||
|
||||
public Rect() {
|
||||
}
|
||||
|
||||
public Rect(int left, int top, int right, int bottom) {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.right = right;
|
||||
this.bottom = bottom;
|
||||
}
|
||||
|
||||
public Rect(Rect r) {
|
||||
if (r == null) {
|
||||
this.left = 0;
|
||||
this.top = 0;
|
||||
this.right = 0;
|
||||
this.bottom = 0;
|
||||
} else {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.right = right;
|
||||
this.bottom = bottom;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getWidth() {
|
||||
return right - left;
|
||||
}
|
||||
|
||||
public final int getHeight() {
|
||||
return bottom - top;
|
||||
}
|
||||
|
||||
public static Rect unflattenFromString(String str) {
|
||||
if (str.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Matcher matcher = UnflattenHelper.getMatcher(str);
|
||||
if (!matcher.matches()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Rect(Integer.parseInt(matcher.group(1)),
|
||||
Integer.parseInt(matcher.group(2)),
|
||||
Integer.parseInt(matcher.group(3)),
|
||||
Integer.parseInt(matcher.group(4)));
|
||||
}
|
||||
|
||||
public String toShortString() {
|
||||
return toShortString(new StringBuilder(32));
|
||||
}
|
||||
|
||||
public String toShortString(StringBuilder sb) {
|
||||
sb.setLength(0);
|
||||
sb.append('['); sb.append(left); sb.append(',');
|
||||
sb.append(top); sb.append("]["); sb.append(right);
|
||||
sb.append(','); sb.append(bottom); sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String flattenToString() {
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(left);
|
||||
sb.append(' ');
|
||||
sb.append(top);
|
||||
sb.append(' ');
|
||||
sb.append(right);
|
||||
sb.append(' ');
|
||||
sb.append(bottom);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(left);
|
||||
out.writeInt(top);
|
||||
out.writeInt(right);
|
||||
out.writeInt(bottom);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<Rect> CREATOR = new Parcelable.Creator<Rect>() {
|
||||
@Override
|
||||
public Rect createFromParcel(Parcel in) {
|
||||
Rect r = new Rect();
|
||||
r.readFromParcel(in);
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rect[] newArray(int size) {
|
||||
return new Rect[size];
|
||||
}
|
||||
};
|
||||
|
||||
public void readFromParcel(Parcel in) {
|
||||
left = in.readInt();
|
||||
top = in.readInt();
|
||||
right = in.readInt();
|
||||
bottom = in.readInt();
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package android.text;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.safety.Whitelist;
|
||||
import org.jsoup.safety.Safelist;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ import org.xml.sax.XMLReader;
|
||||
public class Html {
|
||||
|
||||
public static Spanned fromHtml(String source) {
|
||||
return new FakeSpanned(Jsoup.clean(source, Whitelist.none()));
|
||||
return new FakeSpanned(Jsoup.clean(source, Safelist.none()));
|
||||
}
|
||||
|
||||
public static Spanned fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler) {
|
||||
|
||||
69
AndroidCompat/src/main/java/app/cash/quickjs/QuickJs.java
Normal file
69
AndroidCompat/src/main/java/app/cash/quickjs/QuickJs.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package app.cash.quickjs;
|
||||
|
||||
import org.mozilla.javascript.ConsString;
|
||||
import org.mozilla.javascript.NativeArray;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import java.io.Closeable;
|
||||
|
||||
public final class QuickJs implements Closeable {
|
||||
private ScriptEngine engine;
|
||||
|
||||
public static QuickJs create() {
|
||||
return new QuickJs(new ScriptEngineManager());
|
||||
}
|
||||
|
||||
public QuickJs(ScriptEngineManager manager) {
|
||||
this.engine = manager.getEngineByName("rhino");
|
||||
}
|
||||
|
||||
public Object evaluate(String script, String fileName) {
|
||||
return this.evaluate(script);
|
||||
}
|
||||
|
||||
public Object evaluate(String script) {
|
||||
try {
|
||||
Object value = engine.eval(script);
|
||||
return translateType(value);
|
||||
} catch (Exception exception) {
|
||||
throw new QuickJsException(exception.getMessage(), exception);
|
||||
}
|
||||
}
|
||||
|
||||
private Object translateType(Object obj) {
|
||||
if (obj instanceof NativeArray) {
|
||||
NativeArray array = (NativeArray) obj;
|
||||
long length = array.getLength();
|
||||
Object[] objects = new Object[(int) length];
|
||||
for (int i = 0; i < (int) length; i++) {
|
||||
objects[i] = translateType(array.get(i));
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
if (obj instanceof ConsString) {
|
||||
ConsString consString = (ConsString) obj;
|
||||
return consString.toString();
|
||||
}
|
||||
if (obj instanceof Long) {
|
||||
Long value = (Long) obj;
|
||||
return value.intValue();
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public byte[] compile(String sourceCode, String fileName) {
|
||||
return sourceCode.getBytes();
|
||||
}
|
||||
|
||||
|
||||
public Object execute(byte[] bytecode) {
|
||||
return this.evaluate(new String(bytecode));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
this.engine = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.cash.quickjs;
|
||||
|
||||
public final class QuickJsException extends RuntimeException {
|
||||
public QuickJsException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -8,12 +8,12 @@ import xyz.nulldev.ts.config.ConfigModule
|
||||
* Application info config.
|
||||
*/
|
||||
|
||||
class ApplicationInfoConfigModule(config: Config) : ConfigModule(config) {
|
||||
val packageName: String by config
|
||||
val debug: Boolean by config
|
||||
class ApplicationInfoConfigModule(getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val packageName: String by getConfig()
|
||||
val debug: Boolean by getConfig()
|
||||
|
||||
companion object {
|
||||
fun register(config: Config) =
|
||||
ApplicationInfoConfigModule(config.getConfig("android.app"))
|
||||
ApplicationInfoConfigModule { config.getConfig("android.app") }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,27 +8,27 @@ import xyz.nulldev.ts.config.ConfigModule
|
||||
* Files configuration modules. Specifies where to store the Android files.
|
||||
*/
|
||||
|
||||
class FilesConfigModule(config: Config) : ConfigModule(config) {
|
||||
val dataDir: String by config
|
||||
val filesDir: String by config
|
||||
val noBackupFilesDir: String by config
|
||||
val externalFilesDirs: MutableList<String> by config
|
||||
val obbDirs: MutableList<String> by config
|
||||
val cacheDir: String by config
|
||||
val codeCacheDir: String by config
|
||||
val externalCacheDirs: MutableList<String> by config
|
||||
val externalMediaDirs: MutableList<String> by config
|
||||
val rootDir: String by config
|
||||
val externalStorageDir: String by config
|
||||
val downloadCacheDir: String by config
|
||||
val databasesDir: String by config
|
||||
class FilesConfigModule(getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val dataDir: String by getConfig()
|
||||
val filesDir: String by getConfig()
|
||||
val noBackupFilesDir: String by getConfig()
|
||||
val externalFilesDirs: MutableList<String> by getConfig()
|
||||
val obbDirs: MutableList<String> by getConfig()
|
||||
val cacheDir: String by getConfig()
|
||||
val codeCacheDir: String by getConfig()
|
||||
val externalCacheDirs: MutableList<String> by getConfig()
|
||||
val externalMediaDirs: MutableList<String> by getConfig()
|
||||
val rootDir: String by getConfig()
|
||||
val externalStorageDir: String by getConfig()
|
||||
val downloadCacheDir: String by getConfig()
|
||||
val databasesDir: String by getConfig()
|
||||
|
||||
val prefsDir: String by config
|
||||
val prefsDir: String by getConfig()
|
||||
|
||||
val packageDir: String by config
|
||||
val packageDir: String by getConfig()
|
||||
|
||||
companion object {
|
||||
fun register(config: Config) =
|
||||
FilesConfigModule(config.getConfig("android.files"))
|
||||
FilesConfigModule { config.getConfig("android.files") }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,19 @@ import com.typesafe.config.Config
|
||||
import io.github.config4k.getValue
|
||||
import xyz.nulldev.ts.config.ConfigModule
|
||||
|
||||
class SystemConfigModule(val config: Config) : ConfigModule(config) {
|
||||
val isDebuggable: Boolean by config
|
||||
class SystemConfigModule(val getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val isDebuggable: Boolean by getConfig()
|
||||
|
||||
val propertyPrefix = "properties."
|
||||
|
||||
fun getStringProperty(property: String) = config.getString("$propertyPrefix$property")!!
|
||||
fun getIntProperty(property: String) = config.getInt("$propertyPrefix$property")
|
||||
fun getLongProperty(property: String) = config.getLong("$propertyPrefix$property")
|
||||
fun getBooleanProperty(property: String) = config.getBoolean("$propertyPrefix$property")
|
||||
fun hasProperty(property: String) = config.hasPath("$propertyPrefix$property")
|
||||
fun getStringProperty(property: String) = getConfig().getString("$propertyPrefix$property")!!
|
||||
fun getIntProperty(property: String) = getConfig().getInt("$propertyPrefix$property")
|
||||
fun getLongProperty(property: String) = getConfig().getLong("$propertyPrefix$property")
|
||||
fun getBooleanProperty(property: String) = getConfig().getBoolean("$propertyPrefix$property")
|
||||
fun hasProperty(property: String) = getConfig().hasPath("$propertyPrefix$property")
|
||||
|
||||
companion object {
|
||||
fun register(config: Config) =
|
||||
SystemConfigModule(config.getConfig("android.system"))
|
||||
SystemConfigModule { config.getConfig("android.system") }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +60,13 @@ class ScrollableResultSet(val parent: ResultSet) : ResultSet by parent {
|
||||
}
|
||||
|
||||
private fun internalMove(row: Int) {
|
||||
if (cursor < 0) cursor = 0
|
||||
else if (cursor > resultSetLength + 1) cursor = resultSetLength + 1
|
||||
else cursor = row
|
||||
if (cursor < 0) {
|
||||
cursor = 0
|
||||
} else if (cursor > resultSetLength + 1) {
|
||||
cursor = resultSetLength + 1
|
||||
} else {
|
||||
cursor = row
|
||||
}
|
||||
}
|
||||
|
||||
private fun obj(column: Int): Any? {
|
||||
@@ -293,10 +297,11 @@ class ScrollableResultSet(val parent: ResultSet) : ResultSet by parent {
|
||||
}
|
||||
|
||||
override fun <T : Any?> unwrap(iface: Class<T>?): T {
|
||||
if (thisIsWrapperFor(iface))
|
||||
if (thisIsWrapperFor(iface)) {
|
||||
return this as T
|
||||
else
|
||||
} else {
|
||||
return parent.unwrap(iface)
|
||||
}
|
||||
}
|
||||
|
||||
override fun next(): Boolean {
|
||||
@@ -531,10 +536,15 @@ class ScrollableResultSet(val parent: ResultSet) : ResultSet by parent {
|
||||
}
|
||||
|
||||
private fun castToLong(obj: Any?): Long {
|
||||
if (obj == null) return 0
|
||||
else if (obj is Long) return obj
|
||||
else if (obj is Number) return obj.toLong()
|
||||
else throw IllegalStateException("Object is not a long!")
|
||||
if (obj == null) {
|
||||
return 0
|
||||
} else if (obj is Long) {
|
||||
return obj
|
||||
} else if (obj is Number) {
|
||||
return obj.toLong()
|
||||
} else {
|
||||
throw IllegalStateException("Object is not a long!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLong(columnIndex: Int): Long {
|
||||
|
||||
@@ -9,8 +9,7 @@ package xyz.nulldev.androidcompat.io.sharedprefs
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import com.russhwolf.settings.ExperimentalSettingsApi
|
||||
import com.russhwolf.settings.ExperimentalSettingsImplementation
|
||||
import com.russhwolf.settings.JvmPreferencesSettings
|
||||
import com.russhwolf.settings.PreferencesSettings
|
||||
import com.russhwolf.settings.serialization.decodeValue
|
||||
import com.russhwolf.settings.serialization.decodeValueOrNull
|
||||
import com.russhwolf.settings.serialization.encodeValue
|
||||
@@ -21,10 +20,10 @@ import kotlinx.serialization.builtins.serializer
|
||||
import java.util.prefs.PreferenceChangeListener
|
||||
import java.util.prefs.Preferences
|
||||
|
||||
@OptIn(ExperimentalSettingsImplementation::class, ExperimentalSerializationApi::class, ExperimentalSettingsApi::class)
|
||||
@OptIn(ExperimentalSerializationApi::class, ExperimentalSettingsApi::class)
|
||||
class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
private val javaPreferences = Preferences.userRoot().node("suwayomi/tachidesk/$key")
|
||||
private val preferences = JvmPreferencesSettings(javaPreferences)
|
||||
private val preferences = PreferencesSettings(javaPreferences)
|
||||
private val listeners = mutableMapOf<SharedPreferences.OnSharedPreferenceChangeListener, PreferenceChangeListener>()
|
||||
|
||||
// TODO: 2021-05-29 Need to find a way to get this working with all pref types
|
||||
@@ -76,14 +75,20 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
return Editor(preferences)
|
||||
}
|
||||
|
||||
class Editor(private val preferences: JvmPreferencesSettings) : SharedPreferences.Editor {
|
||||
val itemsToAdd = mutableMapOf<String, Any>()
|
||||
class Editor(private val preferences: PreferencesSettings) : SharedPreferences.Editor {
|
||||
private val actions = mutableListOf<Action>()
|
||||
|
||||
private sealed class Action {
|
||||
data class Add(val key: String, val value: Any) : Action()
|
||||
data class Remove(val key: String) : Action()
|
||||
object Clear : Action()
|
||||
}
|
||||
|
||||
override fun putString(key: String, value: String?): SharedPreferences.Editor {
|
||||
if (value != null) {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
} else {
|
||||
remove(key)
|
||||
actions += Action.Remove(key)
|
||||
}
|
||||
return this
|
||||
}
|
||||
@@ -93,40 +98,40 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
values: MutableSet<String>?
|
||||
): SharedPreferences.Editor {
|
||||
if (values != null) {
|
||||
itemsToAdd[key] = values
|
||||
actions += Action.Add(key, values)
|
||||
} else {
|
||||
remove(key)
|
||||
actions += Action.Remove(key)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putInt(key: String, value: Int): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putLong(key: String, value: Long): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putFloat(key: String, value: Float): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putBoolean(key: String, value: Boolean): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun remove(key: String): SharedPreferences.Editor {
|
||||
itemsToAdd.remove(key)
|
||||
actions += Action.Remove(key)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun clear(): SharedPreferences.Editor {
|
||||
itemsToAdd.clear()
|
||||
actions.add(Action.Clear)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -140,16 +145,33 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
}
|
||||
|
||||
private fun addToPreferences() {
|
||||
itemsToAdd.forEach { (key, value) ->
|
||||
actions.forEach {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when (value) {
|
||||
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), key, value as Set<String>)
|
||||
is String -> preferences.putString(key, value)
|
||||
is Int -> preferences.putInt(key, value)
|
||||
is Long -> preferences.putLong(key, value)
|
||||
is Float -> preferences.putFloat(key, value)
|
||||
is Double -> preferences.putDouble(key, value)
|
||||
is Boolean -> preferences.putBoolean(key, value)
|
||||
when (it) {
|
||||
is Action.Add -> when (val value = it.value) {
|
||||
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), it.key, value as Set<String>)
|
||||
is String -> preferences.putString(it.key, value)
|
||||
is Int -> preferences.putInt(it.key, value)
|
||||
is Long -> preferences.putLong(it.key, value)
|
||||
is Float -> preferences.putFloat(it.key, value)
|
||||
is Double -> preferences.putDouble(it.key, value)
|
||||
is Boolean -> preferences.putBoolean(it.key, value)
|
||||
}
|
||||
is Action.Remove -> {
|
||||
preferences.remove(it.key)
|
||||
/**
|
||||
* Set<String> are stored like
|
||||
* key.0 = value1
|
||||
* key.1 = value2
|
||||
* key.size = 2
|
||||
*/
|
||||
preferences.keys.forEach { key ->
|
||||
if (key.startsWith(it.key + ".")) {
|
||||
preferences.remove(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
Action.Clear -> preferences.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,10 +74,11 @@ class PackageController {
|
||||
|
||||
fun findPackage(packageName: String): InstalledPackage? {
|
||||
val file = File(androidFiles.packagesDir, packageName)
|
||||
return if (file.exists())
|
||||
return if (file.exists()) {
|
||||
InstalledPackage(file)
|
||||
else
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun findJarFromApk(apkFile: File): File? {
|
||||
|
||||
287
CHANGELOG.md
287
CHANGELOG.md
@@ -1,3 +1,290 @@
|
||||
# Server: v0.7.0 + WebUI: r983
|
||||
## TL;DR
|
||||
- CBZ downloads support
|
||||
- Webview implementation based on Microsoft playwright, disabled for this release
|
||||
- Fixed compatibility with some chinese extensions
|
||||
- Support for Tachiyomi extensions lib 1.4
|
||||
- WebUI changes:
|
||||
- Uhh, idk, find out yourself...
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1159) v0.6.6 (by @AriaMoradi)
|
||||
- (r1160) add Chagelog TL;DR (by @AriaMoradi)
|
||||
- (r1161) fix Changelog typos (by @AriaMoradi)
|
||||
- (r1162) WebView based cloudflare interceptor ([#456](https://github.com/Suwayomi/Tachidesk-Server/pull/456) by @AriaMoradi)
|
||||
- (r1163) update issue mod (by @AriaMoradi)
|
||||
- (r1164) better description (by @AriaMoradi)
|
||||
- (r1165) fix regex (by @AriaMoradi)
|
||||
- (r1166) get default User Agent from WebView ([#457](https://github.com/Suwayomi/Tachidesk-Server/pull/457) by @AriaMoradi)
|
||||
- (r1167) implementation of android.graphics.BitmapFactory ([#460](https://github.com/Suwayomi/Tachidesk-Server/pull/460) by @animeavi)
|
||||
- (r1168) Basic android.graphics Rect and Canvas implementation ([#461](https://github.com/Suwayomi/Tachidesk-Server/pull/461) by @animeavi)
|
||||
- (r1169) Get Playwright working ([#462](https://github.com/Suwayomi/Tachidesk-Server/pull/462) by @Syer10)
|
||||
- (r1170) disable deb release (by @AriaMoradi)
|
||||
- (r1171) Fix debian release ([#463](https://github.com/Suwayomi/Tachidesk-Server/pull/463) by @mahor1221)
|
||||
- (r1172) Add better manga thumbnail handling ([#465](https://github.com/Suwayomi/Tachidesk-Server/pull/465) by @Syer10)
|
||||
- (r1173) Use extension list fallback if extensions fail to fetch ([#469](https://github.com/Suwayomi/Tachidesk-Server/pull/469) by @Syer10)
|
||||
- (r1174) fix when playwright fails on providing a UA (by @AriaMoradi)
|
||||
- (r1175) Update CategoryMetaTable.kt (by @AriaMoradi)
|
||||
- (r1176) fix CategoryMetaTable reference to CategoryTable ([#473](https://github.com/Suwayomi/Tachidesk-Server/pull/473) by @AriaMoradi)
|
||||
- (r1177) remove possibly misleading sentence (by @AriaMoradi)
|
||||
- (r1178) Clarify and Update (by @AriaMoradi)
|
||||
- (r1179) Clarify and Update (by @AriaMoradi)
|
||||
- (r1180) link to Tachiyomi section (by @AriaMoradi)
|
||||
- (r1181) fix typo (by @AriaMoradi)
|
||||
- (r1182) Improve Gradle Configuration ([#478](https://github.com/Suwayomi/Tachidesk-Server/pull/478) by @Syer10)
|
||||
- (r1183) Improve Playwright handling ([#479](https://github.com/Suwayomi/Tachidesk-Server/pull/479) by @Syer10)
|
||||
- (r1184) fix ambiguous reference issue on JDK 13+ (by @AriaMoradi)
|
||||
- (r1185) update gradle version (by @AriaMoradi)
|
||||
- (r1186) upgrade dorkbox stuff (by @AriaMoradi)
|
||||
- (r1187) Fixe Dex2Jar and dorkbox dependency issues ([#487](https://github.com/Suwayomi/Tachidesk-Server/pull/487) by @akabhirav)
|
||||
- (r1188) Fix logging and update system try ([#488](https://github.com/Suwayomi/Tachidesk-Server/pull/488) by @Syer10)
|
||||
- (r1189) add support for Extensions Lib 1.4 ([#496](https://github.com/Suwayomi/Tachidesk-Server/pull/496) by @Syer10)
|
||||
- (r1190) disable playwright for v0.6.7 (by @AriaMoradi)
|
||||
- (r1191) Decouple Cache and Download behaviour ([#493](https://github.com/Suwayomi/Tachidesk-Server/pull/493) by @akabhirav)
|
||||
- (r1192) rethink image cache ([#498](https://github.com/Suwayomi/Tachidesk-Server/pull/498) by @AriaMoradi)
|
||||
- (r1193) fix Page index issues for some providers ([#491](https://github.com/Suwayomi/Tachidesk-Server/pull/491) by @akabhirav)
|
||||
- (r1194) Download as CBZ ([#490](https://github.com/Suwayomi/Tachidesk-Server/pull/490) by @akabhirav)
|
||||
- (r1195) re-order config options (by @AriaMoradi)
|
||||
- (r1196) stop using depricated API (by @AriaMoradi)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- (r964) Created a GridLayout enum and updated all locations to use it. ([#208](https://github.com/Suwayomi/Tachidesk-WebUI/pull/208) by @infix)
|
||||
- (r965) fix library update progress rendering ([#210](https://github.com/Suwayomi/Tachidesk-WebUI/pull/210) by @schroda)
|
||||
- (r966) Save reader settings per manga in Meta ([#216](https://github.com/Suwayomi/Tachidesk-WebUI/pull/216) by @schroda)
|
||||
- (r967) make default reader settings changeable ([#217](https://github.com/Suwayomi/Tachidesk-WebUI/pull/217) by @schroda)
|
||||
- (r968) [#211] Refresh Library after a update ([#212](https://github.com/Suwayomi/Tachidesk-WebUI/pull/212) by @schroda)
|
||||
- (r969) add logic for metadata migration ([#218](https://github.com/Suwayomi/Tachidesk-WebUI/pull/218) by @schroda)
|
||||
- (r970) set browser tab title ([#220](https://github.com/Suwayomi/Tachidesk-WebUI/pull/220) by @schroda)
|
||||
- (r971) Add tooltip containing full manga title to title of manga ([#221](https://github.com/Suwayomi/Tachidesk-WebUI/pull/221) by @schroda)
|
||||
- (r972) show more detailed upload dates for today and yesterday ([#222](https://github.com/Suwayomi/Tachidesk-WebUI/pull/222) by @schroda)
|
||||
- (r973) add GitHub action on pushing to run lint ([#224](https://github.com/Suwayomi/Tachidesk-WebUI/pull/224) by @schroda)
|
||||
- (r974) Ignore filters while searching ([#226](https://github.com/Suwayomi/Tachidesk-WebUI/pull/226) by @schroda)
|
||||
- (r975) force absolute import path ([#223](https://github.com/Suwayomi/Tachidesk-WebUI/pull/223) by @schroda)
|
||||
- (r976) add prettier for auto formatting ([#231](https://github.com/Suwayomi/Tachidesk-WebUI/pull/231) by @schroda)
|
||||
- (r977) Fix import path ([#228](https://github.com/Suwayomi/Tachidesk-WebUI/pull/228) by @schroda)
|
||||
- (r978) increase prettier line length to 120 ([#233](https://github.com/Suwayomi/Tachidesk-WebUI/pull/233) by @schroda)
|
||||
- (r979) Add chapter page dropdown ([#230](https://github.com/Suwayomi/Tachidesk-WebUI/pull/230) by @schroda)
|
||||
- (r980) add chapter dropdown to reader nav bar ([#229](https://github.com/Suwayomi/Tachidesk-WebUI/pull/229) by @schroda)
|
||||
- (r981) Fix lint error ([#235](https://github.com/Suwayomi/Tachidesk-WebUI/pull/235) by @schroda)
|
||||
- (r982) Fix reader nav bar scroll to page ([#236](https://github.com/Suwayomi/Tachidesk-WebUI/pull/236) by @schroda)
|
||||
- (r964) Created a GridLayout enum and updated all locations to use it. ([#208](https://github.com/Suwayomi/Tachidesk-WebUI/pull/208) by @infix)
|
||||
|
||||
|
||||
|
||||
# Server: v0.6.6 + WebUI: r963
|
||||
## TL;DR
|
||||
- Batch actions for chapters
|
||||
- Improved the downloader
|
||||
- WebUI changes:
|
||||
- Support for chapter actions
|
||||
- a lot of code cleanup
|
||||
- some bugfixes
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1114) fix broken links (by @AriaMoradi)
|
||||
- (r1115) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1116) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1117) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1118) Update winget.yml ([#393](https://github.com/Suwayomi/Tachidesk-Server/pull/393) by @vedantmgoyal2009)
|
||||
- (r1119) fix jre path([#396](https://github.com/Suwayomi/Tachidesk-Server/pull/396) by @vedantmgoyal2009)
|
||||
- (r1120) Fix deb package ([#397](https://github.com/Suwayomi/Tachidesk-Server/pull/397) by @mahor1221)
|
||||
- (r1121) bump version (by @AriaMoradi)
|
||||
- (r1122) Update Changelog (by @AriaMoradi)
|
||||
- (r1123) Add libc++-dev ([#405](https://github.com/Suwayomi/Tachidesk-Server/pull/405) by @mahor1221)
|
||||
- (r1124) Revert back to correct way of handling jre_dir ([#408](https://github.com/Suwayomi/Tachidesk-Server/pull/408) by @mahor1221)
|
||||
- (r1125) Update winget.yml ([#410](https://github.com/Suwayomi/Tachidesk-Server/pull/410) by @vedantmgoyal2009)
|
||||
- (r1126) Remove support for Sorayomi web interface ([#414](https://github.com/Suwayomi/Tachidesk-Server/pull/414) by @marcoebbinghaus)
|
||||
- (r1127) Fix downloader memory leak ([#418](https://github.com/Suwayomi/Tachidesk-Server/pull/418) by @Syer10)
|
||||
- (r1128) Documentation cleanup ([#417](https://github.com/Suwayomi/Tachidesk-Server/pull/417) by @Syer10)
|
||||
- (r1129) Updater cleanup and improvements ([#416](https://github.com/Suwayomi/Tachidesk-Server/pull/416) by @Syer10)
|
||||
- (r1130) replace quickjs with Mozilla Rhino ([#415](https://github.com/Suwayomi/Tachidesk-Server/pull/415) by @xhzhe)
|
||||
- (r1131) ktlint (by @AriaMoradi)
|
||||
- (r1132) move Tachiyomi's BuildConfig to kotlin dir (by @AriaMoradi)
|
||||
- (r1133) remove BuildConfig as extensions now use AppInfo (by @AriaMoradi)
|
||||
- (r1134) include list of mangas missing source in restore report ([#421](https://github.com/Suwayomi/Tachidesk-Server/pull/421) by @AriaMoradi)
|
||||
- (r1135) Update dependencies ([#422](https://github.com/Suwayomi/Tachidesk-Server/pull/422) by @Syer10)
|
||||
- (r1136) Lint ([#423](https://github.com/Suwayomi/Tachidesk-Server/pull/423) by @Syer10)
|
||||
- (r1137) Fix: Error handling for popular/latest api if pageNum was supplied as zero ([#424](https://github.com/Suwayomi/Tachidesk-Server/pull/424) by @meta-boy)
|
||||
- (r1138) Add cache control header to manga page response ([#430](https://github.com/Suwayomi/Tachidesk-Server/pull/430) by @martinek)
|
||||
- (r1139) add MangaTable.lastFetchedAt and ChapterTable.chaptersLastFetchedAt ([#431](https://github.com/Suwayomi/Tachidesk-Server/pull/431) by @martinek)
|
||||
- (r1140) Pre-load meta entries for all chapters for optimization ([#432](https://github.com/Suwayomi/Tachidesk-Server/pull/432) by @martinek)
|
||||
- (r1141) POST variant for `/{sourceId}/search` endpoint ([#434](https://github.com/Suwayomi/Tachidesk-Server/pull/434) by @martinek)
|
||||
- (r1142) Add request body to documentation ([#435](https://github.com/Suwayomi/Tachidesk-Server/pull/435) by @Syer10)
|
||||
- (r1143) add batch download api ([#436](https://github.com/Suwayomi/Tachidesk-Server/pull/436) by @martinek)
|
||||
- (r1144) Migrate to H2 v2 (by @AriaMoradi)
|
||||
- (r1145) add category and global meta ([#438](https://github.com/Suwayomi/Tachidesk-Server/pull/438) by @AriaMoradi)
|
||||
- (r1146) Revert H2 database to v1 (by @AriaMoradi)
|
||||
- (r1147) refactor deprecated api (by @AriaMoradi)
|
||||
- (r1148) Downloader Rewrite ([#437](https://github.com/Suwayomi/Tachidesk-Server/pull/437) by @Syer10)
|
||||
- (r1149) Set source preference doc fix ([#441](https://github.com/Suwayomi/Tachidesk-Server/pull/441) by @Syer10)
|
||||
- (r1150) Add batch chapter update endpoint ([#442](https://github.com/Suwayomi/Tachidesk-Server/pull/442) by @martinek)
|
||||
- (r1151) changes needed for tachiyomi tracker (by @AriaMoradi)
|
||||
- (r1152) Future proofing (by @AriaMoradi)
|
||||
- (r1153) Fix settings/check-update endpoint ([#445](https://github.com/Suwayomi/Tachidesk-Server/pull/445) by @martinek)
|
||||
- (r1154) Fix docs for /server/check-updates ([#447](https://github.com/Suwayomi/Tachidesk-Server/pull/447) by @martinek)
|
||||
- (r1155) Batch editing and deleting any chapter ([#449](https://github.com/Suwayomi/Tachidesk-Server/pull/449) by @martinek)
|
||||
- (r1156) make chapters endpoint more unifrom (by @AriaMoradi)
|
||||
- (r1157) Add batch endpoint for removing downloads from download queue ([#452](https://github.com/Suwayomi/Tachidesk-Server/pull/452) by @martinek)
|
||||
- (r1158) Download queue missing update fix ([#450](https://github.com/Suwayomi/Tachidesk-Server/pull/450) by @martinek)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- (r947) Feature/swr for library screens ([#186](https://github.com/Suwayomi/Tachidesk-WebUI/pull/186) by @martinek)
|
||||
- (r948) Feature/swr for simple queries ([#187](https://github.com/Suwayomi/Tachidesk-WebUI/pull/187) by @martinek)
|
||||
- (r949) Check download queue for changes and reload chapters if any chapter download changes state. ([#189](https://github.com/Suwayomi/Tachidesk-WebUI/pull/189) by @martinek)
|
||||
- (r950) Update typescript dependency ([#190](https://github.com/Suwayomi/Tachidesk-WebUI/pull/190) by @martinek)
|
||||
- (r951) update browserlist (by @AriaMoradi)
|
||||
- (r952) Feature/batch chapter download ([#191](https://github.com/Suwayomi/Tachidesk-WebUI/pull/191) by @martinek)
|
||||
- (r953) Memoize empty view face so it does not change on rerender ([#193](https://github.com/Suwayomi/Tachidesk-WebUI/pull/193) by @martinek)
|
||||
- (r954) Feature/batch chapter actions ([#194](https://github.com/Suwayomi/Tachidesk-WebUI/pull/194) by @martinek)
|
||||
- (r955) Fix navbar back button behavior ([#195](https://github.com/Suwayomi/Tachidesk-WebUI/pull/195) by @martinek)
|
||||
- (r956) Options panels refactoring ([#196](https://github.com/Suwayomi/Tachidesk-WebUI/pull/196) by @martinek)
|
||||
- (r957) Refactor and fix sorting in library ([#197](https://github.com/Suwayomi/Tachidesk-WebUI/pull/197) by @martinek)
|
||||
- (r958) Scroll window to top when PagedPager changes page ([#198](https://github.com/Suwayomi/Tachidesk-WebUI/pull/198) by @martinek)
|
||||
- (r959) Verticall scroll navigation and fix ([#200](https://github.com/Suwayomi/Tachidesk-WebUI/pull/200) by @martinek)
|
||||
- (r960) Hide overflowing text in reader title if text can't be wrapped ([#199](https://github.com/Suwayomi/Tachidesk-WebUI/pull/199) by @martinek)
|
||||
- (r961) Add safezone to scroll end detection to prevent edge cases when scrolling to the end would not detect end ([#201](https://github.com/Suwayomi/Tachidesk-WebUI/pull/201) by @martinek)
|
||||
- (r962) Refactor/download queue and cleanup visuals overall ([#202](https://github.com/Suwayomi/Tachidesk-WebUI/pull/202) by @martinek)
|
||||
- (r963) Fix "back" pagination on double page layout in reader for spread pages ([#203](https://github.com/Suwayomi/Tachidesk-WebUI/pull/203) by @martinek)
|
||||
|
||||
|
||||
|
||||
# Server: v0.6.5 + WebUI: r946
|
||||
## TL;DR
|
||||
- Fixed Windows bundler
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1113) v0.6.4 (by @AriaMoradi)
|
||||
- (r1114) fix broken links (by @AriaMoradi)
|
||||
- (r1115) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1116) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1117) fix more broken stuff (by @AriaMoradi)
|
||||
- (r1118) Update winget.yml ([#393](https://github.com/Suwayomi/Tachidesk-Server/pull/393) by @vedantmgoyal2009)
|
||||
- (r1119) fix jre path([#396](https://github.com/Suwayomi/Tachidesk-Server/pull/396) by @voltrare)
|
||||
- (r1120) Fix deb package ([#397](https://github.com/Suwayomi/Tachidesk-Server/pull/397) by @mahor1221)
|
||||
- (r1121) bump version (by @AriaMoradi)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- None
|
||||
|
||||
|
||||
|
||||
# Server: v0.6.4 + WebUI: r946
|
||||
## TL;DR
|
||||
- No new major features
|
||||
- Bug fixes and changes for packaging
|
||||
- Documentation changes
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1087) v0.6.3 (by @AriaMoradi)
|
||||
- (r1088) Save categories when manga is unfavorited ([#335](https://github.com/Suwayomi/Tachidesk-Server/pull/335) by @Syer10)
|
||||
- (r1089) handle solid RAR archives ([#339](https://github.com/Suwayomi/Tachidesk-Server/pull/339)) cfso100@gmail.com
|
||||
- (r1090) add support for changing downloads dir ([#343](https://github.com/Suwayomi/Tachidesk-Server/pull/343) by @AriaMoradi)
|
||||
- (r1091) fix Applications dir dependency ([#344](https://github.com/Suwayomi/Tachidesk-Server/pull/344) by @AriaMoradi)
|
||||
- (r1092) add support for alternative web interfaces ([#342](https://github.com/Suwayomi/Tachidesk-Server/pull/342) by @AriaMoradi)
|
||||
- (r1093) Add displayValues json field for select filter ([#347](https://github.com/Suwayomi/Tachidesk-Server/pull/347) by @Syer10)
|
||||
- (r1094) document manga endpoints ([#348](https://github.com/Suwayomi/Tachidesk-Server/pull/348) by @Syer10)
|
||||
- (r1095) add ChapterCount to manga object in categoryMangas endpoint ([#349](https://github.com/Suwayomi/Tachidesk-Server/pull/349) by @abhijeetChawla)
|
||||
- (r1096) document all endpoints ([#350](https://github.com/Suwayomi/Tachidesk-Server/pull/350) by @Syer10)
|
||||
- (r1097) fix copymanga ([#354](https://github.com/Suwayomi/Tachidesk-Server/pull/354) by @AriaMoradi)
|
||||
- (r1098) fix formatting by kotlinter (by @AriaMoradi)
|
||||
- (r1099) bump WebUI (by @AriaMoradi)
|
||||
- (r1100) fix WebUI release name (by @AriaMoradi)
|
||||
- (r1101) Fix documentation errors ([#358](https://github.com/Suwayomi/Tachidesk-Server/pull/358) by @Syer10)
|
||||
- (r1102) Docs improvements ([#359](https://github.com/Suwayomi/Tachidesk-Server/pull/359) by @Syer10)
|
||||
- (r1103) Add linux-all.tar.gz & systemd service ([#366](https://github.com/Suwayomi/Tachidesk-Server/pull/366) by @mahor1221)
|
||||
- (r1104) Publish to Windows Package Managar (WinGet) ([#369](https://github.com/Suwayomi/Tachidesk-Server/pull/369) by @vedantmgoyal2009)
|
||||
- (r1105) Refactor scripts ([#370](https://github.com/Suwayomi/Tachidesk-Server/pull/370) by @mahor1221)
|
||||
- (r1106) Run workflow jobs toghether ([#371](https://github.com/Suwayomi/Tachidesk-Server/pull/371) by @mahor1221)
|
||||
- (r1107) Update gradle action ([#372](https://github.com/Suwayomi/Tachidesk-Server/pull/372) by @mahor1221)
|
||||
- (r1108) Improve DocumentationDsl, bugfix default values and add queryParams ([#378](https://github.com/Suwayomi/Tachidesk-Server/pull/378) by @Syer10)
|
||||
- (r1109) Tidy up bundler script ([#380](https://github.com/Suwayomi/Tachidesk-Server/pull/380) by @mahor1221)
|
||||
- (r1110) Replace linux-all with linux-assets ([#381](https://github.com/Suwayomi/Tachidesk-Server/pull/381) by @mahor1221)
|
||||
- (r1111) Rename every instance of Tachidesk jar to Tachdidesk-Server.jar ([#384](https://github.com/Suwayomi/Tachidesk-Server/pull/384) by @AriaMoradi)
|
||||
- (r1112) Fix mistakes from #384 ([#385](https://github.com/Suwayomi/Tachidesk-Server/pull/385) by @AriaMoradi)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- (r943) fix default width ([#171](https://github.com/Suwayomi/Tachidesk-WebUI/pull/171) by @Robonau)
|
||||
- (r944) added an update checker button for library ([#172](https://github.com/Suwayomi/Tachidesk-WebUI/pull/172) by @infix)
|
||||
- (r945) fix download queue delete button ([#176](https://github.com/Suwayomi/Tachidesk-WebUI/pull/176) by @Kreach37)
|
||||
- (r946) fix mangadex filters ([#177](https://github.com/Suwayomi/Tachidesk-WebUI/pull/177) by @Robonau)
|
||||
|
||||
|
||||
|
||||
# Server: v0.6.3 + WebUI: r942
|
||||
## TL;DR
|
||||
- Changes in Server
|
||||
- Support for array search filter changes list
|
||||
- Support for Tachiyomi extensions lib 1.3
|
||||
- Changes in WebUI
|
||||
- Better search filter support
|
||||
- Fluid manga grid
|
||||
- Library comfortable grid
|
||||
- Sources view layouts
|
||||
- Various other changes...
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1074) v0.6.2 (by @AriaMoradi)
|
||||
- (r1075) support array filter changes ([#304](https://github.com/Suwayomi/Tachidesk-Server/pull/304) by @AriaMoradi)
|
||||
- (r1076) fix filterlist bugs ([#306](https://github.com/Suwayomi/Tachidesk-Server/pull/306) by @AriaMoradi)
|
||||
- (r1077) Update README.md ([#305](https://github.com/Suwayomi/Tachidesk-Server/pull/305) by @mahor1221)
|
||||
- (r1078) fix meta update changing all keys ([#314](https://github.com/Suwayomi/Tachidesk-Server/pull/314) by @AriaMoradi)
|
||||
- (r1079) add support for tachiyomi extensions Lib 1.3 ([#316](https://github.com/Suwayomi/Tachidesk-Server/pull/316) by @AriaMoradi)
|
||||
- (r1080) Fix sources list of one source throws an exception ([#308](https://github.com/Suwayomi/Tachidesk-Server/pull/308) by @Syer10)
|
||||
- (r1081) Improve source handling, fix errors with uninitialized mangas in broken sources ([#319](https://github.com/Suwayomi/Tachidesk-Server/pull/319) by @Syer10)
|
||||
- (r1082) Add thumbnail support for stub sources ([#320](https://github.com/Suwayomi/Tachidesk-Server/pull/320) by @Syer10)
|
||||
- (r1083) update description for Tachidesk-Sorayomi ([#326](https://github.com/Suwayomi/Tachidesk-Server/pull/326) by @DattatreyaReddy)
|
||||
- (r1084) Add last bit of code needed for Extensions Lib 1.3 ([#330](https://github.com/Suwayomi/Tachidesk-Server/pull/330) by @Syer10)
|
||||
- (r1085) Add QuickJS, replaces Duktape for Extensions Lib 1.3 ([#331](https://github.com/Suwayomi/Tachidesk-Server/pull/331) by @Syer10)
|
||||
- (r1086) fix auth not actually blocking requests ([#333](https://github.com/Suwayomi/Tachidesk-Server/pull/333) by @AriaMoradi)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- (r930) Source filter scroll fix (array of filters on submit [#149](https://github.com/Suwayomi/Tachidesk-WebUI/pull/149) by @Robonau)
|
||||
- (r931) fix manga badges setting menu that turns the update/download badges on and off ([#150](https://github.com/Suwayomi/Tachidesk-WebUI/pull/150) by @Robonau)
|
||||
- (r932) move sorts to copy tachiyomi ([#151](https://github.com/Suwayomi/Tachidesk-WebUI/pull/151) by @Robonau)
|
||||
- (r933) add comfortable grid option ([#152](https://github.com/Suwayomi/Tachidesk-WebUI/pull/152) by @Robonau)
|
||||
- (r934) source layouts ([#153](https://github.com/Suwayomi/Tachidesk-WebUI/pull/153) by @Robonau)
|
||||
- (r935) List layout ([#154](https://github.com/Suwayomi/Tachidesk-WebUI/pull/154) by @Robonau)
|
||||
- (r936) in library badge to manga in sources ([#156](https://github.com/Suwayomi/Tachidesk-WebUI/pull/156) by @Robonau)
|
||||
- (r937) mass search ([#157](https://github.com/Suwayomi/Tachidesk-WebUI/pull/157) by @Robonau)
|
||||
- (r938) 18+ tag on source/extension cards ([#160](https://github.com/Suwayomi/Tachidesk-WebUI/pull/160) by @Robonau)
|
||||
- (r939) fix search source click ([#164](https://github.com/Suwayomi/Tachidesk-WebUI/pull/164) by @Robonau)
|
||||
- (r940) items per row setting ([#165](https://github.com/Suwayomi/Tachidesk-WebUI/pull/165) by @Robonau)
|
||||
- (r941) fix the grid width thing ([#169](https://github.com/Suwayomi/Tachidesk-WebUI/pull/169) by @Robonau)
|
||||
- (r942) unified library options ([#168](https://github.com/Suwayomi/Tachidesk-WebUI/pull/168) by @infix)
|
||||
|
||||
# Server: v0.6.2 + WebUI: r929
|
||||
## TL;DR
|
||||
- Changes in WebUI
|
||||
- Moved search to Browse
|
||||
- Support for Source Filters
|
||||
- Better visuals for Download Queue
|
||||
- A live version of WebUI is now available [at this link](https://tachidesk-webui-preview.github.io/).
|
||||
|
||||
## Tachidesk-Server Changelog
|
||||
- (r1073) Refactor debian-packager.sh, rename launcher scripts ([#303](https://github.com/Suwayomi/Tachidesk-Server/pull/303) by @mahor1221)
|
||||
|
||||
## Tachidesk-WebUI Changelog
|
||||
- (r912) show locale date, less confusing ([#131](https://github.com/Suwayomi/Tachidesk-WebUI/pull/131) by @AriaMoradi)
|
||||
- (r913) fix links to work on a bare host ([#132](https://github.com/Suwayomi/Tachidesk-WebUI/pull/132) by @AriaMoradi)
|
||||
- (r914) fix direct links ([#133](https://github.com/Suwayomi/Tachidesk-WebUI/pull/133) by @AriaMoradi)
|
||||
- (r915) deploy to github pages (by @AriaMoradi)
|
||||
- (r916) fix typo (by @AriaMoradi)
|
||||
- (r917) better naming (by @AriaMoradi)
|
||||
- (r918) update notice about github pages (by @AriaMoradi)
|
||||
- (r919) move text (by @AriaMoradi)
|
||||
- (r920) make all links work by catching 404 (by @AriaMoradi)
|
||||
- (r921) fix scrolling 8px ([#135](https://github.com/Suwayomi/Tachidesk-WebUI/pull/135) by @Robonau)
|
||||
- (r922) sorting ([#136](https://github.com/Suwayomi/Tachidesk-WebUI/pull/136) by @Robonau)
|
||||
- (r923) Close button fix ([#141](https://github.com/Suwayomi/Tachidesk-WebUI/pull/141)) z14942744@gmail.com
|
||||
- (r924) add NavBarContextProvider ([#128](https://github.com/Suwayomi/Tachidesk-WebUI/pull/128) by @abhijeetChawla)
|
||||
- (r925) Resolved Merged Conflicts ([#127](https://github.com/Suwayomi/Tachidesk-WebUI/pull/127) by @abhijeetChawla)
|
||||
- (r926) more Download Queue info ([#138](https://github.com/Suwayomi/Tachidesk-WebUI/pull/138) by @Robonau)
|
||||
- (r927) Source filters, move search to SourceMangas ([#142](https://github.com/Suwayomi/Tachidesk-WebUI/pull/142) by @Robonau)
|
||||
- (r928) Source genre sorts design ([#147](https://github.com/Suwayomi/Tachidesk-WebUI/pull/147) by @Robonau)
|
||||
- (r929) Update LibraryOptions.tsx ([#146](https://github.com/Suwayomi/Tachidesk-WebUI/pull/146) by @Robonau)
|
||||
|
||||
|
||||
|
||||
# Server: v0.6.1 + WebUI: r911
|
||||
## TL;DR
|
||||
- msi and deb packages thanks to @mahor1221
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
## Where should I start?
|
||||
Checkout [This Kanban Board](https://github.com/Suwayomi/Tachidesk/projects/1) to see the rough development roadmap.
|
||||
|
||||
**Note 1:** Notify the developers on [Suwayomi discord](https://discord.gg/DDZdqZWaHA) (#tachidesk-server and #tachidesk-webui channels) or open a WIP pull request before starting if you decide to take on working on anything from/not from the roadmap in order to avoid parallel efforts on the same issue/feature.
|
||||
|
||||
**Note 2:** Your pull request will be squashed into a single commit.
|
||||
### Important notes
|
||||
- Notify the developers on [Suwayomi discord](https://discord.gg/DDZdqZWaHA) (#tachidesk-server and #tachidesk-webui channels) or open a WIP pull request before starting if you decide to take on working on anything from/not from the roadmap in order to avoid parallel efforts on the same issue/feature.
|
||||
- Your pull request will be squashed into a single commit.
|
||||
- We hate big pull requests, make them as small as possible, change one meaningful thing. Spam pull requests, we don't mind.
|
||||
|
||||
### Project goals and vision
|
||||
- Porting Tachiyomi and covering it's features
|
||||
|
||||
54
README.md
54
README.md
@@ -34,25 +34,22 @@ A free and open source manga reader server that runs extensions built for [Tachi
|
||||
|
||||
Tachidesk is an independent Tachiyomi compatible software and is **not a Fork of** Tachiyomi.
|
||||
|
||||
`Tachidesk` is a general term used to describe the combination of Tachidesk-Server(this project) and one of our clients.
|
||||
Think of it roughly like the concept of "distribution" in GNU/Linux distributions, in which Linux(Tachidesk-Server) is the kernel and the difference is which desktop environment(Tachidesk client) you get with it.
|
||||
|
||||
Tachidesk-Server is as multi-platform as you can get. Any platform that runs java and/or has a modern browser can run it. This includes Windows, Linux, macOS, chrome OS, etc. Follow [Downloading and Running the app](#downloading-and-running-the-app) for installation instructions.
|
||||
|
||||
Ability to sync with Tachiyomi is a planned feature.
|
||||
Ability to sync with Tachiyomi is a planned feature, for more info look [here](#syncing-with-tachiyomi).
|
||||
|
||||
# Tachidesk client projects
|
||||
**You need a client/user interface app as a front-end for Tachidesk-Server, if you Directly Download Tachidesk-Server you'll get a bundled version of [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI) with it.**
|
||||
**You need a client/user interface app as a front-end for Tachidesk-Server, if you [Directly Download Tachidesk-Server](https://github.com/Suwayomi/Tachidesk-Server/releases/latest) you'll get a bundled version of [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI) with it.**
|
||||
|
||||
Here's a list of known clients/user interfaces for Tachidesk-Server:
|
||||
##### Actively Developed Cients
|
||||
- [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI): The web/ElectronJS front-end that Tachidesk-Server is traditionally shipped with. Usually gets new features faster.
|
||||
- [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI): The web/ElectronJS front-end that Tachidesk-Server ships with by default.
|
||||
- [Tachidesk-JUI](https://github.com/Suwayomi/Tachidesk-JUI): The native desktop front-end for Tachidesk-Server. Currently the most advanced.
|
||||
- [Tachidesk-qtui](https://github.com/Suwayomi/Tachidesk-qtui): A C++/Qt front-end for mobile devices(Android/linux), in super early stage of development.
|
||||
- [Tachidesk-Flutter](https://github.com/Suwayomi/Tachidesk-Flutter): A Flutter front-end for Desktop(Linux, windows, etc.), in early stage of development.
|
||||
- [Tachidesk-qtui](https://github.com/Suwayomi/Tachidesk-qtui): A C++/Qt front-end for mobile devices(Android/linux), feature support is basic.
|
||||
- [Tachidesk-Sorayomi](https://github.com/Suwayomi/Tachidesk-Sorayomi): A Flutter front-end for Desktop(Linux, windows, etc.), Web and Android with a User Inerface inspired by Tachiyomi.
|
||||
##### Inctive/Abandoned Cients
|
||||
- [Equinox](https://github.com/Suwayomi/Equinox): A web user interface made with Vue.js, in super early stage of development.
|
||||
- [Tachidesk-GTK](https://github.com/mahor1221/Tachidesk-GTK): A native Rust/GTK desktop client, in super early stage of development.
|
||||
- [Equinox](https://github.com/Suwayomi/Equinox): A web user interface made with Vue.js.
|
||||
- [Tachidesk-GTK](https://github.com/mahor1221/Tachidesk-GTK): A native Rust/GTK desktop client.
|
||||
|
||||
## Is this application usable? Should I test it?
|
||||
Here is a list of current features:
|
||||
@@ -80,33 +77,40 @@ If a bundle for your operating system or cpu architecture is not provided then r
|
||||
**Node:** Linux launcher scripts are named a bit differently but work the same.
|
||||
|
||||
### Windows
|
||||
Download the latest `win32`(Windows 32-bit) or `win64`(Windows 64-bit) release from [the releases section](https://github.com/Suwayomi/Tachidesk/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
||||
Download the latest `win32`(Windows 32-bit) or `win64`(Windows 64-bit) release from [the releases section](https://github.com/Suwayomi/Tachidesk-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-Server-preview/releases).
|
||||
|
||||
Unzip the downloaded file and double click on one of the launcher scripts.
|
||||
|
||||
### macOS
|
||||
Download the latest `macOS-x64`(older macOS systems) or `macOS-arm64`(Apple M1) release from [the releases section](https://github.com/Suwayomi/Tachidesk/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
||||
Download the latest `macOS-x64`(older macOS systems) or `macOS-arm64`(Apple M1 and newer) release from [the releases section](https://github.com/Suwayomi/Tachidesk-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-Server-preview/releases).
|
||||
|
||||
Unzip the downloaded file and double click on one of the launcher scripts.
|
||||
|
||||
### GNU/Linux
|
||||
Download the latest `linux-x64`(x86_64) release from [the releases section](https://github.com/Suwayomi/Tachidesk/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
||||
Download the latest `linux-x64`(x86_64) release from [the releases section](https://github.com/Suwayomi/Tachidesk-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-Server-preview/releases).
|
||||
|
||||
`tar xvf` the downloaded file and double click on one of the launcher scripts or run them using the terminal.
|
||||
|
||||
## Other methods of getting Tachidesk
|
||||
### Arch Linux
|
||||
You can install Tachidesk from the AUR
|
||||
You can install Tachidesk from the AUR:
|
||||
```
|
||||
yay -S tachidesk
|
||||
```
|
||||
|
||||
### Ubuntu-based distributions
|
||||
More information can be found on the [PPA's page](https://launchpad.net/~suwayomi/+archive/ubuntu/tachidesk).
|
||||
### Debian/Ubuntu
|
||||
Download the latest deb package from the release section or Install from the MPR
|
||||
```
|
||||
sudo add-apt-repository ppa:suwayomi/tachidesk
|
||||
git clone https://mpr.makedeb.org/tachidesk-server.git
|
||||
cd tachidesk-server
|
||||
makedeb -si
|
||||
```
|
||||
|
||||
### Ubuntu
|
||||
```
|
||||
sudo add-apt-repository ppa:suwayomi/tachidesk-server
|
||||
sudo apt update
|
||||
sudo apt install tachidesk
|
||||
sudo apt install tachidesk-server
|
||||
```
|
||||
|
||||
### Docker
|
||||
@@ -141,10 +145,12 @@ Check out [this wiki page](https://github.com/Suwayomi/Tachidesk-Server/wiki/Con
|
||||
If you face issues with your setup then we are happy to provide help, just join our discord server(a discord badge is on the top of the page, you are just a click clack away!).
|
||||
|
||||
## Syncing With Tachiyomi
|
||||
### The Tachidesk extension
|
||||
- You can install the `Tachidesk` extension inside tachiyomi.
|
||||
- The extension will load Tachidesk library.
|
||||
- By manipulating filters you can browse your categories.
|
||||
### The Suwayomi extension and tracker
|
||||
- You can install the `Suwayomi` extension inside tachiyomi.
|
||||
- The extension will load your Tachidesk library.
|
||||
- By manipulating extension search filters you can browse your categories.
|
||||
- You can enable the Suwayomi tracker to track reading progress with your Tachidesk server.
|
||||
- Note: Tachiyomi [only allowes tracking one way](https://github.com/tachiyomiorg/tachiyomi/issues/1626), meaning that by reading chapters on other Tachidesk clients the last read chapter number will updated on the tracker but tachiyomi won't automatically mark them as read for you.
|
||||
|
||||
### Other methods
|
||||
Checkout [this issue](https://github.com/Suwayomi/Tachidesk-Server/issues/159) for tracking progress.
|
||||
@@ -173,3 +179,7 @@ Changes to both codebases is licensed under `MPL v. 2.0` as the rest of this pro
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
The developer of this application does not have any affiliation with the content providers available.
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
import org.jmailen.gradle.kotlinter.tasks.FormatTask
|
||||
import org.jmailen.gradle.kotlinter.tasks.LintTask
|
||||
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
kotlin("jvm") version kotlinVersion
|
||||
kotlin("plugin.serialization") version kotlinVersion
|
||||
id("org.jmailen.kotlinter") version "3.8.0"
|
||||
id("com.github.gmazzo.buildconfig") version "3.0.3" apply false
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.kotlinter)
|
||||
alias(libs.plugins.buildconfig) apply false
|
||||
alias(libs.plugins.download)
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -17,38 +19,24 @@ allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
google()
|
||||
maven("https://jitpack.io")
|
||||
maven("https://github.com/Suwayomi/Tachidesk-Server/raw/android-jar/")
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
val projects = listOf(
|
||||
project(":AndroidCompat"),
|
||||
project(":AndroidCompat:Config"),
|
||||
project(":server")
|
||||
)
|
||||
|
||||
configure(projects) {
|
||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
|
||||
apply(plugin = "org.jmailen.kotlinter")
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
subprojects {
|
||||
plugins.withType<JavaPlugin> {
|
||||
extensions.configure<JavaPluginExtension> {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<KotlinCompile> {
|
||||
dependsOn(formatKotlin)
|
||||
withType<KotlinJvmCompile> {
|
||||
dependsOn("formatKotlin")
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
freeCompilerArgs = listOf(
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"-Xopt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
||||
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,56 +48,4 @@ configure(projects) {
|
||||
source(files("src/kotlin"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
// Kotlin
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
implementation(kotlin("reflect"))
|
||||
testImplementation(kotlin("test-junit5"))
|
||||
|
||||
// coroutines
|
||||
val coroutinesVersion = "1.6.0"
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
||||
|
||||
val kotlinSerializationVersion = "1.3.2"
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinSerializationVersion")
|
||||
|
||||
// Dependency Injection
|
||||
implementation("org.kodein.di:kodein-di-conf-jvm:7.10.0")
|
||||
|
||||
// Logging
|
||||
implementation("org.slf4j:slf4j-api:1.7.32")
|
||||
implementation("ch.qos.logback:logback-classic:1.2.6")
|
||||
implementation("io.github.microutils:kotlin-logging:2.1.21")
|
||||
|
||||
// ReactiveX
|
||||
implementation("io.reactivex:rxjava:1.3.8")
|
||||
implementation("io.reactivex:rxkotlin:1.0.0")
|
||||
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
|
||||
|
||||
// dependency both in AndroidCompat and extensions, version locked by Tachiyomi app/extensions
|
||||
implementation("org.jsoup:jsoup:1.14.3")
|
||||
|
||||
// dependency of :AndroidCompat:Config
|
||||
implementation("com.typesafe:config:1.4.1")
|
||||
implementation("io.github.config4k:config4k:0.4.2")
|
||||
|
||||
// to get application content root
|
||||
implementation("net.harawata:appdirs:1.2.1")
|
||||
|
||||
// dex2jar
|
||||
val dex2jarVersion = "v35"
|
||||
implementation("com.github.ThexXTURBOXx.dex2jar:dex-translator:$dex2jarVersion")
|
||||
implementation("com.github.ThexXTURBOXx.dex2jar:dex-tools:$dex2jarVersion")
|
||||
|
||||
// APK parser
|
||||
implementation("net.dongliu:apk-parser:2.6.10")
|
||||
|
||||
// dependency both in AndroidCompat and server, version locked by javalin
|
||||
implementation("com.fasterxml.jackson.core:jackson-annotations:2.12.4")
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,18 @@ import java.io.BufferedReader
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const val kotlinVersion = "1.6.10"
|
||||
|
||||
const val MainClass = "suwayomi.tachidesk.MainKt"
|
||||
|
||||
// should be bumped with each stable release
|
||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.6.1"
|
||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.7.0"
|
||||
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r911"
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r983"
|
||||
|
||||
// counts commits on the master branch
|
||||
val tachideskRevision = runCatching {
|
||||
System.getenv("ProductRevision") ?: Runtime
|
||||
.getRuntime()
|
||||
.exec("git rev-list HEAD --count")
|
||||
System.getenv("ProductRevision") ?: ProcessBuilder()
|
||||
.command("git", "rev-list", "HEAD", "--count")
|
||||
.start()
|
||||
.let { process ->
|
||||
process.waitFor()
|
||||
val output = process.inputStream.use {
|
||||
|
||||
217
gradle/libs.versions.toml
Normal file
217
gradle/libs.versions.toml
Normal file
@@ -0,0 +1,217 @@
|
||||
[versions]
|
||||
kotlin = "1.8.0"
|
||||
coroutines = "1.6.4"
|
||||
serialization = "1.4.1"
|
||||
okhttp = "5.0.0-alpha.11" # Major version is locked by Tachiyomi extensions
|
||||
javalin = "4.6.6" # Javalin 5.0.0+ requires Java 11
|
||||
jackson = "2.13.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||
exposed = "0.40.1"
|
||||
dex2jar = "v60"
|
||||
rhino = "1.7.14"
|
||||
settings = "1.0.0-RC"
|
||||
twelvemonkeys = "3.9.4"
|
||||
playwright = "1.28.0"
|
||||
|
||||
[libraries]
|
||||
# Kotlin
|
||||
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
|
||||
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" }
|
||||
|
||||
# Coroutines
|
||||
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
|
||||
coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
|
||||
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
|
||||
|
||||
# Serialization
|
||||
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
|
||||
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }
|
||||
|
||||
# Logging
|
||||
slf4japi = "org.slf4j:slf4j-api:2.0.6"
|
||||
logback = "ch.qos.logback:logback-classic:1.3.5"
|
||||
kotlinlogging = "io.github.microutils:kotlin-logging:3.0.5"
|
||||
|
||||
# OkHttp
|
||||
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
||||
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
|
||||
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp" }
|
||||
okio = "com.squareup.okio:okio:3.3.0"
|
||||
|
||||
# Javalin api
|
||||
javalin-core = { module = "io.javalin:javalin", version.ref = "javalin" }
|
||||
javalin-openapi = { module = "io.javalin:javalin-openapi", version.ref = "javalin" }
|
||||
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
|
||||
jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
|
||||
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
|
||||
|
||||
# Exposed ORM
|
||||
exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
|
||||
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" }
|
||||
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
|
||||
exposed-javatime = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
|
||||
h2 = "com.h2database:h2:1.4.200" # current database driver, can't update to h2 v2 without sql migration
|
||||
|
||||
# Exposed Migrations
|
||||
exposed-migrations = "com.github.Suwayomi:exposed-migrations:3.2.0"
|
||||
|
||||
# Dependency Injection
|
||||
kodein = "org.kodein.di:kodein-di-conf-jvm:7.15.0"
|
||||
|
||||
# tray icon
|
||||
systemtray-core = "com.dorkbox:SystemTray:4.2.1"
|
||||
systemtray-utils = "com.dorkbox:Utilities:1.39" # version locked by SystemTray
|
||||
systemtray-desktop = "com.dorkbox:Desktop:1.0"
|
||||
|
||||
# dependencies of Tachiyomi extensions
|
||||
injekt = "com.github.inorichi.injekt:injekt-core:65b0440"
|
||||
rxjava = "io.reactivex:rxjava:1.3.8"
|
||||
jsoup = "org.jsoup:jsoup:1.15.3"
|
||||
|
||||
# Config
|
||||
config = "com.typesafe:config:1.4.2"
|
||||
config4k = "io.github.config4k:config4k:0.5.0"
|
||||
|
||||
# Sort
|
||||
sort = "com.github.gpanther:java-nat-sort:natural-comparator-1.1"
|
||||
|
||||
# Android stub library
|
||||
android-stubs = "com.github.Suwayomi:android-jar:1.0.0"
|
||||
|
||||
# Asm modificiation
|
||||
asm = "org.ow2.asm:asm:9.4" # version locked by Dex2Jar
|
||||
dex2jar-translator = { module = "com.github.ThexXTURBOXx.dex2jar:dex-translator", version.ref = "dex2jar" }
|
||||
dex2jar-tools = { module = "com.github.ThexXTURBOXx.dex2jar:dex-tools", version.ref = "dex2jar" }
|
||||
|
||||
# APK
|
||||
apk-parser = "net.dongliu:apk-parser:2.6.10"
|
||||
apksig = "com.android.tools.build:apksig:7.2.1"
|
||||
|
||||
# Xml
|
||||
xmlpull = "xmlpull:xmlpull:1.1.3.4a"
|
||||
|
||||
# Disk & File
|
||||
appdirs = "net.harawata:appdirs:1.2.1"
|
||||
zip4j = "net.lingala.zip4j:zip4j:2.11.2"
|
||||
commonscompress = "org.apache.commons:commons-compress:1.23.0"
|
||||
junrar = "com.github.junrar:junrar:7.5.3"
|
||||
|
||||
# CloudflareInterceptor
|
||||
playwright = { module = "com.microsoft.playwright:playwright", version.ref = "playwright" }
|
||||
|
||||
# AES/CBC/PKCS7Padding Cypher provider
|
||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.72"
|
||||
|
||||
# AndroidX annotations
|
||||
android-annotations = "androidx.annotation:annotation:1.5.0"
|
||||
|
||||
# Substitute for duktape-android
|
||||
rhino-runtime = { module = "org.mozilla:rhino-runtime", version.ref = "rhino" } # slimmer version of 'org.mozilla:rhino'
|
||||
rhino-engine = { module = "org.mozilla:rhino-engine", version.ref = "rhino" } # provides the same interface as 'javax.script' a.k.a Nashorn
|
||||
|
||||
# Settings
|
||||
settings-core = { module = "com.russhwolf:multiplatform-settings-jvm", version.ref = "settings" }
|
||||
settings-serialization = { module = "com.russhwolf:multiplatform-settings-serialization-jvm", version.ref = "settings" }
|
||||
|
||||
# ICU4J
|
||||
icu4j = "com.ibm.icu:icu4j:72.1"
|
||||
|
||||
# Image Decoding implementation provider
|
||||
twelvemonkeys-common-lang = { module = "com.twelvemonkeys.common:common-lang", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-common-io = { module = "com.twelvemonkeys.common:common-io", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-common-image = { module = "com.twelvemonkeys.common:common-image", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-core = { module = "com.twelvemonkeys.imageio:imageio-core", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-metadata = { module = "com.twelvemonkeys.imageio:imageio-metadata", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-jpeg = { module = "com.twelvemonkeys.imageio:imageio-jpeg", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-webp = { module = "com.twelvemonkeys.imageio:imageio-webp", version.ref = "twelvemonkeys" }
|
||||
|
||||
# Testing
|
||||
mockk = "io.mockk:mockk:1.13.2"
|
||||
|
||||
[plugins]
|
||||
# Kotlin
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"}
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin"}
|
||||
|
||||
# Linter
|
||||
kotlinter = { id = "org.jmailen.kotlinter", version = "3.12.0"}
|
||||
|
||||
# Build config
|
||||
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "3.1.0"}
|
||||
|
||||
# Download
|
||||
download = { id = "de.undercouch.download", version = "5.3.0"}
|
||||
|
||||
# ShadowJar
|
||||
shadowjar = { id = "com.github.johnrengelman.shadow", version = "7.1.2"}
|
||||
|
||||
[bundles]
|
||||
shared = [
|
||||
"kotlin-stdlib-jdk8",
|
||||
"kotlin-reflect",
|
||||
"coroutines-core",
|
||||
"coroutines-jdk8",
|
||||
"serialization-json",
|
||||
"serialization-protobuf",
|
||||
"kodein",
|
||||
"slf4japi",
|
||||
"logback",
|
||||
"kotlinlogging",
|
||||
"appdirs",
|
||||
"rxjava",
|
||||
"jsoup",
|
||||
"config",
|
||||
"config4k",
|
||||
"dex2jar-translator",
|
||||
"dex2jar-tools",
|
||||
"apk-parser",
|
||||
"jackson-annotations"
|
||||
]
|
||||
|
||||
sharedTest = [
|
||||
"kotlin-test-junit5",
|
||||
"coroutines-test",
|
||||
]
|
||||
|
||||
okhttp = [
|
||||
"okhttp-core",
|
||||
"okhttp-logging",
|
||||
"okhttp-dnsoverhttps",
|
||||
]
|
||||
javalin = [
|
||||
"javalin-core",
|
||||
"javalin-openapi",
|
||||
]
|
||||
jackson = [
|
||||
"jackson-databind",
|
||||
"jackson-kotlin",
|
||||
"jackson-annotations",
|
||||
]
|
||||
exposed = [
|
||||
"exposed-core",
|
||||
"exposed-dao",
|
||||
"exposed-jdbc",
|
||||
"exposed-javatime",
|
||||
]
|
||||
systemtray = [
|
||||
"systemtray-core",
|
||||
"systemtray-utils",
|
||||
"systemtray-desktop"
|
||||
]
|
||||
rhino = [
|
||||
"rhino-runtime",
|
||||
"rhino-engine",
|
||||
]
|
||||
settings = [
|
||||
"settings-core",
|
||||
"settings-serialization",
|
||||
]
|
||||
twelvemonkeys = [
|
||||
"twelvemonkeys-common-lang",
|
||||
"twelvemonkeys-common-io",
|
||||
"twelvemonkeys-common-image",
|
||||
"twelvemonkeys-imageio-core",
|
||||
"twelvemonkeys-imageio-metadata",
|
||||
"twelvemonkeys-imageio-jpeg",
|
||||
"twelvemonkeys-imageio-webp",
|
||||
]
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
16
gradlew
vendored
16
gradlew
vendored
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -32,10 +32,10 @@
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
@@ -205,6 +205,12 @@ set -- \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
|
||||
14
gradlew.bat
vendored
14
gradlew.bat
vendored
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,7 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
318
scripts/bundler.sh
Executable file
318
scripts/bundler.sh
Executable file
@@ -0,0 +1,318 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
main() {
|
||||
POSITIONAL_ARGS=()
|
||||
OUTPUT_DIR=.
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-o|--output-dir)
|
||||
OUTPUT_DIR="$(readlink -e "$2" || exit 1)"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
POSITIONAL_ARGS+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# restore positional parameters
|
||||
set -- "${POSITIONAL_ARGS[@]}"
|
||||
|
||||
OS="$1"
|
||||
PLAYWRIGHT_VERSION="$(cat gradle/libs.versions.toml | grep -oP "playwright = \"\K([0-9\.]*)(?=\")")"
|
||||
PLAYWRIGHT_REVISION="$(curl --silent "https://raw.githubusercontent.com/microsoft/playwright/v$PLAYWRIGHT_VERSION/packages/playwright-core/browsers.json" 2>&1 | grep -ozP "\"name\": \"chromium\",\n *\"revision\": \"\K[0-9]*")"
|
||||
JAR="$(ls server/build/*.jar | tail -n1)"
|
||||
RELEASE_NAME="$(echo "${JAR%.*}" | xargs basename)-$OS"
|
||||
RELEASE_VERSION="$(tmp="${JAR%-*}"; echo "${tmp##*-}" | tr -d v)"
|
||||
#RELEASE_REVISION_NUMBER="$(tmp="${JAR%.*}" && echo "${tmp##*-}" | tr -d r)"
|
||||
local electron_version="v14.0.0"
|
||||
|
||||
# clean temporary directory on function return
|
||||
trap "rm -rf $RELEASE_NAME/" RETURN
|
||||
mkdir "$RELEASE_NAME/"
|
||||
|
||||
case "$OS" in
|
||||
debian-all)
|
||||
RELEASE="$RELEASE_NAME.deb"
|
||||
make_deb_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
linux-assets)
|
||||
RELEASE="$RELEASE_NAME.tar.gz"
|
||||
copy_linux_package_assets_to "$RELEASE_NAME/"
|
||||
tar -I "gzip -9" -cvf "$RELEASE" "$RELEASE_NAME/"
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
linux-x64)
|
||||
JRE="OpenJDK8U-jre_x64_linux_hotspot_8u302b08.tar.gz"
|
||||
JRE_RELEASE="jdk8u302-b08"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-linux-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
PLAYWRIGHT_PLATFORM="linux"
|
||||
setup_playwright
|
||||
|
||||
RELEASE="$RELEASE_NAME.tar.gz"
|
||||
make_linux_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
macOS-x64)
|
||||
JRE="OpenJDK8U-jre_x64_mac_hotspot_8u302b08.tar.gz"
|
||||
JRE_RELEASE="jdk8u302-b08"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-darwin-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
PLAYWRIGHT_PLATFORM="mac"
|
||||
setup_playwright
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_macos_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
macOS-arm64)
|
||||
JRE="zulu8.56.0.23-ca-jre8.0.302-macosx_aarch64.tar.gz"
|
||||
JRE_RELEASE="zulu8.56.0.23-ca-jre8.0.302-macosx_aarch64"
|
||||
JRE_DIR="$JRE_RELEASE/zulu-8.jre"
|
||||
JRE_URL="https://cdn.azul.com/zulu/bin/$JRE"
|
||||
ELECTRON="electron-$electron_version-darwin-arm64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
PLAYWRIGHT_PLATFORM="mac-arm64"
|
||||
setup_playwright
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_macos_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
windows-x86)
|
||||
JRE="OpenJDK8U-jre_x86-32_windows_hotspot_8u292b10.zip"
|
||||
JRE_RELEASE="jdk8u292-b10"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-win32-ia32.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
PLAYWRIGHT_PLATFORM="win64"
|
||||
setup_playwright
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_windows_bundle
|
||||
move_release_to_output_dir
|
||||
|
||||
RELEASE="$RELEASE_NAME.msi"
|
||||
make_windows_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
windows-x64)
|
||||
JRE="OpenJDK8U-jre_x64_windows_hotspot_8u302b08.zip"
|
||||
JRE_RELEASE="jdk8u302-b08"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-win32-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
PLAYWRIGHT_PLATFORM="win64"
|
||||
setup_playwright
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_windows_bundle
|
||||
move_release_to_output_dir
|
||||
|
||||
RELEASE="$RELEASE_NAME.msi"
|
||||
make_windows_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
*)
|
||||
error $LINENO "Unsupported operating system: $OS" 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
move_release_to_output_dir() {
|
||||
# clean up from possible previous runs
|
||||
if [ -f "$OUTPUT_DIR/$RELEASE" ]; then
|
||||
rm "$OUTPUT_DIR/$RELEASE"
|
||||
fi
|
||||
mv "$RELEASE" "$OUTPUT_DIR/"
|
||||
}
|
||||
|
||||
download_jre_and_electron() {
|
||||
if [ ! -f "$JRE" ]; then
|
||||
curl -L "$JRE_URL" -o "$JRE"
|
||||
fi
|
||||
if [ ! -f "$ELECTRON" ]; then
|
||||
curl -L "$ELECTRON_URL" -o "$ELECTRON"
|
||||
fi
|
||||
|
||||
local ext="${JRE##*.}"
|
||||
if [ "$ext" = "zip" ]; then
|
||||
unzip "$JRE"
|
||||
else
|
||||
tar xvf "$JRE"
|
||||
fi
|
||||
mv "$JRE_DIR" "$RELEASE_NAME/jre"
|
||||
unzip "$ELECTRON" -d "$RELEASE_NAME/electron/"
|
||||
tree
|
||||
}
|
||||
|
||||
copy_linux_package_assets_to() {
|
||||
local output_dir
|
||||
output_dir="$(readlink -e "$1" || exit 1)"
|
||||
|
||||
cp "scripts/resources/pkg/tachidesk-server-browser-launcher.sh" "$output_dir/"
|
||||
cp "scripts/resources/pkg/tachidesk-server-debug-launcher.sh" "$output_dir/"
|
||||
cp "scripts/resources/pkg/tachidesk-server-electron-launcher.sh" "$output_dir/"
|
||||
cp "scripts/resources/pkg/tachidesk-server.desktop" "$output_dir/"
|
||||
cp "scripts/resources/pkg/systemd"/* "$output_dir/"
|
||||
cp "server/src/main/resources/icon/faviconlogo.png" \
|
||||
"$output_dir/tachidesk-server.png"
|
||||
}
|
||||
|
||||
make_linux_bundle() {
|
||||
cp "$JAR" "$RELEASE_NAME/Tachidesk-Server.jar"
|
||||
cp "scripts/resources/tachidesk-server-browser-launcher.sh" "$RELEASE_NAME/"
|
||||
cp "scripts/resources/tachidesk-server-debug-launcher.sh" "$RELEASE_NAME/"
|
||||
cp "scripts/resources/tachidesk-server-electron-launcher.sh" "$RELEASE_NAME/"
|
||||
|
||||
tar -I "gzip -9" -cvf "$RELEASE" "$RELEASE_NAME/"
|
||||
}
|
||||
|
||||
make_macos_bundle() {
|
||||
cp "$JAR" "$RELEASE_NAME/Tachidesk-Server.jar"
|
||||
cp "scripts/resources/Tachidesk Browser Launcher.command" "$RELEASE_NAME/"
|
||||
cp "scripts/resources/Tachidesk Debug Launcher.command" "$RELEASE_NAME/"
|
||||
cp "scripts/resources/Tachidesk Electron Launcher.command" "$RELEASE_NAME/"
|
||||
|
||||
zip -9 -r "$RELEASE" "$RELEASE_NAME/"
|
||||
}
|
||||
|
||||
# https://wiki.debian.org/SimplePackagingTutorial
|
||||
# https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf
|
||||
make_deb_package() {
|
||||
#behind $RELEASE_VERSION is hyphen "-"
|
||||
local source_dir="tachidesk-server-$RELEASE_VERSION"
|
||||
#behind $RELEASE_VERSION is underscore "_"
|
||||
local upstream_source="tachidesk-server_$RELEASE_VERSION.orig.tar.gz"
|
||||
|
||||
mkdir "$RELEASE_NAME/$source_dir/"
|
||||
cp "$JAR" "$RELEASE_NAME/$source_dir/Tachidesk-Server.jar"
|
||||
copy_linux_package_assets_to "$RELEASE_NAME/$source_dir/"
|
||||
tar -I "gzip" -C "$RELEASE_NAME/" -cvf "$upstream_source" "$source_dir"
|
||||
|
||||
cp -r "scripts/resources/deb/" "$RELEASE_NAME/$source_dir/debian/"
|
||||
sed -i "s/\$pkgver/$RELEASE_VERSION/" "$RELEASE_NAME/$source_dir/debian/changelog"
|
||||
sed -i "s/\$pkgrel/1/" "$RELEASE_NAME/$source_dir/debian/changelog"
|
||||
|
||||
sudo apt install devscripts build-essential dh-exec
|
||||
cd "$RELEASE_NAME/$source_dir/"
|
||||
dpkg-buildpackage --no-sign --build=all
|
||||
cd -
|
||||
|
||||
local deb="tachidesk-server_$RELEASE_VERSION-1_all.deb"
|
||||
mv "$RELEASE_NAME/$deb" "$RELEASE"
|
||||
}
|
||||
|
||||
make_windows_bundle() {
|
||||
## I disabled this section until someone find a solution to this error:
|
||||
##E: Unable to correct problems, you have held broken packages.
|
||||
##./bundler.sh: line 250: wine: command not found
|
||||
|
||||
## check if running under github actions
|
||||
#if [ "$CI" = true ]; then
|
||||
## change electron executable's icon
|
||||
#sudo dpkg --add-architecture i386
|
||||
#wget -qO - https://dl.winehq.org/wine-builds/winehq.key \
|
||||
#| sudo apt-key add -
|
||||
#sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
|
||||
#sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu \
|
||||
#$(lsb_release -cs) main"
|
||||
#sudo apt install --install-recommends winehq-stable
|
||||
#fi
|
||||
## this script assumes that wine is installed here on out
|
||||
|
||||
#local rcedit="rcedit-x85.exe"
|
||||
#local rcedit_url="https://github.com/electron/rcedit/releases/download/v0.1.1/$rcedit"
|
||||
## change electron's icon
|
||||
#if [ ! -f "$rcedit" ]; then
|
||||
#curl -L "$rcedit_url" -o "$rcedit"
|
||||
#fi
|
||||
|
||||
#local icon="server/src/main/resources/icon/faviconlogo.ico"
|
||||
#WINEARCH=win32 wine "$rcedit" "$RELEASE_NAME/electron/electron.exe" \
|
||||
# --set-icon "$icon"
|
||||
|
||||
cp "$JAR" "$RELEASE_NAME/Tachidesk-Server.jar"
|
||||
cp "scripts/resources/Tachidesk Browser Launcher.bat" "$RELEASE_NAME"
|
||||
cp "scripts/resources/Tachidesk Debug Launcher.bat" "$RELEASE_NAME"
|
||||
cp "scripts/resources/Tachidesk Electron Launcher.bat" "$RELEASE_NAME"
|
||||
|
||||
zip -9 -r "$RELEASE" "$RELEASE_NAME"
|
||||
}
|
||||
|
||||
make_windows_package() {
|
||||
if [ "$CI" = true ]; then
|
||||
sudo apt install -y wixl
|
||||
fi
|
||||
|
||||
find "$RELEASE_NAME/jre" \
|
||||
| wixl-heat --var var.SourceDir -p "$RELEASE_NAME/" \
|
||||
--directory-ref jre --component-group jre >"$RELEASE_NAME/jre.wxs"
|
||||
find "$RELEASE_NAME/electron" \
|
||||
| wixl-heat --var var.SourceDir -p "$RELEASE_NAME/" \
|
||||
--directory-ref electron --component-group electron >"$RELEASE_NAME/electron.wxs"
|
||||
|
||||
local icon="server/src/main/resources/icon/faviconlogo.ico"
|
||||
local arch=${OS##*-}
|
||||
|
||||
wixl -D ProductVersion="$RELEASE_VERSION" -D SourceDir="$RELEASE_NAME" \
|
||||
-D Icon="$icon" --arch "$arch" "scripts/resources/msi/tachidesk-server-$arch.wxs" \
|
||||
"$RELEASE_NAME/jre.wxs" "$RELEASE_NAME/electron.wxs" -o "$RELEASE"
|
||||
}
|
||||
|
||||
setup_playwright() {
|
||||
mkdir "$RELEASE_NAME/bin"
|
||||
curl -L "https://playwright.azureedge.net/builds/chromium/$PLAYWRIGHT_REVISION/chromium-$PLAYWRIGHT_PLATFORM.zip" -o "$RELEASE_NAME/bin/chromium.zip"
|
||||
}
|
||||
|
||||
# Error handler
|
||||
# set -u: Treat unset variables as an error when substituting.
|
||||
# set -o pipefail: Prevents errors in pipeline from being masked.
|
||||
# set -e: Immediatly exit if any command has a non-zero exit status.
|
||||
# set -E: Inherit the trap ERR function before exiting by set.
|
||||
#
|
||||
# set -e is not recommended and unpredictable.
|
||||
# see https://stackoverflow.com/questions/64786/error-handling-in-bash
|
||||
# and http://mywiki.wooledge.org/BashFAO/105
|
||||
set -uo pipefail
|
||||
error() {
|
||||
local parent_lineno="$1"
|
||||
local message="$2"
|
||||
local code="${3:-1}"
|
||||
if [ -z "$message" ]; then
|
||||
echo "$0: line $parent_lineno: exiting with status $code"
|
||||
else
|
||||
echo "$0: line $parent_lineno: $message: exiting with status $code"
|
||||
fi
|
||||
exit "$code"
|
||||
}
|
||||
trap 'error $LINENO ""' ERR
|
||||
|
||||
main "$@"; exit
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
echo "creating debian package"
|
||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
||||
release_ver=$(tmp="${jar%-*}" && echo "${tmp##*-}" | tr -d v)
|
||||
orig_dir="tachidesk-$release_ver" # dir uses hyphen "-"
|
||||
orig_tar_gz="tachidesk_$release_ver.orig.tar.gz" # orig file uses underscore "_"
|
||||
package_name="tachidesk_$release_ver-1_all.deb"
|
||||
|
||||
# copy artifacts
|
||||
mkdir "$orig_dir"
|
||||
cp "$jar" "$orig_dir/Tachidesk.jar"
|
||||
cp -r "resources/debian" "$orig_dir"
|
||||
cp "resources/tachidesk-browser-launcher-standalone.sh" "$orig_dir/debian"
|
||||
cp "resources/tachidesk-debug-launcher-standalone.sh" "$orig_dir/debian"
|
||||
cp "resources/tachidesk-electron-launcher-standalone.sh" "$orig_dir/debian"
|
||||
cp "resources/tachidesk.desktop" "$orig_dir/debian"
|
||||
cp "../server/src/main/resources/icon/faviconlogo.png" "$orig_dir/debian/tachidesk.png"
|
||||
|
||||
# prepare
|
||||
tar cvzf "$orig_tar_gz" "$orig_dir/Tachidesk.jar"
|
||||
sed -i "s/\${version}/$release_ver/" "$orig_dir/debian/changelog"
|
||||
|
||||
# build
|
||||
mkdir "build"
|
||||
mv $orig_dir $orig_tar_gz "build/"
|
||||
cd "build/$orig_dir/debian"
|
||||
sudo apt install devscripts build-essential dh-exec
|
||||
# --lintian-opts --profile debian: build Debian packages on Ubuntu
|
||||
debuild -uc -us --lintian-opts --profile debian
|
||||
cd -
|
||||
|
||||
# clean build directory
|
||||
mv "build/$package_name" "./"
|
||||
rm -rf "build"
|
||||
|
||||
# clean up from possible previous runs
|
||||
if [ -f "../server/build/$package_name" ]; then
|
||||
rm "../server/build/$package_name"
|
||||
fi
|
||||
|
||||
mv "$package_name" "../server/build/"
|
||||
@@ -1 +1 @@
|
||||
start "" jre/bin/javaw -jar Tachidesk.jar
|
||||
start "" jre/bin/javaw -jar Tachidesk-Server.jar
|
||||
@@ -1,3 +1,3 @@
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
./jre/Contents/Home/bin/java -jar Tachidesk.jar
|
||||
./jre/Contents/Home/bin/java -jar Tachidesk-Server.jar
|
||||
@@ -1,7 +1,7 @@
|
||||
:: cleaner output
|
||||
@echo off
|
||||
|
||||
jre\bin\java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
||||
jre\bin\java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk-Server.jar
|
||||
|
||||
:: Prevent cmd from closing when Tachidesk crashes
|
||||
pause
|
||||
@@ -1,3 +1,3 @@
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
./jre/Contents/Home/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
||||
./jre/Contents/Home/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk-Server.jar
|
||||
|
||||
@@ -1 +1 @@
|
||||
jre\bin\javaw "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron.exe" -jar Tachidesk.jar
|
||||
jre\bin\javaw "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron.exe" -jar Tachidesk-Server.jar
|
||||
@@ -1,3 +1,3 @@
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
./jre/Contents/Home/bin/java "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/Electron.app/Contents/MacOS/Electron" -jar Tachidesk.jar
|
||||
./jre/Contents/Home/bin/java "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/Electron.app/Contents/MacOS/Electron" -jar Tachidesk-Server.jar
|
||||
5
scripts/resources/deb/changelog
Normal file
5
scripts/resources/deb/changelog
Normal file
@@ -0,0 +1,5 @@
|
||||
tachidesk-server ($pkgver-$pkgrel) unstable; urgency=medium
|
||||
|
||||
* See CHANGELOG.md on https://github.com/Suwayomi/Tachidesk-Server
|
||||
|
||||
-- Mahor1221 <mahor1221@pm.me> Fri, 14 Jan 2022 00:00:00 +0000
|
||||
10
scripts/resources/debian/control → scripts/resources/deb/control
Executable file → Normal file
10
scripts/resources/debian/control → scripts/resources/deb/control
Executable file → Normal file
@@ -1,14 +1,14 @@
|
||||
Source: tachidesk
|
||||
Source: tachidesk-server
|
||||
Section: web
|
||||
Priority: optional
|
||||
Maintainer: Mahor Foruzesh <mahorforuzesh@pm.me>
|
||||
Build-Depends: debhelper-compat (= 12), dh-exec
|
||||
Maintainer: Mahor1221 <mahor1221@pm.me>
|
||||
Build-Depends: debhelper-compat (= 13), dh-exec
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: https://github.com/Suwayomi/Tachidesk-Server
|
||||
|
||||
Package: tachidesk
|
||||
Package: tachidesk-server
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, default-jre-headless (>= 8)
|
||||
Depends: ${misc:Depends}, java8-runtime-headless, libc++-dev
|
||||
Description: Manga Reader
|
||||
A free and open source manga reader server that runs extensions built for Tachiyomi.
|
||||
Tachidesk is an independent Tachiyomi compatible software and is not a Fork of Tachiyomi.
|
||||
2
scripts/resources/debian/copyright → scripts/resources/deb/copyright
Executable file → Normal file
2
scripts/resources/debian/copyright → scripts/resources/deb/copyright
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: tachidesk
|
||||
Upstream-Name: tachidesk-server
|
||||
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
||||
Source: https://github.com/Suwayomi/Tachidesk-Server
|
||||
|
||||
12
scripts/resources/deb/install
Executable file
12
scripts/resources/deb/install
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/dh-exec
|
||||
|
||||
Tachidesk-Server.jar usr/share/java/tachidesk-server/
|
||||
tachidesk-server.png usr/share/pixmaps/
|
||||
tachidesk-server.desktop usr/share/applications/
|
||||
tachidesk-server.service usr/lib/systemd/system/
|
||||
tachidesk-server.sysusers => usr/lib/sysusers.d/tachidesk-server.conf
|
||||
tachidesk-server.tmpfiles => usr/lib/tmpfiles.d/tachidesk-server.conf
|
||||
tachidesk-server.conf => etc/tachidesk/server.conf
|
||||
tachidesk-server-browser-launcher.sh => usr/bin/tachidesk-server-browser
|
||||
tachidesk-server-debug-launcher.sh => usr/bin/tachidesk-server-debug
|
||||
tachidesk-server-electron-launcher.sh => usr/bin/tachidesk-server-electron
|
||||
0
scripts/resources/debian/source/format → scripts/resources/deb/source/format
Executable file → Normal file
0
scripts/resources/debian/source/format → scripts/resources/deb/source/format
Executable file → Normal file
1
scripts/resources/deb/source/include-binaries
Normal file
1
scripts/resources/deb/source/include-binaries
Normal file
@@ -0,0 +1 @@
|
||||
tachidesk-server.png
|
||||
@@ -1,5 +0,0 @@
|
||||
tachidesk (${version}-1) unstable; urgency=medium
|
||||
|
||||
* See CHANGELOG.md on https://github.com/Suwayomi/Tachidesk-Server
|
||||
|
||||
-- Mahor Foruzesh <mahorforuzesh@pm.me> Fri, 14 Jan 2022 00:00:00 +0000
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/dh-exec
|
||||
|
||||
debian/tachidesk-browser-launcher-standalone.sh => usr/bin/tachidesk
|
||||
debian/tachidesk-browser-launcher-standalone.sh => usr/bin/tachidesk-browser
|
||||
debian/tachidesk-debug-launcher-standalone.sh => usr/bin/tachidesk-debug
|
||||
debian/tachidesk-electron-launcher-standalone.sh => usr/bin/tachidesk-electron
|
||||
Tachidesk.jar => usr/share/java/tachidesk/tachidesk.jar
|
||||
debian/tachidesk.png usr/share/pixmaps/
|
||||
debian/tachidesk.desktop usr/share/applications/
|
||||
@@ -1 +0,0 @@
|
||||
debian/tachidesk.png
|
||||
@@ -31,7 +31,7 @@
|
||||
<!-- Component -->
|
||||
<DirectoryRef Id="INSTALLDIR">
|
||||
<Component Id="TachideskJAR" Guid="*" Win64="yes">
|
||||
<File Id="Tachidesk.jar" Source="$(var.SourceDir)/Tachidesk.jar" KeyPath="yes" />
|
||||
<File Id="Tachidesk-Server.jar" Source="$(var.SourceDir)/Tachidesk-Server.jar" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="TachideskBrowserBAT" Guid="*" Win64="yes">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<!-- Component -->
|
||||
<DirectoryRef Id="INSTALLDIR">
|
||||
<Component Id="TachideskJAR" Guid="*">
|
||||
<File Id="Tachidesk.jar" Source="$(var.SourceDir)/Tachidesk.jar" KeyPath="yes" />
|
||||
<File Id="Tachidesk-Server.jar" Source="$(var.SourceDir)/Tachidesk-Server.jar" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="TachideskBrowserBAT" Guid="*">
|
||||
|
||||
5
scripts/resources/pkg/systemd/tachidesk-server.conf
Normal file
5
scripts/resources/pkg/systemd/tachidesk-server.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
TACHIDESK_ROOT_DIR="/var/lib/tachidesk"
|
||||
|
||||
# Extra arguments passed to the java command
|
||||
# The default value disables the system tray icon, and launching a browser on service start.
|
||||
JAVA_ARGS=-Dsuwayomi.tachidesk.config.server.initialOpenInBrowserEnabled=false -Dsuwayomi.tachidesk.config.server.systemTrayEnabled=false
|
||||
31
scripts/resources/pkg/systemd/tachidesk-server.service
Normal file
31
scripts/resources/pkg/systemd/tachidesk-server.service
Normal file
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=A free and open source manga reader server that runs extensions built for Tachiyomi.
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=tachidesk
|
||||
Group=tachidesk
|
||||
SyslogIdentifier=tachidesk
|
||||
|
||||
EnvironmentFile=/etc/tachidesk/server.conf
|
||||
ExecStart=/usr/bin/java $JAVA_ARGS -Dsuwayomi.tachidesk.config.server.rootDir="${TACHIDESK_ROOT_DIR}" -jar /usr/share/java/tachidesk-server/Tachidesk-Server.jar
|
||||
Restart=on-failure
|
||||
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
ProtectClock=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelLogs=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictSUIDSGID=yes
|
||||
RestrictRealtime=yes
|
||||
RestrictNamespaces=yes
|
||||
NoNewPrivileges=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
2
scripts/resources/pkg/systemd/tachidesk-server.sysusers
Normal file
2
scripts/resources/pkg/systemd/tachidesk-server.sysusers
Normal file
@@ -0,0 +1,2 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
u tachidesk - "Tachidesk Manga Server" /var/lib/tachidesk
|
||||
2
scripts/resources/pkg/systemd/tachidesk-server.tmpfiles
Normal file
2
scripts/resources/pkg/systemd/tachidesk-server.tmpfiles
Normal file
@@ -0,0 +1,2 @@
|
||||
#Type Path Mode User Group Age Argument
|
||||
d /var/lib/tachidesk 0755 tachidesk tachidesk
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /usr/bin/java -jar /usr/share/java/tachidesk-server/Tachidesk-Server.jar
|
||||
5
scripts/resources/pkg/tachidesk-server-debug-launcher.sh
Normal file
5
scripts/resources/pkg/tachidesk-server-debug-launcher.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /usr/bin/java \
|
||||
-Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true \
|
||||
-jar /usr/share/java/tachidesk-server/Tachidesk-Server.jar
|
||||
12
scripts/resources/pkg/tachidesk-server-electron-launcher.sh
Normal file
12
scripts/resources/pkg/tachidesk-server-electron-launcher.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f /usr/bin/electron ]; then
|
||||
echo "Electron executable was not found!
|
||||
In order to run this launcher, you need Electron installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec /usr/bin/java \
|
||||
-Dsuwayomi.tachidesk.config.server.webUIInterface=electron \
|
||||
-Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron \
|
||||
-jar /usr/share/java/tachidesk-server/Tachidesk-Server.jar
|
||||
8
scripts/resources/pkg/tachidesk-server.desktop
Normal file
8
scripts/resources/pkg/tachidesk-server.desktop
Normal file
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Tachidesk-Server
|
||||
Comment=Manga Reader
|
||||
Exec=/usr/bin/java -jar /usr/share/java/tachidesk-server/Tachidesk-Server.jar "\\$@"
|
||||
Icon=tachidesk-server
|
||||
Terminal=false
|
||||
Categories=Network;
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec /usr/bin/java -jar /usr/share/java/tachidesk/tachidesk.jar
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
./jre/bin/java -jar Tachidesk.jar
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar /usr/share/java/tachidesk/tachidesk.jar
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
./jre/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -f /usr/bin/electron ]; then
|
||||
echo "Electron executable was not found!
|
||||
In order to run this launcher, you need Electron installed.
|
||||
|
||||
You can install it with these commands:
|
||||
sudo apt install npm
|
||||
sudo npm install electron -g
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec /usr/bin/java -Dsuwayomi.tachidesk.config.server.webUIInterface=electron -Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron -jar /usr/share/java/tachidesk/tachidesk.jar
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
./jre/bin/java "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron" -jar Tachidesk.jar
|
||||
3
scripts/resources/tachidesk-server-browser-launcher.sh
Normal file
3
scripts/resources/tachidesk-server-browser-launcher.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec ./jre/bin/java -jar ./Tachidesk-Server.jar
|
||||
5
scripts/resources/tachidesk-server-debug-launcher.sh
Normal file
5
scripts/resources/tachidesk-server-debug-launcher.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec ./jre/bin/java \
|
||||
-Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true \
|
||||
-jar ./Tachidesk-Server.jar
|
||||
6
scripts/resources/tachidesk-server-electron-launcher.sh
Normal file
6
scripts/resources/tachidesk-server-electron-launcher.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec ./jre/bin/java \
|
||||
-Dsuwayomi.tachidesk.config.server.webUIInterface=electron \
|
||||
-Dsuwayomi.tachidesk.config.server.electronPath=./electron/electron \
|
||||
-jar ./Tachidesk-Server.jar
|
||||
@@ -1,8 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Tachidesk
|
||||
Comment=Manga Reader
|
||||
Exec=/usr/bin/java -jar /usr/share/java/tachidesk/tachidesk.jar "\\$@"
|
||||
Icon=tachidesk
|
||||
Terminal=false
|
||||
Categories=Network;
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
electron_version="v14.0.0"
|
||||
|
||||
if [ $1 = "linux-x64" ]; then
|
||||
jre="OpenJDK8U-jre_x64_linux_hotspot_8u302b08.tar.gz"
|
||||
jre_release="jdk8u302-b08"
|
||||
jre_url="https://github.com/adoptium/temurin8-binaries/releases/download/$jre_release/$jre"
|
||||
jre_dir="$jre_release-jre"
|
||||
electron="electron-$electron_version-linux-x64.zip"
|
||||
elif [ $1 = "macOS-x64" ]; then
|
||||
jre="OpenJDK8U-jre_x64_mac_hotspot_8u302b08.tar.gz"
|
||||
jre_release="jdk8u302-b08"
|
||||
jre_url="https://github.com/adoptium/temurin8-binaries/releases/download/$jre_release/$jre"
|
||||
jre_dir="$jre_release-jre"
|
||||
electron="electron-$electron_version-darwin-x64.zip"
|
||||
elif [ $1 = "macOS-arm64" ]; then
|
||||
jre="zulu8.56.0.23-ca-jre8.0.302-macosx_aarch64.tar.gz"
|
||||
jre_release="zulu8.56.0.23-ca-jre8.0.302-macosx_aarch64"
|
||||
jre_url="https://cdn.azul.com/zulu/bin/$jre"
|
||||
jre_dir="$jre_release/zulu-8.jre"
|
||||
electron="electron-$electron_version-darwin-arm64.zip"
|
||||
else
|
||||
echo "Unsupported arch value: $1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
arch="$1"
|
||||
os=$(echo $arch | cut -d '-' -f1)
|
||||
|
||||
echo "creating $arch bundle"
|
||||
|
||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
||||
jar_name=$(echo $jar | cut -d'/' -f4)
|
||||
release_name=$(echo $jar_name | sed 's/.jar//')-$arch
|
||||
|
||||
# make release dir
|
||||
mkdir $release_name
|
||||
|
||||
echo "Dealing with jre..."
|
||||
if [ ! -f $jre ]; then
|
||||
curl -L $jre_url -o $jre
|
||||
fi
|
||||
tar xvf $jre
|
||||
mv $jre_dir $release_name/jre
|
||||
|
||||
echo "Dealing with electron"
|
||||
if [ ! -f $electron ]; then
|
||||
curl -L "https://github.com/electron/electron/releases/download/$electron_version/$electron" -o $electron
|
||||
fi
|
||||
unzip $electron -d $release_name/electron
|
||||
|
||||
# copy artifacts
|
||||
cp $jar $release_name/Tachidesk.jar
|
||||
if [ $os = linux ]; then
|
||||
cp "resources/tachidesk-browser-launcher.sh" $release_name
|
||||
cp "resources/tachidesk-debug-launcher.sh" $release_name
|
||||
cp "resources/tachidesk-electron-launcher.sh" $release_name
|
||||
elif [ $os = macOS ]; then
|
||||
cp "resources/Tachidesk Browser Launcher.command" $release_name
|
||||
cp "resources/Tachidesk Debug Launcher.command" $release_name
|
||||
cp "resources/Tachidesk Electron Launcher.command" $release_name
|
||||
fi
|
||||
|
||||
archive_name=""
|
||||
if [ $os = linux ]; then
|
||||
archive_name=$release_name.tar.gz
|
||||
GZIP=-9 tar cvzf $archive_name $release_name
|
||||
elif [ $os = macOS ]; then
|
||||
archive_name=$release_name.zip
|
||||
zip -9 -r $archive_name $release_name
|
||||
fi
|
||||
|
||||
rm -rf $release_name
|
||||
|
||||
# clean up from possible previous runs
|
||||
if [ -f ../server/build/$archive_name ]; then
|
||||
rm ../server/build/$archive_name
|
||||
fi
|
||||
|
||||
mv $archive_name ../server/build/
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
electron_version="v14.0.0"
|
||||
arch=$1
|
||||
if [ $arch = "win32" ]; then
|
||||
jre="OpenJDK8U-jre_x86-32_windows_hotspot_8u292b10.zip"
|
||||
jre_release="jdk8u292-b10"
|
||||
jre_url="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/$jre_release/$jre"
|
||||
arch="windows-x86"
|
||||
electron="electron-$electron_version-win32-ia32.zip"
|
||||
else
|
||||
jre="OpenJDK8U-jre_x64_windows_hotspot_8u302b08.zip"
|
||||
jre_release="jdk8u302-b08"
|
||||
jre_url="https://github.com/adoptium/temurin8-binaries/releases/download/$jre_release/$jre"
|
||||
arch="windows-x64"
|
||||
electron="electron-$electron_version-win32-x64.zip"
|
||||
fi
|
||||
|
||||
jre_dir="$jre_release-jre"
|
||||
|
||||
echo "creating windows bundle"
|
||||
|
||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
||||
jar_name=$(echo $jar | cut -d'/' -f4)
|
||||
release_name=$(echo $jar_name | sed 's/.jar//')-$arch
|
||||
|
||||
# make release dir
|
||||
mkdir $release_name
|
||||
|
||||
echo "Dealing with jre..."
|
||||
if [ ! -f $jre ]; then
|
||||
curl -L $jre_url -o $jre
|
||||
fi
|
||||
unzip $jre
|
||||
mv $jre_dir $release_name/jre
|
||||
|
||||
echo "Dealing with electron"
|
||||
if [ ! -f $electron ]; then
|
||||
curl -L "https://github.com/electron/electron/releases/download/$electron_version/$electron" -o $electron
|
||||
fi
|
||||
unzip $electron -d $release_name/electron
|
||||
|
||||
# change electron's icon
|
||||
rcedit="rcedit-x86.exe"
|
||||
if [ ! -f $rcedit ]; then
|
||||
curl -L "https://github.com/electron/rcedit/releases/download/v1.1.1/$rcedit" -o $rcedit
|
||||
fi
|
||||
|
||||
# check if running under github actions
|
||||
if [ $CI = true ]; then
|
||||
# change electron executable's icon
|
||||
sudo dpkg --add-architecture i386
|
||||
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
|
||||
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
|
||||
sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu $(lsb_release -cs) main"
|
||||
sudo apt install --install-recommends winehq-stable
|
||||
sudo apt install -y wixl
|
||||
fi
|
||||
# this script assumes that wine is installed here on out
|
||||
|
||||
WINEARCH=win32 wine $rcedit $release_name/electron/electron.exe --set-icon ../server/src/main/resources/icon/faviconlogo.ico
|
||||
|
||||
# copy artifacts
|
||||
cp $jar $release_name/Tachidesk.jar
|
||||
cp "resources/Tachidesk Browser Launcher.bat" $release_name
|
||||
cp "resources/Tachidesk Debug Launcher.bat" $release_name
|
||||
cp "resources/Tachidesk Electron Launcher.bat" $release_name
|
||||
|
||||
zip_name=$release_name.zip
|
||||
zip -9 -r $zip_name $release_name
|
||||
|
||||
# create msi package
|
||||
msi_name=$release_name.msi
|
||||
release_ver=$(tmp=${jar%-*} && echo ${tmp##*-} | tr -d v)
|
||||
icon="../server/src/main/resources/icon/faviconlogo.ico"
|
||||
|
||||
find $release_name/jre | wixl-heat --var var.SourceDir -p $release_name/ --directory-ref jre --component-group jre >jre.wxs
|
||||
find $release_name/electron | wixl-heat --var var.SourceDir -p $release_name/ --directory-ref electron --component-group electron >electron.wxs
|
||||
if [ $arch = "win32" ]; then
|
||||
wixl -D ProductVersion=$release_ver -D SourceDir=$release_name -D Icon=$icon \
|
||||
--arch x86 resources/msi/tachidesk-server-x86.wxs jre.wxs electron.wxs -o $msi_name
|
||||
else
|
||||
wixl -D ProductVersion=$release_ver -D SourceDir=$release_name -D Icon=$icon \
|
||||
--arch x64 resources/msi/tachidesk-server-x64.wxs jre.wxs electron.wxs -o $msi_name
|
||||
fi
|
||||
|
||||
rm -rf $release_name
|
||||
|
||||
# clean up from possible previous runs
|
||||
if [ -f ../server/build/$zip_name ]; then
|
||||
rm ../server/build/$zip_name
|
||||
fi
|
||||
if [ -f ../server/build/$msi_name ]; then
|
||||
rm ../server/build/$msi_name
|
||||
fi
|
||||
|
||||
mv $zip_name ../server/build/
|
||||
mv $msi_name ../server/build/
|
||||
@@ -1,79 +1,81 @@
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import java.time.Instant
|
||||
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.kotlinter.get().pluginId)
|
||||
application
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id("com.github.gmazzo.buildconfig")
|
||||
alias(libs.plugins.shadowjar)
|
||||
id(libs.plugins.buildconfig.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// okhttp
|
||||
val okhttpVersion = "4.9.3" // Major version is locked by Tachiyomi extensions
|
||||
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
|
||||
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
|
||||
implementation("com.squareup.okio:okio:3.0.0")
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
|
||||
// OkHttp
|
||||
implementation(libs.bundles.okhttp)
|
||||
implementation(libs.okio)
|
||||
|
||||
// Javalin api
|
||||
implementation("io.javalin:javalin:4.2.0")
|
||||
implementation("io.javalin:javalin-openapi:4.2.0")
|
||||
// jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||
val jacksonVersion = "2.12.4"
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
|
||||
implementation(libs.bundles.javalin)
|
||||
implementation(libs.bundles.jackson)
|
||||
|
||||
// Exposed ORM
|
||||
val exposedVersion = "0.34.1"
|
||||
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion")
|
||||
// current database driver
|
||||
implementation("com.h2database:h2:1.4.200")
|
||||
implementation(libs.bundles.exposed)
|
||||
implementation(libs.h2)
|
||||
|
||||
// Exposed Migrations
|
||||
implementation("com.github.Suwayomi:exposed-migrations:3.1.4")
|
||||
implementation(libs.exposed.migrations)
|
||||
|
||||
// tray icon
|
||||
implementation("com.dorkbox:SystemTray:4.1")
|
||||
implementation("com.dorkbox:Utilities:1.9") // version locked by SystemTray
|
||||
implementation(libs.bundles.systemtray)
|
||||
|
||||
// dependencies of Tachiyomi extensions, some are duplicate, keeping it here for reference
|
||||
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
|
||||
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
|
||||
implementation("io.reactivex:rxjava:1.3.8")
|
||||
implementation("org.jsoup:jsoup:1.14.3")
|
||||
implementation(libs.injekt)
|
||||
implementation(libs.okhttp.core)
|
||||
implementation(libs.rxjava)
|
||||
implementation(libs.jsoup)
|
||||
|
||||
// Sort
|
||||
implementation("com.github.gpanther:java-nat-sort:natural-comparator-1.1")
|
||||
implementation(libs.sort)
|
||||
|
||||
// asm for ByteCodeEditor(fixing SimpleDateFormat) (must match Dex2Jar version)
|
||||
implementation("org.ow2.asm:asm:9.2")
|
||||
implementation(libs.asm)
|
||||
|
||||
// Disk & File
|
||||
implementation("net.lingala.zip4j:zip4j:2.9.1")
|
||||
implementation("com.github.junrar:junrar:7.4.0")
|
||||
implementation(libs.zip4j)
|
||||
implementation(libs.commonscompress)
|
||||
implementation(libs.junrar)
|
||||
|
||||
// CloudflareInterceptor
|
||||
implementation("net.sourceforge.htmlunit:htmlunit:2.56.0")
|
||||
implementation(libs.playwright)
|
||||
|
||||
// Source models and interfaces from Tachiyomi 1.x
|
||||
// using source class from tachiyomi commit 9493577de27c40ce8b2b6122cc447d025e34c477 to not depend on tachiyomi.sourceapi
|
||||
// implementation("tachiyomi.sourceapi:source-api:1.1")
|
||||
// AES/CBC/PKCS7Padding Cypher provider for zh.copymanga
|
||||
implementation(libs.bouncycastle)
|
||||
|
||||
// AndroidCompat
|
||||
implementation(project(":AndroidCompat"))
|
||||
implementation(project(":AndroidCompat:Config"))
|
||||
implementation(projects.androidCompat)
|
||||
implementation(projects.androidCompat.config)
|
||||
|
||||
// uncomment to test extensions directly
|
||||
// implementation(fileTree("lib/"))
|
||||
implementation(kotlin("script-runtime"))
|
||||
|
||||
testImplementation("io.mockk:mockk:1.12.2")
|
||||
implementation("com.expediagroup:graphql-kotlin-server:6.4.0")
|
||||
implementation("com.expediagroup:graphql-kotlin-schema-generator:6.4.0")
|
||||
implementation("com.graphql-java:graphql-java-extended-scalars:20.0")
|
||||
|
||||
testImplementation(libs.mockk)
|
||||
}
|
||||
|
||||
application {
|
||||
applicationDefaultJvmArgs = listOf(
|
||||
"-Djunrar.extractor.thread-keep-alive-seconds=30"
|
||||
)
|
||||
mainClass.set(MainClass)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package suwayomi.tachidesk.server.util;
|
||||
|
||||
import com.microsoft.playwright.impl.driver.Driver;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Copy of <a href="https://github.com/microsoft/playwright-java/blob/8c0231b0f739656e8a86bc58fca9ee778ddc571b/driver-bundle/src/main/java/com/microsoft/playwright/impl/driver/jar/DriverJar.java">DriverJar</a>
|
||||
* with support for pre-installing chromium and only supports chromium playwright
|
||||
*/
|
||||
public class DriverJar extends Driver {
|
||||
private static final String PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD";
|
||||
private static final String SELENIUM_REMOTE_URL = "SELENIUM_REMOTE_URL";
|
||||
static final String PLAYWRIGHT_NODEJS_PATH = "PLAYWRIGHT_NODEJS_PATH";
|
||||
private final Path driverTempDir;
|
||||
private Path preinstalledNodePath;
|
||||
|
||||
public DriverJar() throws IOException {
|
||||
// Allow specifying custom path for the driver installation
|
||||
// See https://github.com/microsoft/playwright-java/issues/728
|
||||
String alternativeTmpdir = System.getProperty("playwright.driver.tmpdir");
|
||||
String prefix = "playwright-java-";
|
||||
driverTempDir = alternativeTmpdir == null
|
||||
? Files.createTempDirectory(prefix)
|
||||
: Files.createTempDirectory(Paths.get(alternativeTmpdir), prefix);
|
||||
driverTempDir.toFile().deleteOnExit();
|
||||
String nodePath = System.getProperty("playwright.nodejs.path");
|
||||
if (nodePath != null) {
|
||||
preinstalledNodePath = Paths.get(nodePath);
|
||||
if (!Files.exists(preinstalledNodePath)) {
|
||||
throw new RuntimeException("Invalid Node.js path specified: " + nodePath);
|
||||
}
|
||||
}
|
||||
logMessage("created DriverJar: " + driverTempDir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initialize(Boolean installBrowsers) throws Exception {
|
||||
if (preinstalledNodePath == null && env.containsKey(PLAYWRIGHT_NODEJS_PATH)) {
|
||||
preinstalledNodePath = Paths.get(env.get(PLAYWRIGHT_NODEJS_PATH));
|
||||
if (!Files.exists(preinstalledNodePath)) {
|
||||
throw new RuntimeException("Invalid Node.js path specified: " + preinstalledNodePath);
|
||||
}
|
||||
} else if (preinstalledNodePath != null) {
|
||||
// Pass the env variable to the driver process.
|
||||
env.put(PLAYWRIGHT_NODEJS_PATH, preinstalledNodePath.toString());
|
||||
}
|
||||
extractDriverToTempDir();
|
||||
logMessage("extracted driver from jar to " + driverPath());
|
||||
if (installBrowsers)
|
||||
installBrowsers(env);
|
||||
}
|
||||
|
||||
private void installBrowsers(Map<String, String> env) throws IOException, InterruptedException {
|
||||
String skip = env.get(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD);
|
||||
if (skip == null) {
|
||||
skip = System.getenv(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD);
|
||||
}
|
||||
if (skip != null && !"0".equals(skip) && !"false".equals(skip)) {
|
||||
System.out.println("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set");
|
||||
return;
|
||||
}
|
||||
if (env.get(SELENIUM_REMOTE_URL) != null || System.getenv(SELENIUM_REMOTE_URL) != null) {
|
||||
logMessage("Skipping browsers download because `SELENIUM_REMOTE_URL` env variable is set");
|
||||
return;
|
||||
}
|
||||
Chromium.preinstall(platformDir());
|
||||
Path driver = driverPath();
|
||||
if (!Files.exists(driver)) {
|
||||
throw new RuntimeException("Failed to find driver: " + driver);
|
||||
}
|
||||
ProcessBuilder pb = createProcessBuilder();
|
||||
pb.command().add("install");
|
||||
pb.command().add("chromium");
|
||||
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
|
||||
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
|
||||
Process p = pb.start();
|
||||
boolean result = p.waitFor(10, TimeUnit.MINUTES);
|
||||
if (!result) {
|
||||
p.destroy();
|
||||
throw new RuntimeException("Timed out waiting for browsers to install");
|
||||
}
|
||||
if (p.exitValue() != 0) {
|
||||
throw new RuntimeException("Failed to install browsers, exit code: " + p.exitValue());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isExecutable(Path filePath) {
|
||||
String name = filePath.getFileName().toString();
|
||||
return name.endsWith(".sh") || name.endsWith(".exe") || !name.contains(".");
|
||||
}
|
||||
|
||||
private FileSystem initFileSystem(URI uri) throws IOException {
|
||||
try {
|
||||
return FileSystems.newFileSystem(uri, Collections.emptyMap());
|
||||
} catch (FileSystemAlreadyExistsException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static URI getDriverResourceURI() throws URISyntaxException {
|
||||
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
|
||||
return classloader.getResource("driver/" + platformDir()).toURI();
|
||||
}
|
||||
|
||||
void extractDriverToTempDir() throws URISyntaxException, IOException {
|
||||
URI originalUri = getDriverResourceURI();
|
||||
URI uri = maybeExtractNestedJar(originalUri);
|
||||
|
||||
// Create zip filesystem if loading from jar.
|
||||
try (FileSystem fileSystem = "jar".equals(uri.getScheme()) ? initFileSystem(uri) : null) {
|
||||
Path srcRoot = Paths.get(uri);
|
||||
// jar file system's .relativize gives wrong results when used with
|
||||
// spring-boot-maven-plugin, convert to the default filesystem to
|
||||
// have predictable results.
|
||||
// See https://github.com/microsoft/playwright-java/issues/306
|
||||
Path srcRootDefaultFs = Paths.get(srcRoot.toString());
|
||||
Files.walk(srcRoot).forEach(fromPath -> {
|
||||
if (preinstalledNodePath != null) {
|
||||
String fileName = fromPath.getFileName().toString();
|
||||
if ("node.exe".equals(fileName) || "node".equals(fileName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Path relative = srcRootDefaultFs.relativize(Paths.get(fromPath.toString()));
|
||||
Path toPath = driverTempDir.resolve(relative.toString());
|
||||
try {
|
||||
if (Files.isDirectory(fromPath)) {
|
||||
Files.createDirectories(toPath);
|
||||
} else {
|
||||
Files.copy(fromPath, toPath);
|
||||
if (isExecutable(toPath)) {
|
||||
toPath.toFile().setExecutable(true, true);
|
||||
}
|
||||
}
|
||||
toPath.toFile().deleteOnExit();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Failed to extract driver from " + uri + ", full uri: " + originalUri, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private URI maybeExtractNestedJar(final URI uri) throws URISyntaxException {
|
||||
if (!"jar".equals(uri.getScheme())) {
|
||||
return uri;
|
||||
}
|
||||
final String JAR_URL_SEPARATOR = "!/";
|
||||
String[] parts = uri.toString().split("!/");
|
||||
if (parts.length != 3) {
|
||||
return uri;
|
||||
}
|
||||
String innerJar = String.join(JAR_URL_SEPARATOR, parts[0], parts[1]);
|
||||
URI jarUri = new URI(innerJar);
|
||||
try (FileSystem fs = FileSystems.newFileSystem(jarUri, Collections.emptyMap())) {
|
||||
Path fromPath = Paths.get(jarUri);
|
||||
Path toPath = driverTempDir.resolve(fromPath.getFileName().toString());
|
||||
Files.copy(fromPath, toPath);
|
||||
toPath.toFile().deleteOnExit();
|
||||
return new URI("jar:" + toPath.toUri() + JAR_URL_SEPARATOR + parts[2]);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Failed to extract driver's nested .jar from " + jarUri + "; full uri: " + uri, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String platformDir() {
|
||||
String name = System.getProperty("os.name").toLowerCase();
|
||||
String arch = System.getProperty("os.arch").toLowerCase();
|
||||
|
||||
if (name.contains("windows")) {
|
||||
return "win32_x64";
|
||||
}
|
||||
if (name.contains("linux")) {
|
||||
if (arch.equals("aarch64")) {
|
||||
return "linux-arm64";
|
||||
} else {
|
||||
return "linux";
|
||||
}
|
||||
}
|
||||
if (name.contains("mac os x")) {
|
||||
return "mac";
|
||||
}
|
||||
throw new RuntimeException("Unexpected os.name value: " + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Path driverDir() {
|
||||
return driverTempDir;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package eu.kanade.domain.track.service
|
||||
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
// import eu.kanade.tachiyomi.data.track.anilist.Anilist
|
||||
import tachiyomi.core.preference.PreferenceStore
|
||||
|
||||
class TrackPreferences(
|
||||
private val preferenceStore: PreferenceStore
|
||||
) {
|
||||
|
||||
fun trackUsername(sync: TrackService) = preferenceStore.getString(trackUsername(sync.id), "")
|
||||
|
||||
fun trackPassword(sync: TrackService) = preferenceStore.getString(trackPassword(sync.id), "")
|
||||
|
||||
fun setTrackCredentials(sync: TrackService, username: String, password: String) {
|
||||
trackUsername(sync).set(username)
|
||||
trackPassword(sync).set(password)
|
||||
}
|
||||
|
||||
fun trackToken(sync: TrackService) = preferenceStore.getString(trackToken(sync.id), "")
|
||||
|
||||
// fun anilistScoreType() = preferenceStore.getString("anilist_score_type", Anilist.POINT_10)
|
||||
|
||||
fun autoUpdateTrack() = preferenceStore.getBoolean("pref_auto_update_manga_sync_key", true)
|
||||
|
||||
companion object {
|
||||
fun trackUsername(syncId: Long) = "pref_mangasync_username_$syncId"
|
||||
|
||||
private fun trackPassword(syncId: Long) = "pref_mangasync_password_$syncId"
|
||||
|
||||
private fun trackToken(syncId: Long) = "track_token_$syncId"
|
||||
}
|
||||
}
|
||||
14
server/src/main/kotlin/eu/kanade/tachiyomi/AppInfo.kt
Normal file
14
server/src/main/kotlin/eu/kanade/tachiyomi/AppInfo.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package eu.kanade.tachiyomi
|
||||
|
||||
/**
|
||||
* Used by extensions.
|
||||
*
|
||||
* @since extension-lib 1.3
|
||||
*/
|
||||
object AppInfo {
|
||||
/** should be something like 74 */
|
||||
fun getVersionCode() = suwayomi.tachidesk.server.BuildConfig.REVISION.substring(1).toInt()
|
||||
|
||||
/** should be something like "0.13.1" */
|
||||
fun getVersionName() = suwayomi.tachidesk.server.BuildConfig.VERSION.substring(1)
|
||||
}
|
||||
@@ -16,6 +16,7 @@ package eu.kanade.tachiyomi
|
||||
// import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
// import eu.kanade.tachiyomi.extension.ExtensionManager
|
||||
import android.app.Application
|
||||
import eu.kanade.tachiyomi.network.JavaScriptEngine
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import kotlinx.serialization.json.Json
|
||||
import rx.Observable
|
||||
@@ -29,7 +30,6 @@ import uy.kohesive.injekt.api.get
|
||||
class AppModule(val app: Application) : InjektModule {
|
||||
|
||||
override fun InjektRegistrar.registerInjectables() {
|
||||
|
||||
addSingleton(app)
|
||||
|
||||
// addSingletonFactory { PreferencesHelper(app) }
|
||||
@@ -42,6 +42,8 @@ class AppModule(val app: Application) : InjektModule {
|
||||
|
||||
addSingletonFactory { NetworkHelper(app) }
|
||||
|
||||
addSingletonFactory { JavaScriptEngine(app) }
|
||||
|
||||
// addSingletonFactory { SourceManager(app).also { get<ExtensionManager>().init(it) } }
|
||||
//
|
||||
// addSingletonFactory { ExtensionManager(app) }
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package eu.kanade.tachiyomi;
|
||||
|
||||
public class BuildConfig {
|
||||
public static final int VERSION_CODE = -1;
|
||||
public static final String VERSION_NAME = "stub";
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package eu.kanade.tachiyomi.data.database.models
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
interface Track : Serializable {
|
||||
|
||||
var id: Long?
|
||||
|
||||
var manga_id: Long
|
||||
|
||||
var sync_id: Int
|
||||
|
||||
var media_id: Long
|
||||
|
||||
var library_id: Long?
|
||||
|
||||
var title: String
|
||||
|
||||
var last_chapter_read: Float
|
||||
|
||||
var total_chapters: Int
|
||||
|
||||
var score: Float
|
||||
|
||||
var status: Int
|
||||
|
||||
var started_reading_date: Long
|
||||
|
||||
var finished_reading_date: Long
|
||||
|
||||
var tracking_url: String
|
||||
|
||||
fun copyPersonalFrom(other: Track) {
|
||||
last_chapter_read = other.last_chapter_read
|
||||
score = other.score
|
||||
status = other.status
|
||||
started_reading_date = other.started_reading_date
|
||||
finished_reading_date = other.finished_reading_date
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(serviceId: Long): Track = TrackImpl().apply {
|
||||
sync_id = serviceId.toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package eu.kanade.tachiyomi.data.database.models
|
||||
|
||||
class TrackImpl : Track {
|
||||
|
||||
override var id: Long? = null
|
||||
|
||||
override var manga_id: Long = 0
|
||||
|
||||
override var sync_id: Int = 0
|
||||
|
||||
override var media_id: Long = 0
|
||||
|
||||
override var library_id: Long? = null
|
||||
|
||||
override lateinit var title: String
|
||||
|
||||
override var last_chapter_read: Float = 0F
|
||||
|
||||
override var total_chapters: Int = 0
|
||||
|
||||
override var score: Float = 0f
|
||||
|
||||
override var status: Int = 0
|
||||
|
||||
override var started_reading_date: Long = 0
|
||||
|
||||
override var finished_reading_date: Long = 0
|
||||
|
||||
override var tracking_url: String = ""
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package eu.kanade.tachiyomi.data.track
|
||||
|
||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
import tachiyomi.domain.track.model.Track
|
||||
|
||||
/**
|
||||
* An Enhanced Track Service will never prompt the user to match a manga with the remote.
|
||||
* It is expected that such Track Service can only work with specific sources and unique IDs.
|
||||
*/
|
||||
interface EnhancedTrackService {
|
||||
/**
|
||||
* This TrackService will only work with the sources that are accepted by this filter function.
|
||||
*/
|
||||
fun accept(source: Source): Boolean {
|
||||
return source::class.qualifiedName in getAcceptedSources()
|
||||
}
|
||||
|
||||
/**
|
||||
* Fully qualified source classes that this track service is compatible with.
|
||||
*/
|
||||
fun getAcceptedSources(): List<String>
|
||||
|
||||
fun loginNoop()
|
||||
|
||||
/**
|
||||
* match is similar to TrackService.search, but only return zero or one match.
|
||||
*/
|
||||
suspend fun match(manga: Manga): TrackSearch?
|
||||
|
||||
/**
|
||||
* Checks whether the provided source/track/manga triplet is from this TrackService
|
||||
*/
|
||||
fun isTrackFrom(track: Track, manga: Manga, source: Source?): Boolean
|
||||
|
||||
/**
|
||||
* Migrates the given track for the manga to the newSource, if possible
|
||||
*/
|
||||
fun migrateTrack(track: Track, manga: Manga, newSource: Source): Track?
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package eu.kanade.tachiyomi.data.track
|
||||
|
||||
// import eu.kanade.tachiyomi.data.track.anilist.Anilist
|
||||
// import eu.kanade.tachiyomi.data.track.bangumi.Bangumi
|
||||
// import eu.kanade.tachiyomi.data.track.kavita.Kavita
|
||||
// import eu.kanade.tachiyomi.data.track.kitsu.Kitsu
|
||||
// import eu.kanade.tachiyomi.data.track.komga.Komga
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.MangaUpdates
|
||||
// import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList
|
||||
// import eu.kanade.tachiyomi.data.track.shikimori.Shikimori
|
||||
// import eu.kanade.tachiyomi.data.track.suwayomi.Suwayomi
|
||||
|
||||
class TrackManager {
|
||||
|
||||
companion object {
|
||||
const val MYANIMELIST = 1L
|
||||
const val ANILIST = 2L
|
||||
const val KITSU = 3L
|
||||
const val SHIKIMORI = 4L
|
||||
const val BANGUMI = 5L
|
||||
const val KOMGA = 6L
|
||||
const val MANGA_UPDATES = 7L
|
||||
const val KAVITA = 8L
|
||||
const val SUWAYOMI = 9L
|
||||
}
|
||||
|
||||
// val myAnimeList = MyAnimeList(MYANIMELIST)
|
||||
// val aniList = Anilist(ANILIST)
|
||||
// val kitsu = Kitsu(KITSU)
|
||||
// val shikimori = Shikimori(SHIKIMORI)
|
||||
// val bangumi = Bangumi(BANGUMI)
|
||||
// val komga = Komga(KOMGA)
|
||||
val mangaUpdates = MangaUpdates(MANGA_UPDATES)
|
||||
// val kavita = Kavita(KAVITA)
|
||||
// val suwayomi = Suwayomi(SUWAYOMI)
|
||||
|
||||
// val services = listOf(myAnimeList, aniList, kitsu, shikimori, bangumi, komga, mangaUpdates, kavita, suwayomi)
|
||||
val services = listOf(mangaUpdates)
|
||||
|
||||
fun getService(id: Long) = services.find { it.id == id }
|
||||
|
||||
fun hasLoggedServices() = services.any { it.isLogged }
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package eu.kanade.tachiyomi.data.track
|
||||
|
||||
// import androidx.annotation.CallSuper
|
||||
// import androidx.annotation.ColorInt
|
||||
// import androidx.annotation.DrawableRes
|
||||
// import androidx.annotation.StringRes
|
||||
// import eu.kanade.domain.base.BasePreferences
|
||||
// import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay
|
||||
// import eu.kanade.domain.track.model.toDbTrack
|
||||
// import eu.kanade.domain.track.model.toDomainTrack
|
||||
import eu.kanade.domain.track.service.TrackPreferences
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
// import eu.kanade.tachiyomi.util.system.toast
|
||||
// import logcat.LogPriority
|
||||
import okhttp3.OkHttpClient
|
||||
// import tachiyomi.core.util.lang.withIOContext
|
||||
// import tachiyomi.core.util.lang.withUIContext
|
||||
// import tachiyomi.core.util.system.logcat
|
||||
// import tachiyomi.domain.chapter.interactor.GetChapterByMangaId
|
||||
// import tachiyomi.domain.track.interactor.InsertTrack
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import tachiyomi.domain.track.model.Track as DomainTrack
|
||||
|
||||
abstract class TrackService(val id: Long) {
|
||||
|
||||
// val preferences: BasePreferences by injectLazy()
|
||||
val trackPreferences: TrackPreferences by injectLazy()
|
||||
val networkService: NetworkHelper by injectLazy()
|
||||
|
||||
open val client: OkHttpClient
|
||||
get() = networkService.client
|
||||
|
||||
// Name of the manga sync service to display
|
||||
abstract val name: String
|
||||
|
||||
// Application and remote support for reading dates
|
||||
open val supportsReadingDates: Boolean = false
|
||||
|
||||
// @DrawableRes
|
||||
// abstract fun getLogo(): Int
|
||||
|
||||
// @ColorInt
|
||||
// abstract fun getLogoColor(): Int
|
||||
|
||||
abstract fun getStatusList(): List<Int>
|
||||
|
||||
// @StringRes
|
||||
abstract fun getStatus(status: Int): String?
|
||||
|
||||
abstract fun getReadingStatus(): Int
|
||||
|
||||
abstract fun getRereadingStatus(): Int
|
||||
|
||||
abstract fun getCompletionStatus(): Int
|
||||
|
||||
abstract fun getScoreList(): List<String>
|
||||
|
||||
// TODO: Store all scores as 10 point in the future maybe?
|
||||
open fun get10PointScore(track: DomainTrack): Float {
|
||||
return track.score
|
||||
}
|
||||
|
||||
open fun indexToScore(index: Int): Float {
|
||||
return index.toFloat()
|
||||
}
|
||||
|
||||
abstract fun displayScore(track: Track): String
|
||||
|
||||
abstract suspend fun update(track: Track, didReadChapter: Boolean = false): Track
|
||||
|
||||
abstract suspend fun bind(track: Track, hasReadChapters: Boolean = false): Track
|
||||
|
||||
abstract suspend fun search(query: String): List<TrackSearch>
|
||||
|
||||
abstract suspend fun refresh(track: Track): Track
|
||||
|
||||
abstract suspend fun login(username: String, password: String)
|
||||
|
||||
// @CallSuper
|
||||
open fun logout() {
|
||||
trackPreferences.setTrackCredentials(this, "", "")
|
||||
}
|
||||
|
||||
open val isLogged: Boolean
|
||||
get() = getUsername().isNotEmpty() &&
|
||||
getPassword().isNotEmpty()
|
||||
|
||||
fun getUsername() = trackPreferences.trackUsername(this).get()
|
||||
|
||||
fun getPassword() = trackPreferences.trackPassword(this).get()
|
||||
|
||||
fun saveCredentials(username: String, password: String) {
|
||||
trackPreferences.setTrackCredentials(this, username, password)
|
||||
}
|
||||
|
||||
fun withIOContext(body: () -> Unit) { body() }
|
||||
fun withUIContext(body: () -> Unit) { body() }
|
||||
|
||||
fun registerTracking(item: Track, mangaId: Long) {
|
||||
// item.manga_id = mangaId
|
||||
// try {
|
||||
// withIOContext {
|
||||
// val allChapters = Injekt.get<GetChapterByMangaId>().await(mangaId)
|
||||
// val hasReadChapters = allChapters.any { it.read }
|
||||
// bind(item, hasReadChapters)
|
||||
//
|
||||
// val track = item.toDomainTrack(idRequired = false) ?: return@withIOContext
|
||||
//
|
||||
// Injekt.get<InsertTrack>().await(track)
|
||||
//
|
||||
// // Update chapter progress if newer chapters marked read locally
|
||||
// if (hasReadChapters) {
|
||||
// val latestLocalReadChapterNumber = allChapters
|
||||
// .sortedBy { it.chapterNumber }
|
||||
// .takeWhile { it.read }
|
||||
// .lastOrNull()
|
||||
// ?.chapterNumber?.toDouble() ?: -1.0
|
||||
//
|
||||
// if (latestLocalReadChapterNumber > track.lastChapterRead) {
|
||||
// val updatedTrack = track.copy(
|
||||
// lastChapterRead = latestLocalReadChapterNumber
|
||||
// )
|
||||
// setRemoteLastChapterRead(updatedTrack.toDbTrack(), latestLocalReadChapterNumber.toInt())
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (this is EnhancedTrackService) {
|
||||
// // Injekt.get<SyncChaptersWithTrackServiceTwoWay>().await(allChapters, track, this@TrackService)
|
||||
// }
|
||||
// }
|
||||
// } catch (e: Throwable) {
|
||||
// withUIContext {
|
||||
// // Injekt.get<Application>().toast(e.message)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
fun setRemoteStatus(track: Track, status: Int) {
|
||||
track.status = status
|
||||
if (track.status == getCompletionStatus() && track.total_chapters != 0) {
|
||||
track.last_chapter_read = track.total_chapters.toFloat()
|
||||
}
|
||||
withIOContext { updateRemote(track) }
|
||||
}
|
||||
|
||||
fun setRemoteLastChapterRead(track: Track, chapterNumber: Int) {
|
||||
if (track.last_chapter_read == 0F && track.last_chapter_read < chapterNumber && track.status != getRereadingStatus()) {
|
||||
track.status = getReadingStatus()
|
||||
}
|
||||
track.last_chapter_read = chapterNumber.toFloat()
|
||||
if (track.total_chapters != 0 && track.last_chapter_read.toInt() == track.total_chapters) {
|
||||
track.status = getCompletionStatus()
|
||||
}
|
||||
withIOContext { updateRemote(track) }
|
||||
}
|
||||
|
||||
fun setRemoteScore(track: Track, scoreString: String) {
|
||||
track.score = indexToScore(getScoreList().indexOf(scoreString))
|
||||
withIOContext { updateRemote(track) }
|
||||
}
|
||||
|
||||
fun setRemoteStartDate(track: Track, epochMillis: Long) {
|
||||
track.started_reading_date = epochMillis
|
||||
withIOContext { updateRemote(track) }
|
||||
}
|
||||
|
||||
fun setRemoteFinishDate(track: Track, epochMillis: Long) {
|
||||
track.finished_reading_date = epochMillis
|
||||
withIOContext { updateRemote(track) }
|
||||
}
|
||||
|
||||
private fun updateRemote(track: Track) {
|
||||
// withIOContext {
|
||||
// try {
|
||||
// update(track)
|
||||
// track.toDomainTrack(idRequired = false)?.let {
|
||||
// Injekt.get<InsertTrack>().await(it)
|
||||
// }
|
||||
// } catch (e: Exception) {
|
||||
// logcat(LogPriority.ERROR, e) { "Failed to update remote track data id=$id" }
|
||||
// withUIContext { Injekt.get<Application>().toast(e.message) }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates
|
||||
|
||||
// import android.graphics.Color
|
||||
// import androidx.annotation.StringRes
|
||||
// import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import eu.kanade.tachiyomi.data.track.TrackService
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.copyTo
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.toTrackSearch
|
||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
|
||||
class MangaUpdates(id: Long) : TrackService(id) {
|
||||
|
||||
companion object {
|
||||
const val READING_LIST = 0
|
||||
const val WISH_LIST = 1
|
||||
const val COMPLETE_LIST = 2
|
||||
const val UNFINISHED_LIST = 3
|
||||
const val ON_HOLD_LIST = 4
|
||||
}
|
||||
|
||||
private val interceptor by lazy { MangaUpdatesInterceptor(this) }
|
||||
|
||||
private val api by lazy { MangaUpdatesApi(interceptor, client) }
|
||||
|
||||
override val name: String = "MangaUpdates"
|
||||
|
||||
// override fun getLogo(): Int = R.drawable.ic_manga_updates
|
||||
|
||||
// override fun getLogoColor(): Int = Color.rgb(146, 160, 173)
|
||||
|
||||
override fun getStatusList(): List<Int> {
|
||||
return listOf(READING_LIST, COMPLETE_LIST, ON_HOLD_LIST, UNFINISHED_LIST, WISH_LIST)
|
||||
}
|
||||
|
||||
// @StringRes
|
||||
override fun getStatus(status: Int): String? = when (status) {
|
||||
READING_LIST -> "Reading List"
|
||||
WISH_LIST -> "Wish List"
|
||||
COMPLETE_LIST -> "Complete List"
|
||||
ON_HOLD_LIST -> ">On Hold List"
|
||||
UNFINISHED_LIST -> "Unfinished List"
|
||||
else -> null
|
||||
}
|
||||
|
||||
override fun getReadingStatus(): Int = READING_LIST
|
||||
|
||||
override fun getRereadingStatus(): Int = -1
|
||||
|
||||
override fun getCompletionStatus(): Int = COMPLETE_LIST
|
||||
|
||||
private val _scoreList = (0..9).flatMap { i -> (0..9).map { j -> "$i.$j" } } + listOf("10.0")
|
||||
|
||||
override fun getScoreList(): List<String> = _scoreList
|
||||
|
||||
override fun indexToScore(index: Int): Float = _scoreList[index].toFloat()
|
||||
|
||||
override fun displayScore(track: Track): String = track.score.toString()
|
||||
|
||||
override suspend fun update(track: Track, didReadChapter: Boolean): Track {
|
||||
if (track.status != COMPLETE_LIST && didReadChapter) {
|
||||
track.status = READING_LIST
|
||||
}
|
||||
api.updateSeriesListItem(track)
|
||||
return track
|
||||
}
|
||||
|
||||
override suspend fun bind(track: Track, hasReadChapters: Boolean): Track {
|
||||
return try {
|
||||
val (series, rating) = api.getSeriesListItem(track)
|
||||
series.copyTo(track)
|
||||
rating?.copyTo(track) ?: track
|
||||
} catch (e: Exception) {
|
||||
api.addSeriesToList(track, hasReadChapters)
|
||||
track
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun search(query: String): List<TrackSearch> {
|
||||
return api.search(query)
|
||||
.map {
|
||||
it.toTrackSearch(id)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun refresh(track: Track): Track {
|
||||
val (series, rating) = api.getSeriesListItem(track)
|
||||
series.copyTo(track)
|
||||
return rating?.copyTo(track) ?: track
|
||||
}
|
||||
|
||||
override suspend fun login(username: String, password: String) {
|
||||
val authenticated = api.authenticate(username, password) ?: throw Throwable("Unable to login")
|
||||
saveCredentials(authenticated.uid.toString(), authenticated.sessionToken)
|
||||
interceptor.newAuth(authenticated.sessionToken)
|
||||
}
|
||||
|
||||
fun restoreSession(): String? {
|
||||
return trackPreferences.trackPassword(this).get()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.MangaUpdates.Companion.READING_LIST
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.MangaUpdates.Companion.WISH_LIST
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.Context
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.ListItem
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.Rating
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.dto.Record
|
||||
import eu.kanade.tachiyomi.network.DELETE
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.PUT
|
||||
import eu.kanade.tachiyomi.network.awaitSuccess
|
||||
import eu.kanade.tachiyomi.network.parseAs
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.add
|
||||
import kotlinx.serialization.json.addJsonObject
|
||||
import kotlinx.serialization.json.buildJsonArray
|
||||
import kotlinx.serialization.json.buildJsonObject
|
||||
import kotlinx.serialization.json.decodeFromJsonElement
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.put
|
||||
import kotlinx.serialization.json.putJsonObject
|
||||
// import logcat.LogPriority
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.RequestBody.Companion.toRequestBody
|
||||
// import tachiyomi.core.util.system.logcat
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class MangaUpdatesApi(
|
||||
interceptor: MangaUpdatesInterceptor,
|
||||
private val client: OkHttpClient
|
||||
) {
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
private val baseUrl = "https://api.mangaupdates.com"
|
||||
private val contentType = "application/vnd.api+json".toMediaType()
|
||||
|
||||
private val authClient by lazy {
|
||||
client.newBuilder()
|
||||
.addInterceptor(interceptor)
|
||||
.build()
|
||||
}
|
||||
|
||||
suspend fun getSeriesListItem(track: Track): Pair<ListItem, Rating?> {
|
||||
val listItem = with(json) {
|
||||
authClient.newCall(GET("$baseUrl/v1/lists/series/${track.media_id}"))
|
||||
.awaitSuccess()
|
||||
.parseAs<ListItem>()
|
||||
}
|
||||
|
||||
val rating = getSeriesRating(track)
|
||||
|
||||
return listItem to rating
|
||||
}
|
||||
|
||||
suspend fun addSeriesToList(track: Track, hasReadChapters: Boolean) {
|
||||
val status = if (hasReadChapters) READING_LIST else WISH_LIST
|
||||
val body = buildJsonArray {
|
||||
addJsonObject {
|
||||
putJsonObject("series") {
|
||||
put("id", track.media_id)
|
||||
}
|
||||
put("list_id", status)
|
||||
}
|
||||
}
|
||||
authClient.newCall(
|
||||
POST(
|
||||
url = "$baseUrl/v1/lists/series",
|
||||
body = body.toString().toRequestBody(contentType)
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
.let {
|
||||
if (it.code == 200) {
|
||||
track.status = status
|
||||
track.last_chapter_read = 1f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun updateSeriesListItem(track: Track) {
|
||||
val body = buildJsonArray {
|
||||
addJsonObject {
|
||||
putJsonObject("series") {
|
||||
put("id", track.media_id)
|
||||
}
|
||||
put("list_id", track.status)
|
||||
putJsonObject("status") {
|
||||
put("chapter", track.last_chapter_read.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
authClient.newCall(
|
||||
POST(
|
||||
url = "$baseUrl/v1/lists/series/update",
|
||||
body = body.toString().toRequestBody(contentType)
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
|
||||
updateSeriesRating(track)
|
||||
}
|
||||
|
||||
private suspend fun getSeriesRating(track: Track): Rating? {
|
||||
return try {
|
||||
with(json) {
|
||||
authClient.newCall(GET("$baseUrl/v1/series/${track.media_id}/rating"))
|
||||
.awaitSuccess()
|
||||
.parseAs<Rating>()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun updateSeriesRating(track: Track) {
|
||||
if (track.score != 0f) {
|
||||
val body = buildJsonObject {
|
||||
put("rating", track.score)
|
||||
}
|
||||
authClient.newCall(
|
||||
PUT(
|
||||
url = "$baseUrl/v1/series/${track.media_id}/rating",
|
||||
body = body.toString().toRequestBody(contentType)
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
} else {
|
||||
authClient.newCall(
|
||||
DELETE(
|
||||
url = "$baseUrl/v1/series/${track.media_id}/rating"
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun search(query: String): List<Record> {
|
||||
val body = buildJsonObject {
|
||||
put("search", query)
|
||||
put(
|
||||
"filter_types",
|
||||
buildJsonArray {
|
||||
add("drama cd")
|
||||
add("novel")
|
||||
}
|
||||
)
|
||||
}
|
||||
return with(json) {
|
||||
client.newCall(
|
||||
POST(
|
||||
url = "$baseUrl/v1/series/search",
|
||||
body = body.toString().toRequestBody(contentType)
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
.parseAs<JsonObject>()
|
||||
.let { obj ->
|
||||
obj["results"]?.jsonArray?.map { element ->
|
||||
json.decodeFromJsonElement<Record>(element.jsonObject["record"]!!)
|
||||
}
|
||||
}
|
||||
.orEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun authenticate(username: String, password: String): Context? {
|
||||
val body = buildJsonObject {
|
||||
put("username", username)
|
||||
put("password", password)
|
||||
}
|
||||
return with(json) {
|
||||
client.newCall(
|
||||
PUT(
|
||||
url = "$baseUrl/v1/account/login",
|
||||
body = body.toString().toRequestBody(contentType)
|
||||
)
|
||||
)
|
||||
.awaitSuccess()
|
||||
.parseAs<JsonObject>()
|
||||
.let { obj ->
|
||||
try {
|
||||
json.decodeFromJsonElement<Context>(obj["context"]!!)
|
||||
} catch (e: Exception) {
|
||||
// logcat(LogPriority.ERROR, e)
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates
|
||||
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import java.io.IOException
|
||||
|
||||
class MangaUpdatesInterceptor(
|
||||
mangaUpdates: MangaUpdates
|
||||
) : Interceptor {
|
||||
|
||||
private var token: String? = mangaUpdates.restoreSession()
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val originalRequest = chain.request()
|
||||
|
||||
val token = token ?: throw IOException("Not authenticated with MangaUpdates")
|
||||
|
||||
// Add the authorization header to the original request.
|
||||
val authRequest = originalRequest.newBuilder()
|
||||
.addHeader("Authorization", "Bearer $token")
|
||||
.build()
|
||||
|
||||
return chain.proceed(authRequest)
|
||||
}
|
||||
|
||||
fun newAuth(token: String?) {
|
||||
this.token = token
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Context(
|
||||
@SerialName("session_token")
|
||||
val sessionToken: String,
|
||||
val uid: Long
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Image(
|
||||
val url: Url? = null,
|
||||
val height: Int? = null,
|
||||
val width: Int? = null
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import eu.kanade.tachiyomi.data.track.mangaupdates.MangaUpdates.Companion.READING_LIST
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ListItem(
|
||||
val series: Series? = null,
|
||||
@SerialName("list_id")
|
||||
val listId: Int? = null,
|
||||
val status: Status? = null,
|
||||
val priority: Int? = null
|
||||
)
|
||||
|
||||
fun ListItem.copyTo(track: Track): Track {
|
||||
return track.apply {
|
||||
this.status = listId ?: READING_LIST
|
||||
this.last_chapter_read = this@copyTo.status?.chapter?.toFloat() ?: 0f
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Rating(
|
||||
val rating: Float? = null
|
||||
)
|
||||
|
||||
fun Rating.copyTo(track: Track): Track {
|
||||
return track.apply {
|
||||
this.score = rating ?: 0f
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import eu.kanade.tachiyomi.data.track.model.TrackSearch
|
||||
import eu.kanade.tachiyomi.util.lang.htmlDecode
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Record(
|
||||
@SerialName("series_id")
|
||||
val seriesId: Long? = null,
|
||||
val title: String? = null,
|
||||
val url: String? = null,
|
||||
val description: String? = null,
|
||||
val image: Image? = null,
|
||||
val type: String? = null,
|
||||
val year: String? = null,
|
||||
@SerialName("bayesian_rating")
|
||||
val bayesianRating: Double? = null,
|
||||
@SerialName("rating_votes")
|
||||
val ratingVotes: Int? = null,
|
||||
@SerialName("latest_chapter")
|
||||
val latestChapter: Int? = null
|
||||
)
|
||||
|
||||
fun Record.toTrackSearch(id: Long): TrackSearch {
|
||||
return TrackSearch.create(id).apply {
|
||||
media_id = this@toTrackSearch.seriesId ?: 0L
|
||||
title = this@toTrackSearch.title?.htmlDecode() ?: ""
|
||||
total_chapters = 0
|
||||
cover_url = this@toTrackSearch.image?.url?.original ?: ""
|
||||
summary = this@toTrackSearch.description?.htmlDecode() ?: ""
|
||||
tracking_url = this@toTrackSearch.url ?: ""
|
||||
publishing_status = ""
|
||||
publishing_type = this@toTrackSearch.type.toString()
|
||||
start_date = this@toTrackSearch.year.toString()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Series(
|
||||
val id: Long? = null,
|
||||
val title: String? = null
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Status(
|
||||
val volume: Int? = null,
|
||||
val chapter: Int? = null
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package eu.kanade.tachiyomi.data.track.mangaupdates.dto
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Url(
|
||||
val original: String? = null,
|
||||
val thumb: String? = null
|
||||
)
|
||||
@@ -0,0 +1,68 @@
|
||||
package eu.kanade.tachiyomi.data.track.model
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
|
||||
class TrackSearch : Track {
|
||||
|
||||
override var id: Long? = null
|
||||
|
||||
override var manga_id: Long = 0
|
||||
|
||||
override var sync_id: Int = 0
|
||||
|
||||
override var media_id: Long = 0
|
||||
|
||||
override var library_id: Long? = null
|
||||
|
||||
override lateinit var title: String
|
||||
|
||||
override var last_chapter_read: Float = 0F
|
||||
|
||||
override var total_chapters: Int = 0
|
||||
|
||||
override var score: Float = 0f
|
||||
|
||||
override var status: Int = 0
|
||||
|
||||
override var started_reading_date: Long = 0
|
||||
|
||||
override var finished_reading_date: Long = 0
|
||||
|
||||
override lateinit var tracking_url: String
|
||||
|
||||
var cover_url: String = ""
|
||||
|
||||
var summary: String = ""
|
||||
|
||||
var publishing_status: String = ""
|
||||
|
||||
var publishing_type: String = ""
|
||||
|
||||
var start_date: String = ""
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as TrackSearch
|
||||
|
||||
if (manga_id != other.manga_id) return false
|
||||
if (sync_id != other.sync_id) return false
|
||||
if (media_id != other.media_id) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = manga_id.hashCode()
|
||||
result = 31 * result + sync_id
|
||||
result = 31 * result + media_id.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(serviceId: Long): TrackSearch = TrackSearch().apply {
|
||||
sync_id = serviceId.toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package eu.kanade.tachiyomi.network
|
||||
|
||||
import android.content.Context
|
||||
import app.cash.quickjs.QuickJs
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
/**
|
||||
* Util for evaluating JavaScript in sources.
|
||||
*/
|
||||
class JavaScriptEngine(context: Context) {
|
||||
|
||||
/**
|
||||
* Evaluate arbitrary JavaScript code and get the result as a primitive type
|
||||
* (e.g., String, Int).
|
||||
*
|
||||
* @since extensions-lib 1.4
|
||||
* @param script JavaScript to execute.
|
||||
* @return Result of JavaScript code as a primitive type.
|
||||
*/
|
||||
@Suppress("UNUSED", "UNCHECKED_CAST")
|
||||
suspend fun <T> evaluate(script: String): T = withContext(Dispatchers.IO) {
|
||||
QuickJs.create().use {
|
||||
it.evaluate(script) as T
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ class NetworkHelper(context: Context) {
|
||||
.cookieJar(cookieManager)
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.callTimeout(2, TimeUnit.MINUTES)
|
||||
.addInterceptor(UserAgentInterceptor())
|
||||
|
||||
if (serverConfig.debugLogsEnabled) {
|
||||
|
||||
@@ -62,7 +62,7 @@ suspend fun Call.await(): Response {
|
||||
object : Callback {
|
||||
override fun onResponse(call: Call, response: Response) {
|
||||
if (!response.isSuccessful) {
|
||||
continuation.resumeWithException(Exception("HTTP error ${response.code}"))
|
||||
continuation.resumeWithException(HttpException(response.code))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -89,12 +89,17 @@ suspend fun Call.await(): Response {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun Call.awaitSuccess(): Response {
|
||||
// awaitSuccess is a renamed version of our await, they added a new await that allows non-success error codes
|
||||
return await()
|
||||
}
|
||||
|
||||
fun Call.asObservableSuccess(): Observable<Response> {
|
||||
return asObservable()
|
||||
.doOnNext { response ->
|
||||
if (!response.isSuccessful) {
|
||||
response.close()
|
||||
throw Exception("HTTP error ${response.code}")
|
||||
throw HttpException(response.code)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,13 +121,13 @@ fun Call.asObservableSuccess(): Observable<Response> {
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun OkHttpClient.newCallWithProgress(request: Request, listener: ProgressListener): Call {
|
||||
val progressClient = newBuilder()
|
||||
// .cache(null)
|
||||
// .addNetworkInterceptor { chain ->
|
||||
// val originalResponse = chain.proceed(chain.request())
|
||||
// originalResponse.newBuilder()
|
||||
// .body(ProgressResponseBody(originalResponse.body!!, listener))
|
||||
// .build()
|
||||
// }
|
||||
.cache(null)
|
||||
.addNetworkInterceptor { chain ->
|
||||
val originalResponse = chain.proceed(chain.request())
|
||||
originalResponse.newBuilder()
|
||||
.body(ProgressResponseBody(originalResponse.body!!, listener))
|
||||
.build()
|
||||
}
|
||||
.build()
|
||||
|
||||
return progressClient.newCall(request)
|
||||
@@ -136,3 +141,5 @@ inline fun <reified T> Response.parseAs(): T {
|
||||
return json.decodeFromString(responseBody)
|
||||
}
|
||||
}
|
||||
|
||||
class HttpException(val code: Int) : IllegalStateException("HTTP error $code")
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package eu.kanade.tachiyomi.network
|
||||
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.ResponseBody
|
||||
import okio.Buffer
|
||||
import okio.BufferedSource
|
||||
import okio.ForwardingSource
|
||||
import okio.Source
|
||||
import okio.buffer
|
||||
import java.io.IOException
|
||||
|
||||
class ProgressResponseBody(private val responseBody: ResponseBody, private val progressListener: ProgressListener) : ResponseBody() {
|
||||
|
||||
private val bufferedSource: BufferedSource by lazy {
|
||||
source(responseBody.source()).buffer()
|
||||
}
|
||||
|
||||
override fun contentType(): MediaType? {
|
||||
return responseBody.contentType()
|
||||
}
|
||||
|
||||
override fun contentLength(): Long {
|
||||
return responseBody.contentLength()
|
||||
}
|
||||
|
||||
override fun source(): BufferedSource {
|
||||
return bufferedSource
|
||||
}
|
||||
|
||||
private fun source(source: Source): Source {
|
||||
return object : ForwardingSource(source) {
|
||||
var totalBytesRead = 0L
|
||||
|
||||
@Throws(IOException::class)
|
||||
override fun read(sink: Buffer, byteCount: Long): Long {
|
||||
val bytesRead = super.read(sink, byteCount)
|
||||
// read() returns the number of bytes read, or -1 if this source is exhausted.
|
||||
totalBytesRead += if (bytesRead != -1L) bytesRead else 0
|
||||
progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1L)
|
||||
return bytesRead
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user