mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-10 02:20:28 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9692e76e5 | ||
|
|
0a9e39ed75 | ||
|
|
1971f582b5 | ||
|
|
c62d6be3da | ||
|
|
7d5e503894 | ||
|
|
6c4066fde4 | ||
|
|
ffdf3e717f | ||
|
|
f66814b4ae | ||
|
|
0c3e201a51 | ||
|
|
c32a5d750f | ||
|
|
207c287c97 | ||
|
|
56ef25065e | ||
|
|
bd6d6be71f | ||
|
|
1d3a028bae | ||
|
|
27011fb96b | ||
|
|
c696b59c4b | ||
|
|
78b5b8a78b | ||
|
|
c81ca7f5cd | ||
|
|
e39d50fe09 | ||
|
|
086269f8bd | ||
|
|
00d2183961 | ||
|
|
5f914dc4c4 | ||
|
|
9bf204cf04 | ||
|
|
a816b9ccc8 | ||
|
|
d60d370463 | ||
|
|
84d054b494 | ||
|
|
1aa96e147f | ||
|
|
8c01e45780 | ||
|
|
8ad571aa08 | ||
|
|
39316e9b8e |
No files matched your search
@@ -16,7 +16,7 @@ categories:
|
||||
- title: '🧰 Maintenance'
|
||||
label: 'chore'
|
||||
- title: '📖 Document'
|
||||
label: 'doc'
|
||||
label: 'docs'
|
||||
- title: '🚀 CI/CD'
|
||||
label: 'ci'
|
||||
- title: '🌎 Internationalization'
|
||||
@@ -34,7 +34,7 @@ version-resolver:
|
||||
- 'patch'
|
||||
default: patch
|
||||
template: |
|
||||
# Changes
|
||||
# Release notes
|
||||
|
||||
$CHANGES
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
DefaultDirName={autopf}\gopeedrsion
|
||||
DefaultDirName={autopf}\gopeed
|
||||
DisableProgramGroupPage=yes
|
||||
LicenseFile=..\..\..\..\LICENSE
|
||||
; Remove the following line to run in administrative install mode (install for all users.)
|
||||
@@ -471,7 +471,9 @@ jobs:
|
||||
VERSION: ${{ needs.get-release.outputs.version }}
|
||||
with:
|
||||
push: ${{ github.event.inputs.test == 'true' && 'false' || 'true' }}
|
||||
build-args: VERSION=${{ env.VERSION }}
|
||||
build-args: |
|
||||
VERSION=${{ env.VERSION }}
|
||||
IN_DOCKER=true
|
||||
platforms: |
|
||||
linux/386
|
||||
linux/amd64
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Hướng dẫn đóng góp cho Gopeed
|
||||
|
||||
Trước tiên, cảm ơn bạn đã quan tâm đến việc đóng góp cho Gopeed. Hướng dẫn này sẽ giúp bạn tham gia
|
||||
phát triển Gopeed một cách tốt hơn.
|
||||
|
||||
## Mô tả nhánh
|
||||
|
||||
Dự án này chỉ có một nhánh chính duy nhất, đó là nhánh `main`. Nếu bạn muốn tham gia vào
|
||||
phát triển Gopeed, hãy fork dự án này trước, sau đó phát triển trong dự án fork của bạn. Sau khi
|
||||
hoàn thành phát triển, gửi một PR đến dự án này và merge vào nhánh `main`.
|
||||
|
||||
## Phát triển cục bộ
|
||||
|
||||
Đề nghị phát triển và gỡ lỗi thông qua web. Đầu tiên, khởi động dịch vụ backend bằng cách chạy
|
||||
lệnh `go run cmd/api/main.go` trong dòng lệnh, cổng mặc định của dịch vụ là `9999`, sau đó
|
||||
khởi động dự án flutter frontend trong chế độ `debug` để chạy.
|
||||
|
||||
## Dịch thuật
|
||||
|
||||
Các tệp quốc tế hóa của Gopeed được đặt trong thư mục `ui/flutter/lib/i18n/langs`.
|
||||
Bạn chỉ cần thêm tệp ngôn ngữ tương ứng trong thư mục này.
|
||||
|
||||
Vui lòng tham khảo `en_us.dart` để biết cách dịch thuật.
|
||||
|
||||
## Phát triển flutter
|
||||
|
||||
Đừng quên chạy `dart format ./ui/flutter` trước khi commit để giữ mã của bạn theo định dạng dart chuẩn.
|
||||
|
||||
Bật build_runner watcher nếu bạn muốn chỉnh sửa api/models:
|
||||
+11
-2
@@ -12,12 +12,21 @@ RUN go mod download
|
||||
COPY . .
|
||||
COPY --from=flutter /app/build/web ./cmd/web/dist
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=0 go build -tags nosqlite,web -ldflags="-s -w -X github.com/GopeedLab/gopeed/pkg/base.Version=${VERSION}" -o dist/gopeed github.com/GopeedLab/gopeed/cmd/web
|
||||
RUN CGO_ENABLED=0 go build -tags nosqlite,web \
|
||||
-ldflags="-s -w -X github.com/GopeedLab/gopeed/pkg/base.Version=$VERSION -X github.com/GopeedLab/gopeed/pkg/base.InDocker=true" \
|
||||
-o dist/gopeed github.com/GopeedLab/gopeed/cmd/web
|
||||
|
||||
FROM alpine:3.14.2
|
||||
LABEL maintainer="monkeyWie"
|
||||
WORKDIR /app
|
||||
COPY --from=go /app/dist/gopeed ./
|
||||
COPY entrypoint.sh ./entrypoint.sh
|
||||
RUN apk update && \
|
||||
apk upgrade --no-cache && \
|
||||
apk add --no-cache bash su-exec; \
|
||||
chmod +x ./entrypoint.sh && \
|
||||
rm -rf /var/cache/apk/*
|
||||
VOLUME ["/app/storage"]
|
||||
ENV PUID=0 PGID=0 UMASK=022
|
||||
EXPOSE 9999
|
||||
ENTRYPOINT ["./gopeed"]
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
[](https://ko-fi.com/R6R6IJGN6)
|
||||
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md)
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -40,10 +40,14 @@ Visit ✈ [Official Website](https://gopeed.com) | 📖 [Official Docs](https://
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td><code>DMG Installer</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Link</a></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=4>Linux</td>
|
||||
<td><code>Flathub</code></td>
|
||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SNAP</code></td>
|
||||
<td><a href="https://snapcraft.io/gopeed">Link</a></td>
|
||||
</tr>
|
||||
@@ -55,10 +59,6 @@ Visit ✈ [Official Website](https://gopeed.com) | 📖 [Official Docs](https://
|
||||
<td><code>AppImage</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Portable TAR</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64-portable.tar.gz">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td><code>APK</code></td>
|
||||
@@ -168,7 +168,7 @@ command:
|
||||
- android
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build apk
|
||||
```
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@
|
||||
|
||||
[](https://ko-fi.com/R6R6IJGN6)
|
||||
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md)
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||
|
||||
## はじめに
|
||||
|
||||
@@ -40,10 +40,14 @@ Gopeed (正式名 Go Speed) は `Golang` + `Flutter` によって開発された
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td><code>DMG Installer</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Link</a></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=4>Linux</td>
|
||||
<td><code>Flathub</code></td>
|
||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SNAP</code></td>
|
||||
<td><a href="https://snapcraft.io/gopeed">Link</a></td>
|
||||
</tr>
|
||||
@@ -55,10 +59,6 @@ Gopeed (正式名 Go Speed) は `Golang` + `Flutter` によって開発された
|
||||
<td><code>AppImage</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Portable TAR</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64-portable.tar.gz">Link</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td><code>APK</code></td>
|
||||
@@ -160,7 +160,7 @@ gomobile init
|
||||
- android
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build apk
|
||||
```
|
||||
|
||||
+211
@@ -0,0 +1,211 @@
|
||||
[](https://github.com/GopeedLab/gopeed/actions?query=workflow%3Atest)
|
||||
[](https://codecov.io/gh/GopeedLab/gopeed)
|
||||
[](https://github.com/GopeedLab/gopeed/releases)
|
||||
[](https://github.com/GopeedLab/gopeed/releases)
|
||||
[](https://docs.gopeed.com/donate.html)
|
||||
[](https://discord.gg/ZUJqJrwCGB)
|
||||
|
||||

|
||||
|
||||
[](https://ko-fi.com/R6R6IJGN6)
|
||||
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||
|
||||
## Giới thiệu
|
||||
|
||||
Gopeed (tên đầy đủ Go Speed), một công cụ tải xuống tốc độ cao được phát triển bởi `Golang` + `Flutter`, hỗ trợ giao thức (HTTP, BitTorrent, Magnet) và hỗ trợ tất cả các nền tảng. Ngoài các chức năng tải xuống cơ bản, Gopeed còn là một công cụ tải xuống có thể tùy chỉnh cao cho phép triển khai thêm tính năng thông qua việc tích hợp với [APIs](https://docs.gopeed.com/dev-api.html) hoặc cài đặt và phát triển các [tiện ích mở rộng](https://docs.gopeed.com/dev-extension.html).
|
||||
|
||||
Truy cập ✈ [Trang web chính thức](https://gopeed.com) | 📖 [Tài liệu chính thức](https://docs.gopeed.com)
|
||||
|
||||
## Tải về
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nền tảng</th>
|
||||
<th>Loại gói</th>
|
||||
<th>Liên kết tải xuống</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td rowspan=2>Windows</td>
|
||||
<td><code>Bộ cài đặt EXE</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64.zip">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ZIP Portable</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td><code>Bộ cài đặt DMG</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=4>Linux</td>
|
||||
<td><code>Flathub</code></td>
|
||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SNAP</code></td>
|
||||
<td><a href="https://snapcraft.io/gopeed">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DEB</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux.deb">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>AppImage</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td><code>APK</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-android.apk">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iOS</td>
|
||||
<td><code>IPA</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-ios.ipa">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Web</td>
|
||||
<td></td>
|
||||
<td><a href="https://github.com/GopeedLab/gopeed/releases/latest">Liên kết</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker</td>
|
||||
<td></td>
|
||||
<td><a href="https://hub.docker.com/r/liwei2633/gopeed">Liên kết</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Thêm thông tin về cài đặt, vui lòng tham khảo [Cài đặt](https://docs.gopeed.com/install.html)
|
||||
|
||||
### Command tool
|
||||
|
||||
Sử dụng `go install`:
|
||||
|
||||
```bash
|
||||
go install github.com/GopeedLab/gopeed/cmd/gopeed@latest
|
||||
```
|
||||
|
||||
## Quyên góp
|
||||
|
||||
Nếu bạn thích dự án này, xin vui lòng xem xét [quyên góp](https://docs.gopeed.com/donate.html) để hỗ trợ phát triển dự án này, cảm ơn bạn!
|
||||
|
||||
## Trưng bày
|
||||
|
||||

|
||||
|
||||
## Development
|
||||
|
||||
Dự án này được chia thành hai phần, phần giao diện sử dụng `flutter`, phần backend sử dụng `Golang`, và hai phía giao tiếp thông qua giao thức `http`. Trên hệ thống unix, sử dụng `unix socket`, và trên hệ thống windows, sử dụng giao thức `tcp`.
|
||||
|
||||
> Mã giao diện nằm trong thư mục `ui/flutter`.
|
||||
|
||||
### Environment
|
||||
|
||||
1. Golang 1.21+
|
||||
2. Flutter 3.16+
|
||||
|
||||
### Clone
|
||||
|
||||
```bash
|
||||
git clone [email protected]:GopeedLab/gopeed.git
|
||||
```
|
||||
|
||||
### Đóng góp
|
||||
|
||||
Vui lòng tham khảo [CONTRIBUTING_vi-VN.md](/CONTRIBUTING_vi-VN.md)
|
||||
|
||||
### Xây dựng
|
||||
|
||||
#### Desktop
|
||||
|
||||
Trước tiên, bạn cần cấu hình môi trường theo tài liệu chính thức của [Tài liệu trang web máy tính để bàn Flutter](https://docs.flutter.dev/development/platform-integration/desktop), sau đó bạn cần đảm bảo môi trường cgo được thiết lập đúng. Để biết hướng dẫn chi tiết về cách thiết lập môi trường cgo, vui lòng tham khảo các tài liệu tương ứng có sẵn trực tuyến.
|
||||
|
||||
command:
|
||||
|
||||
- windows
|
||||
|
||||
```bash
|
||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop
|
||||
cd ui/flutter
|
||||
flutter build windows
|
||||
```
|
||||
|
||||
- macos
|
||||
|
||||
```bash
|
||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/macos/Frameworks/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop
|
||||
cd ui/flutter
|
||||
flutter build macos
|
||||
```
|
||||
|
||||
- linux
|
||||
|
||||
```bash
|
||||
go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/linux/bundle/lib/libgopeed.so github.com/GopeedLab/gopeed/bind/desktop
|
||||
cd ui/flutter
|
||||
flutter build linux
|
||||
```
|
||||
|
||||
#### Mobile
|
||||
|
||||
Giống như trước đây, bạn cũng cần chuẩn bị môi trường `cgo` và sau đó cài đặt `gomobile`:
|
||||
|
||||
```bash
|
||||
go install golang.org/x/mobile/cmd/gomobile@latest
|
||||
go get golang.org/x/mobile/bind
|
||||
gomobile init
|
||||
```
|
||||
|
||||
command:
|
||||
|
||||
- android
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build apk
|
||||
```
|
||||
|
||||
- ios
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/ios/Frameworks/Libgopeed.xcframework -target=ios github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build ios --no-codesign
|
||||
```
|
||||
|
||||
#### Web
|
||||
|
||||
command:
|
||||
|
||||
```bash
|
||||
cd ui/flutter
|
||||
flutter build web
|
||||
cd ../../
|
||||
rm -rf cmd/web/dist
|
||||
cp -r ui/flutter/build/web cmd/web/dist
|
||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||
```
|
||||
|
||||
## Tín dụng
|
||||
|
||||
### Người đóng góp
|
||||
|
||||
<a href="https://github.com/GopeedLab/gopeed/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=GopeedLab/gopeed" />
|
||||
</a>
|
||||
|
||||
### JetBrains
|
||||
|
||||
[](https://www.jetbrains.com/?from=gopeed)
|
||||
|
||||
## Giấy phép
|
||||
|
||||
[GPLv3](LICENSE)
|
||||
+7
-7
@@ -9,7 +9,7 @@
|
||||
|
||||
[](https://ko-fi.com/R6R6IJGN6)
|
||||
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md)
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||
|
||||
## 介绍
|
||||
|
||||
@@ -40,10 +40,14 @@ Gopeed(全称 Go Speed),直译过来中文名叫做`够快下载器`(不
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td><code>DMG Installer</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">前往</a></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=4>Linux</td>
|
||||
<td><code>Flathub</code></td>
|
||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SNAP</code></td>
|
||||
<td><a href="https://snapcraft.io/gopeed">前往</a></td>
|
||||
</tr>
|
||||
@@ -55,10 +59,6 @@ Gopeed(全称 Go Speed),直译过来中文名叫做`够快下载器`(不
|
||||
<td><code>AppImage</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Portable TAR</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64-portable.tar.gz">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td><code>APK</code></td>
|
||||
@@ -168,7 +168,7 @@ gomobile init
|
||||
- android
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build apk
|
||||
```
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@
|
||||
|
||||
[](https://ko-fi.com/R6R6IJGN6)
|
||||
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md)
|
||||
[English](/README.md) | [中文](/README_zh-CN.md) | [日本語](/README_ja-JP.md) | [正體中文](/README_zh-TW.md) | [Tiếng Việt](/README_vi-VN.md)
|
||||
|
||||
## 簡介
|
||||
|
||||
@@ -40,10 +40,14 @@ Gopeed(全稱 Go Speed),是一款使用`Golang`+`Flutter`編寫的高速
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td><code>DMG Installer</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-windows-amd64-portable.zip">前往</a></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-macos.dmg">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan=4>Linux</td>
|
||||
<td><code>Flathub</code></td>
|
||||
<td><a href="https://flathub.org/apps/com.gopeed.Gopeed">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SNAP</code></td>
|
||||
<td><a href="https://snapcraft.io/gopeed">前往</a></td>
|
||||
</tr>
|
||||
@@ -55,10 +59,6 @@ Gopeed(全稱 Go Speed),是一款使用`Golang`+`Flutter`編寫的高速
|
||||
<td><code>AppImage</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64.AppImage">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>Portable TAR</code></td>
|
||||
<td><a href="https://gopeed.com/api/download?tpl=Gopeed-$version-linux-amd64-portable.tar.gz">前往</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td><code>APK</code></td>
|
||||
@@ -168,7 +168,7 @@ gomobile init
|
||||
- android
|
||||
|
||||
```bash
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg=com.gopeed github.com/GopeedLab/gopeed/bind/mobile
|
||||
gomobile bind -tags nosqlite -ldflags="-w -s" -o ui/flutter/android/app/libs/libgopeed.aar -target=android -androidapi 19 -javapkg="com.gopeed" github.com/GopeedLab/gopeed/bind/mobile
|
||||
cd ui/flutter
|
||||
flutter build apk
|
||||
```
|
||||
|
||||
+12
-5
@@ -3,6 +3,7 @@ package cmd
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/GopeedLab/gopeed/pkg/base"
|
||||
"github.com/GopeedLab/gopeed/pkg/rest"
|
||||
"github.com/GopeedLab/gopeed/pkg/rest/model"
|
||||
"net/http"
|
||||
@@ -24,14 +25,20 @@ func Start(cfg *model.StartConfig) {
|
||||
panic(err)
|
||||
}
|
||||
if downloadCfg.FirstLoad {
|
||||
// Set default download dir to user download dir
|
||||
userDir, err := os.UserHomeDir()
|
||||
if err == nil {
|
||||
downloadDir := filepath.Join(userDir, "Downloads")
|
||||
// Set default download dir, in docker, it will be ${exe}/Downloads, else it will be ${user}/Downloads
|
||||
var downloadDir string
|
||||
if base.InDocker == "true" {
|
||||
downloadDir = filepath.Join(filepath.Dir(cfg.StorageDir), "Downloads")
|
||||
} else {
|
||||
userDir, err := os.UserHomeDir()
|
||||
if err == nil {
|
||||
downloadDir = filepath.Join(userDir, "Downloads")
|
||||
}
|
||||
}
|
||||
if downloadDir != "" {
|
||||
downloadCfg.DownloadDir = downloadDir
|
||||
rest.Downloader.PutConfig(downloadCfg)
|
||||
}
|
||||
|
||||
}
|
||||
fmt.Printf("Server start success on http://%s\n", listener.Addr().String())
|
||||
if err := srv.Serve(listener); err != nil && err != http.ErrServerClosed {
|
||||
|
||||
+10
-5
@@ -9,11 +9,12 @@ import (
|
||||
)
|
||||
|
||||
type args struct {
|
||||
Address *string `json:"address"`
|
||||
Port *int `json:"port"`
|
||||
Username *string `json:"username"`
|
||||
Password *string `json:"password"`
|
||||
ApiToken *string `json:"apiToken"`
|
||||
Address *string `json:"address"`
|
||||
Port *int `json:"port"`
|
||||
Username *string `json:"username"`
|
||||
Password *string `json:"password"`
|
||||
ApiToken *string `json:"apiToken"`
|
||||
StorageDir *string `json:"storageDir"`
|
||||
|
||||
configPath *string
|
||||
}
|
||||
@@ -25,6 +26,7 @@ func parse() *args {
|
||||
cliArgs.Username = flag.String("u", "gopeed", "HTTP Basic Auth Username")
|
||||
cliArgs.Password = flag.String("p", "", "HTTP Basic Auth Pwd")
|
||||
cliArgs.ApiToken = flag.String("T", "", "API token, that can only be used when basic authentication is enabled.")
|
||||
cliArgs.StorageDir = flag.String("d", "", "Storage directory")
|
||||
cliArgs.configPath = flag.String("c", "./config.json", "Config file path")
|
||||
flag.Parse()
|
||||
|
||||
@@ -45,6 +47,9 @@ func parse() *args {
|
||||
if cfgArgs.ApiToken == nil {
|
||||
cfgArgs.ApiToken = cliArgs.ApiToken
|
||||
}
|
||||
if cfgArgs.StorageDir == nil {
|
||||
cfgArgs.StorageDir = cliArgs.StorageDir
|
||||
}
|
||||
return cfgArgs
|
||||
}
|
||||
|
||||
|
||||
+9
-4
@@ -31,11 +31,16 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
var dir string
|
||||
if args.StorageDir != nil && *args.StorageDir != "" {
|
||||
dir = *args.StorageDir
|
||||
} else {
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
dir = filepath.Dir(exe)
|
||||
}
|
||||
dir := filepath.Dir(exe)
|
||||
|
||||
cfg := &model.StartConfig{
|
||||
Network: "tcp",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
chown -R ${PUID}:${PGID} /app/Download
|
||||
|
||||
umask ${UMASK}
|
||||
|
||||
exec su-exec ${PUID}:${PGID} ./gopeed "$@"
|
||||
@@ -33,6 +33,7 @@ type Fetcher struct {
|
||||
meta *fetcher.FetcherMeta
|
||||
|
||||
torrentReady atomic.Bool
|
||||
torrentDrop atomic.Bool
|
||||
create atomic.Bool
|
||||
progress fetcher.Progress
|
||||
}
|
||||
@@ -143,6 +144,7 @@ func (f *Fetcher) Pause() (err error) {
|
||||
}
|
||||
|
||||
func (f *Fetcher) Close() (err error) {
|
||||
f.torrentDrop.Store(false)
|
||||
f.safeDrop()
|
||||
return nil
|
||||
}
|
||||
@@ -158,6 +160,9 @@ func (f *Fetcher) safeDrop() {
|
||||
|
||||
func (f *Fetcher) Wait() (err error) {
|
||||
for {
|
||||
if f.torrentDrop.Load() {
|
||||
break
|
||||
}
|
||||
if f.torrentReady.Load() && len(f.meta.Opts.SelectFiles) > 0 {
|
||||
done := true
|
||||
for _, selectIndex := range f.meta.Opts.SelectFiles {
|
||||
|
||||
@@ -2,6 +2,7 @@ package base
|
||||
|
||||
// Version is the build version, set at build time, using `go build -ldflags "-X github.com/GopeedLab/gopeed/pkg/base.Version=1.0.0"`.
|
||||
var Version string
|
||||
var InDocker string
|
||||
|
||||
func init() {
|
||||
if Version == "" {
|
||||
+85
-67
@@ -172,8 +172,8 @@ func (d *Downloader) Setup() error {
|
||||
if len(d.tasks) > 0 {
|
||||
for _, task := range d.tasks {
|
||||
func() {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
task.statusLock.Lock()
|
||||
defer task.statusLock.Unlock()
|
||||
if task.Status != base.DownloadStatusRunning {
|
||||
return
|
||||
}
|
||||
@@ -302,9 +302,6 @@ func (d *Downloader) CreateDirect(req *base.Request, opts *base.Options) (taskId
|
||||
}
|
||||
|
||||
func (d *Downloader) Create(rrId string, opts *base.Options) (taskId string, err error) {
|
||||
if opts == nil {
|
||||
opts = &base.Options{}
|
||||
}
|
||||
d.fetcherMapLock.RLock()
|
||||
fetcher, ok := d.fetcherCache[rrId]
|
||||
d.fetcherMapLock.RUnlock()
|
||||
@@ -332,8 +329,7 @@ func (d *Downloader) Pause(id string) (err error) {
|
||||
if task.Status == base.DownloadStatusPause {
|
||||
return
|
||||
}
|
||||
err = d.doPause(task)
|
||||
if err != nil {
|
||||
if err = d.doPause(task); err != nil {
|
||||
return
|
||||
}
|
||||
d.notifyRunning()
|
||||
@@ -366,19 +362,7 @@ func (d *Downloader) Continue(id string) (err error) {
|
||||
}
|
||||
}()
|
||||
|
||||
func() {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
|
||||
if task.Status == base.DownloadStatusRunning {
|
||||
return
|
||||
}
|
||||
|
||||
if err = d.doStart(task); err != nil {
|
||||
return
|
||||
}
|
||||
}()
|
||||
return
|
||||
return d.doStart(task)
|
||||
}
|
||||
|
||||
func (d *Downloader) PauseAll() (err error) {
|
||||
@@ -391,13 +375,7 @@ func (d *Downloader) PauseAll() (err error) {
|
||||
}()
|
||||
|
||||
for _, task := range d.tasks {
|
||||
err = func() error {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
|
||||
return d.doPause(task)
|
||||
}()
|
||||
if err != nil {
|
||||
if err = d.doPause(task); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -427,13 +405,7 @@ func (d *Downloader) ContinueAll() (err error) {
|
||||
|
||||
for _, task := range continuedTasks {
|
||||
tt := task
|
||||
err = func() error {
|
||||
tt.lock.Lock()
|
||||
defer tt.lock.Unlock()
|
||||
|
||||
return d.doStart(tt)
|
||||
}()
|
||||
if err != nil {
|
||||
if err = d.doStart(tt); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -525,17 +497,21 @@ func (d *Downloader) Stats(id string) (sr any, err error) {
|
||||
|
||||
func (d *Downloader) doDelete(task *Task, force bool) (err error) {
|
||||
err = func() error {
|
||||
if task.fetcher != nil {
|
||||
if err := task.fetcher.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
d.lock.Lock()
|
||||
defer d.lock.Unlock()
|
||||
|
||||
if err := d.storage.Delete(bucketTask, task.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.storage.Delete(bucketSave, task.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if task.fetcher != nil {
|
||||
if err := task.fetcher.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if force && task.Meta.Res != nil {
|
||||
if task.Meta.Res.Name != "" {
|
||||
if err := os.RemoveAll(task.Meta.FolderPath()); err != nil {
|
||||
@@ -750,6 +726,9 @@ func (d *Downloader) doCreate(fetcher fetcher.Fetcher, opts *base.Options) (task
|
||||
if opts == nil {
|
||||
opts = &base.Options{}
|
||||
}
|
||||
if opts.SelectFiles == nil {
|
||||
opts.SelectFiles = make([]int, 0)
|
||||
}
|
||||
|
||||
meta := fetcher.Meta()
|
||||
meta.Opts = opts
|
||||
@@ -794,31 +773,52 @@ func (d *Downloader) doCreate(fetcher fetcher.Fetcher, opts *base.Options) (task
|
||||
return
|
||||
}
|
||||
|
||||
d.doStart(task)
|
||||
err = d.doStart(task)
|
||||
}()
|
||||
|
||||
go d.watch(task)
|
||||
return
|
||||
}
|
||||
|
||||
func (d *Downloader) statusMut(task *Task, fn func() (bool, error)) (bool, error) {
|
||||
task.statusLock.Lock()
|
||||
defer task.statusLock.Unlock()
|
||||
|
||||
return fn()
|
||||
}
|
||||
|
||||
func (d *Downloader) doStart(task *Task) (err error) {
|
||||
if task.Status != base.DownloadStatusRunning && task.Status != base.DownloadStatusDone {
|
||||
err := d.restoreFetcher(task)
|
||||
var isCreate bool
|
||||
isReturn, err := d.statusMut(task, func() (isReturn bool, err error) {
|
||||
if task.Status == base.DownloadStatusRunning || task.Status == base.DownloadStatusDone {
|
||||
isReturn = true
|
||||
return
|
||||
}
|
||||
|
||||
err = d.restoreFetcher(task)
|
||||
if err != nil {
|
||||
d.Logger.Error().Stack().Err(err).Msgf("restore fetcher failed, task id: %s", task.ID)
|
||||
return err
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
isCreate := task.Status == base.DownloadStatusReady
|
||||
|
||||
doStart := func() error {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
isCreate = task.Status == base.DownloadStatusReady
|
||||
|
||||
d.triggerOnStart(task)
|
||||
task.updateStatus(base.DownloadStatusRunning)
|
||||
|
||||
return
|
||||
})
|
||||
if err != nil {
|
||||
d.Logger.Error().Stack().Err(err).Msgf("start task failed, task id: %s", task.ID)
|
||||
return
|
||||
}
|
||||
if isReturn {
|
||||
return
|
||||
}
|
||||
|
||||
handler := func() error {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
|
||||
if task.Meta.Res == nil {
|
||||
err := task.fetcher.Resolve(task.Meta.Req)
|
||||
if err != nil {
|
||||
@@ -865,8 +865,7 @@ func (d *Downloader) doStart(task *Task) (err error) {
|
||||
return nil
|
||||
}
|
||||
go func() {
|
||||
err := doStart()
|
||||
if err != nil {
|
||||
if err := handler(); err != nil {
|
||||
d.doOnError(task, err)
|
||||
}
|
||||
}()
|
||||
@@ -875,27 +874,44 @@ func (d *Downloader) doStart(task *Task) (err error) {
|
||||
}
|
||||
|
||||
func (d *Downloader) doPause(task *Task) (err error) {
|
||||
err = func() error {
|
||||
if task.Status != base.DownloadStatusDone {
|
||||
task.updateStatus(base.DownloadStatusPause)
|
||||
task.timer.Pause()
|
||||
if task.fetcher != nil {
|
||||
if err := task.fetcher.Pause(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := d.storage.Put(bucketTask, task.ID, task.clone()); err != nil {
|
||||
return err
|
||||
}
|
||||
d.emit(EventKeyPause, task)
|
||||
isReturn, err := d.statusMut(task, func() (isReturn bool, err error) {
|
||||
if task.Status == base.DownloadStatusPause || task.Status == base.DownloadStatusDone {
|
||||
isReturn = true
|
||||
return
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
|
||||
task.updateStatus(base.DownloadStatusPause)
|
||||
task.timer.Pause()
|
||||
return
|
||||
})
|
||||
if err != nil {
|
||||
d.Logger.Error().Stack().Err(err).Msgf("pause task failed, task id: %s", task.ID)
|
||||
return
|
||||
}
|
||||
if isReturn {
|
||||
return
|
||||
}
|
||||
|
||||
handler := func() error {
|
||||
task.lock.Lock()
|
||||
defer task.lock.Unlock()
|
||||
|
||||
if task.fetcher != nil {
|
||||
if err := task.fetcher.Pause(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := d.storage.Put(bucketTask, task.ID, task.clone()); err != nil {
|
||||
return err
|
||||
}
|
||||
d.emit(EventKeyPause, task)
|
||||
return nil
|
||||
}
|
||||
go func() {
|
||||
if err := handler(); err != nil {
|
||||
d.Logger.Error().Stack().Err(err).Msgf("pause task handle failed, task id: %s", task.ID)
|
||||
}
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -923,6 +939,8 @@ func (d *Downloader) buildFetcher(url string) (fetcher.Fetcher, error) {
|
||||
|
||||
func initTask(task *Task) {
|
||||
task.timer = util.NewTimer(task.Progress.Used)
|
||||
|
||||
task.statusLock = &sync.Mutex{}
|
||||
task.lock = &sync.Mutex{}
|
||||
task.speedArr = make([]int64, 0)
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ type Task struct {
|
||||
fetcherBuilder fetcher.FetcherBuilder
|
||||
fetcher fetcher.Fetcher
|
||||
timer *util.Timer
|
||||
statusLock *sync.Mutex
|
||||
lock *sync.Mutex
|
||||
speedArr []int64
|
||||
}
|
||||
|
||||
@@ -71,6 +71,13 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- Add android:stopWithTask option only when necessary. -->
|
||||
|
||||
@@ -99,20 +99,14 @@ class ProxyConfig {
|
||||
|
||||
@JsonSerializable()
|
||||
class ExtraConfigBt {
|
||||
List<String> trackerSubscribeUrls;
|
||||
List<String> subscribeTrackers;
|
||||
bool autoUpdateTrackers;
|
||||
List<String> trackerSubscribeUrls = [];
|
||||
List<String> subscribeTrackers = [];
|
||||
bool autoUpdateTrackers = true;
|
||||
DateTime? lastTrackerUpdateTime;
|
||||
|
||||
List<String> customTrackers;
|
||||
List<String> customTrackers = [];
|
||||
|
||||
ExtraConfigBt({
|
||||
this.trackerSubscribeUrls = const [],
|
||||
this.subscribeTrackers = const [],
|
||||
this.autoUpdateTrackers = true,
|
||||
this.lastTrackerUpdateTime,
|
||||
this.customTrackers = const [],
|
||||
});
|
||||
ExtraConfigBt();
|
||||
|
||||
factory ExtraConfigBt.fromJson(Map<String, dynamic> json) =>
|
||||
_$ExtraConfigBtFromJson(json);
|
||||
|
||||
@@ -90,24 +90,20 @@ Map<String, dynamic> _$ProxyConfigToJson(ProxyConfig instance) =>
|
||||
};
|
||||
|
||||
ExtraConfigBt _$ExtraConfigBtFromJson(Map<String, dynamic> json) =>
|
||||
ExtraConfigBt(
|
||||
trackerSubscribeUrls: (json['trackerSubscribeUrls'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
subscribeTrackers: (json['subscribeTrackers'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
autoUpdateTrackers: json['autoUpdateTrackers'] as bool? ?? true,
|
||||
lastTrackerUpdateTime: json['lastTrackerUpdateTime'] == null
|
||||
ExtraConfigBt()
|
||||
..trackerSubscribeUrls = (json['trackerSubscribeUrls'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList()
|
||||
..subscribeTrackers = (json['subscribeTrackers'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList()
|
||||
..autoUpdateTrackers = json['autoUpdateTrackers'] as bool
|
||||
..lastTrackerUpdateTime = json['lastTrackerUpdateTime'] == null
|
||||
? null
|
||||
: DateTime.parse(json['lastTrackerUpdateTime'] as String),
|
||||
customTrackers: (json['customTrackers'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
: DateTime.parse(json['lastTrackerUpdateTime'] as String)
|
||||
..customTrackers = (json['customTrackers'] as List<dynamic>)
|
||||
.map((e) => e as String)
|
||||
.toList();
|
||||
|
||||
Map<String, dynamic> _$ExtraConfigBtToJson(ExtraConfigBt instance) {
|
||||
final val = <String, dynamic>{
|
||||
|
||||
@@ -12,7 +12,7 @@ class Options {
|
||||
Options({
|
||||
required this.name,
|
||||
required this.path,
|
||||
required this.selectFiles,
|
||||
this.selectFiles = const [],
|
||||
this.extra,
|
||||
});
|
||||
|
||||
|
||||
@@ -9,8 +9,10 @@ part of 'options.dart';
|
||||
Options _$OptionsFromJson(Map<String, dynamic> json) => Options(
|
||||
name: json['name'] as String,
|
||||
path: json['path'] as String,
|
||||
selectFiles:
|
||||
(json['selectFiles'] as List<dynamic>).map((e) => e as int).toList(),
|
||||
selectFiles: (json['selectFiles'] as List<dynamic>?)
|
||||
?.map((e) => e as int)
|
||||
.toList() ??
|
||||
const [],
|
||||
extra: json['extra'],
|
||||
);
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
}
|
||||
|
||||
Future<void> _toCreate(Uri uri) async {
|
||||
final path = uri.scheme == "magnet"
|
||||
final path = (uri.scheme == "magnet" || uri.scheme == "http" || uri.scheme == "https")
|
||||
? uri.toString()
|
||||
: (await toFile(uri.toString())).path;
|
||||
await Get.rootDelegate.offAndToNamed(Routes.CREATE, arguments: path);
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:rounded_loading_button/rounded_loading_button.dart';
|
||||
import 'package:rounded_loading_button_plus/rounded_loading_button.dart';
|
||||
|
||||
import '../../../../api/api.dart';
|
||||
import '../../../../api/model/create_task.dart';
|
||||
|
||||
@@ -7,21 +7,21 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gopeed/app/views/text_button_loading.dart';
|
||||
import '../../../../api/model/update_extension_settings.dart';
|
||||
import '../../../../util/mac_secure_util.dart';
|
||||
import '../../../../util/message.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:rounded_loading_button/rounded_loading_button.dart';
|
||||
import 'package:rounded_loading_button_plus/rounded_loading_button.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../../api/api.dart';
|
||||
import '../../../../api/model/extension.dart';
|
||||
import '../../../../api/model/install_extension.dart';
|
||||
import '../../../../api/model/switch_extension.dart';
|
||||
import '../../../../api/model/update_extension_settings.dart';
|
||||
import '../../../../util/mac_secure_util.dart';
|
||||
import '../../../../util/message.dart';
|
||||
import '../../../../util/util.dart';
|
||||
import '../../../views/icon_button_loading.dart';
|
||||
import '../../../views/responsive_builder.dart';
|
||||
import '../../../views/text_button_loading.dart';
|
||||
import '../controllers/extension_controller.dart';
|
||||
|
||||
class ExtensionView extends GetView<ExtensionController> {
|
||||
|
||||
@@ -15,6 +15,7 @@ import '../../../../util/package_info.dart';
|
||||
import '../../../../util/util.dart';
|
||||
import '../../../views/check_list_view.dart';
|
||||
import '../../../views/directory_selector.dart';
|
||||
import '../../../views/open_in_new.dart';
|
||||
import '../../../views/outlined_button_loading.dart';
|
||||
import '../../app/controllers/app_controller.dart';
|
||||
import '../controllers/setting_controller.dart';
|
||||
@@ -93,6 +94,15 @@ class SettingView extends GetView<SettingController> {
|
||||
],
|
||||
);
|
||||
});
|
||||
buildBrowserExtension() {
|
||||
return ListTile(
|
||||
title: Text('browserExtension'.tr),
|
||||
subtitle: const OpenInNew(
|
||||
text: "Chrome",
|
||||
url:
|
||||
"https://chromewebstore.google.com/detail/gopeed/mijpgljlfcapndmchhjffkpckknofcnd",
|
||||
));
|
||||
}
|
||||
|
||||
// http config items start
|
||||
final httpConfig = downloaderCfg.value.protocolConfig.http;
|
||||
@@ -138,9 +148,8 @@ class SettingView extends GetView<SettingController> {
|
||||
],
|
||||
);
|
||||
});
|
||||
final buildHttpUseServerCtime = _buildConfigItem(
|
||||
'useServerCtime'.tr, () => httpConfig.useServerCtime.toString(),
|
||||
(Key key) {
|
||||
final buildHttpUseServerCtime = _buildConfigItem('useServerCtime'.tr,
|
||||
() => httpConfig.useServerCtime ? 'on'.tr : 'off'.tr, (Key key) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Switch(
|
||||
@@ -688,8 +697,11 @@ class SettingView extends GetView<SettingController> {
|
||||
Text('general'.tr),
|
||||
Card(
|
||||
child: Column(
|
||||
children: _addDivider(
|
||||
[buildDownloadDir(), buildMaxRunning()]),
|
||||
children: _addDivider([
|
||||
buildDownloadDir(),
|
||||
buildMaxRunning(),
|
||||
buildBrowserExtension()
|
||||
]),
|
||||
)),
|
||||
const Text('HTTP'),
|
||||
Card(
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class OpenInNew extends StatelessWidget {
|
||||
final String text;
|
||||
final String url;
|
||||
|
||||
const OpenInNew({super.key, required this.text, required this.url});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Get.theme.colorScheme.background,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize
|
||||
.min, // Set the row's size to be as small as possible
|
||||
children: <Widget>[
|
||||
Text(text),
|
||||
const SizedBox(
|
||||
width: 4), // Add some space between the text and the icon
|
||||
const Icon(
|
||||
Icons.open_in_new,
|
||||
size: 14,
|
||||
), // The icon is after the text
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import 'package:hive/hive.dart';
|
||||
import 'entity.dart';
|
||||
|
||||
const String _startConfig = 'startConfig';
|
||||
const String _lastRunningConfig = 'lastRunningConfig';
|
||||
const String _windowState = 'windowState';
|
||||
const String _bookmark = 'bookmark';
|
||||
const String _createHistory = 'createHistory';
|
||||
@@ -53,6 +54,15 @@ class Database {
|
||||
_startConfig, (json) => StartConfigEntity.fromJson(json));
|
||||
}
|
||||
|
||||
void saveLastRunningConfig(StartConfigEntity entity) {
|
||||
save<StartConfigEntity>(_lastRunningConfig, entity);
|
||||
}
|
||||
|
||||
StartConfigEntity? getLastRunningConfig() {
|
||||
return get<StartConfigEntity>(
|
||||
_lastRunningConfig, (json) => StartConfigEntity.fromJson(json));
|
||||
}
|
||||
|
||||
/// Patch non-null fields with the original value
|
||||
void saveWindowState(WindowStateEntity entity) {
|
||||
final state = getWindowState();
|
||||
|
||||
@@ -88,5 +88,6 @@ const enUS = {
|
||||
'thanks': 'Thanks',
|
||||
'thanksDesc':
|
||||
'Thanks to all the contributors who have helped build and develop the Gopeed community!',
|
||||
'browserExtension': 'Browser Extension',
|
||||
},
|
||||
};
|
||||
@@ -60,5 +60,6 @@ const faIR = {
|
||||
'thanks': 'تشکر',
|
||||
'thanksDesc':
|
||||
'از تمامی افرادی که در ساخت و توسعهی جامعهی Gopeed مشارکت کردهاند، سپاسگزاری میکنیم!',
|
||||
'browserExtension': 'فایل های دانلود شده را نگه دارد',
|
||||
}
|
||||
};
|
||||
@@ -61,5 +61,6 @@ const jaJP = {
|
||||
'newVersionLater': '後で',
|
||||
'thanks': '感謝',
|
||||
'thanksDesc': 'Gopeedコミュニティの建設に協力してくださったすべての貢献者の方々に感謝します!',
|
||||
'browserExtension': 'ブラウザ拡張機能',
|
||||
}
|
||||
};
|
||||
@@ -76,5 +76,6 @@ const ruRU = {
|
||||
'thanks': 'Благодарности',
|
||||
'thanksDesc':
|
||||
'Благодарим всех участников за их вклад в строительство и развитие сообщества Gopeed!',
|
||||
'browserExtension': 'Расширение браузера',
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,95 @@
|
||||
const trTR = {
|
||||
'tr_TR': {
|
||||
'label': 'Türkçe',
|
||||
'error': 'Hata',
|
||||
'tip': 'İpucu',
|
||||
'confirm': 'Onayla',
|
||||
'cancel': 'İptal',
|
||||
'on': 'Açık',
|
||||
'off': 'Kapalı',
|
||||
'selectAll': 'Hepsini seç',
|
||||
'task': 'Görevler',
|
||||
'downloading': 'indiriliyor',
|
||||
'downloaded': 'indirildi',
|
||||
'setting': 'Ayarlar',
|
||||
'donate': 'Bağış',
|
||||
'exit': 'Çık',
|
||||
'create': 'Görev oluştur',
|
||||
'directDownload': 'Doğrudan indir',
|
||||
'advancedOptions': 'Gelişmiş ayarlar',
|
||||
'downloadLink': 'İndirme bağlantısı',
|
||||
'downloadLinkValid': 'Lütfen indirme bağlantısını girin',
|
||||
'downloadLinkHit':
|
||||
'Lütfen indirme bağlantısını girin, HTTP/HTTPS/MAGNET supported@append',
|
||||
'downloadLinkHitDesktop':
|
||||
', veya torrent dosyasını doğrudan buraya sürükleyin',
|
||||
'download': 'İndir',
|
||||
'noFileSelected': 'Devam etmek için lütfen en az bir dosya seçin.',
|
||||
'noStoragePermission': 'Depolama izni gerekli',
|
||||
'selectFile': 'Dosya seç',
|
||||
'rename': 'Yeniden adlandır',
|
||||
'basic': 'Temel',
|
||||
'advanced': 'Gelişmiş',
|
||||
'general': 'Genel',
|
||||
'downloadDir': 'İndirme dizini',
|
||||
'downloadDirValid': 'Lütfen indirme dizinini seçin',
|
||||
'connections': 'Bağlantılar',
|
||||
'useServerCtime': 'Dosya oluşturma için sunucu saatini kullan',
|
||||
'maxRunning': 'Maksimum çalışan görevler',
|
||||
'items': '@count say',
|
||||
'subscribeTracker': 'İzleyiciye abone ol',
|
||||
'subscribeFail':
|
||||
'Abone olunamadı, lütfen ağı kontrol edin veya daha sonra tekrar deneyin',
|
||||
'update': 'Güncelleme',
|
||||
'updateDaily': 'Günlük güncelleme',
|
||||
'lastUpdate': 'Son güncelleme: @time',
|
||||
'addTracker': 'İzleyici ekle',
|
||||
'addTrackerHit':
|
||||
'Lütfen her satıra bir tane olmak üzere izleyici sunucusu bağlantısını girin',
|
||||
'ui': 'UI',
|
||||
'theme': 'Tema',
|
||||
'themeSystem': 'Sistem',
|
||||
'themeLight': 'Açık',
|
||||
'themeDark': 'Koyu',
|
||||
'locale': 'Dil',
|
||||
'about': 'Hakkında',
|
||||
'homepage': 'Anasayfa',
|
||||
'version': 'Sürüm',
|
||||
'protocol': 'Protokol',
|
||||
'port': 'Bağlantı noktası',
|
||||
'apiToken': 'API anahtarı',
|
||||
'notSet': 'AYARLAMA',
|
||||
'set': 'AYARLA',
|
||||
'effectAfterRestart': 'Yeniden başlatma sonrası etki eder',
|
||||
'startAll': 'Hepsini başlat',
|
||||
'pauseAll': 'Hepsini durdur',
|
||||
'deleteTask': 'Görevleri sil',
|
||||
'deleteTaskTip': 'İndirilen dosyaları sakla',
|
||||
'delete': 'Sil',
|
||||
'newVersionTitle': 'Yeni sürümü keşfet @version',
|
||||
'newVersionUpdate': 'Şimdi güncelle',
|
||||
'newVersionLater': 'Sonra',
|
||||
'extensions': 'Uzantılar',
|
||||
'extensionInstallUrl': 'İndirme bağlantısı',
|
||||
'extensionInstallSuccess': 'Başarıyla indirildi',
|
||||
'extensionUpdateSuccess': 'Başarıyla güncellendi',
|
||||
'extensionDelete': 'Uzantıyı sil',
|
||||
'extensionAlreadyLatest': 'Bu zaten en son sürüm',
|
||||
'extensionFind': 'Uzantıları ara',
|
||||
'extensionDevelop': 'Uzantıları Geliştirin',
|
||||
'history': 'Geçmiş',
|
||||
'clearHistory': 'Geçmişi temizle',
|
||||
'noHistoryFound': 'Geçmiş bulunamadı',
|
||||
'serviceTitle': 'Hizmet indir',
|
||||
'serviceText': 'Çalışıyor',
|
||||
'network': 'Ağ',
|
||||
'proxy': 'Vekil',
|
||||
'server': 'Sunucu',
|
||||
'username': 'Kullanıcı adı',
|
||||
'password': 'Şifre',
|
||||
'thanks': 'Teşekkürler',
|
||||
'thanksDesc':
|
||||
'Gopeed topluluğunun oluşmasına ve gelişmesine yardımcı olan tüm katılımcılara teşekkürler!',
|
||||
'browserExtension': 'Tarayıcı Uzantısı',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
const viVN = {
|
||||
'vi_VN': {
|
||||
'label': 'Tiếng Việt',
|
||||
'error': 'Lỗi',
|
||||
'tip': 'Mẹo',
|
||||
'confirm': 'Xác nhận',
|
||||
'cancel': 'Hủy',
|
||||
'on': 'Bật',
|
||||
'off': 'Tắt',
|
||||
'selectAll': 'Chọn tất cả',
|
||||
'task': 'Nhiệm vụ',
|
||||
'downloading': 'đang tải',
|
||||
'downloaded': 'đã tải',
|
||||
'setting': 'Cài đặt',
|
||||
'donate': 'Ủng hộ',
|
||||
'exit': 'Thoát',
|
||||
'create': 'Tạo nhiệm vụ',
|
||||
'directDownload': 'Tải trực tiếp',
|
||||
'advancedOptions': 'Tùy chọn nâng cao',
|
||||
'downloadLink': 'Liên kết tải về',
|
||||
'downloadLinkValid': 'Vui lòng nhập liên kết tải về',
|
||||
'downloadLinkHit':
|
||||
'Vui lòng nhập liên kết tải về, hỗ trợ HTTP/HTTPS/MAGNET@append',
|
||||
'downloadLinkHitDesktop': ', hoặc kéo tệp torrent vào đây trực tiếp',
|
||||
'download': 'Tải về',
|
||||
'noFileSelected': 'Vui lòng chọn ít nhất một tệp để tiếp tục.',
|
||||
'noStoragePermission': 'Yêu cầu quyền lưu trữ',
|
||||
'selectFile': 'Chọn tệp',
|
||||
'rename': 'Đổi tên',
|
||||
'basic': 'Cơ bản',
|
||||
'advanced': 'Nâng cao',
|
||||
'general': 'Chung',
|
||||
'downloadDir': 'Thư mục tải về',
|
||||
'downloadDirValid': 'Vui lòng chọn thư mục tải về',
|
||||
'connections': 'Kết nối',
|
||||
'useServerCtime': 'Sử dụng thời gian máy chủ cho việc tạo tệp',
|
||||
'maxRunning': 'Số nhiệm vụ tối đa',
|
||||
'items': '@count mục',
|
||||
'subscribeTracker': 'Theo dõi Tracker',
|
||||
'subscribeFail':
|
||||
'Theo dõi thất bại, vui lòng kiểm tra kết nối mạng hoặc thử lại sau',
|
||||
'update': 'Cập nhật',
|
||||
'updateDaily': 'Cập nhật hàng ngày',
|
||||
'lastUpdate': 'Cập nhật lần cuối: @time',
|
||||
'addTracker': 'Thêm Tracker',
|
||||
'addTrackerHit': 'Vui lòng nhập địa chỉ máy chủ tracker, mỗi dòng một',
|
||||
'ui': 'Giao diện',
|
||||
'theme': 'Chủ đề',
|
||||
'themeSystem': 'Hệ thống',
|
||||
'themeLight': 'Sáng',
|
||||
'themeDark': 'Tối',
|
||||
'locale': 'Ngôn ngữ',
|
||||
'about': 'Về chúng tôi',
|
||||
'homepage': 'Trang chủ',
|
||||
'version': 'Phiên bản',
|
||||
'protocol': 'Giao thức',
|
||||
'port': 'Cổng',
|
||||
'apiToken': 'Mã API',
|
||||
'notSet': 'Chưa đặt',
|
||||
'set': 'Đặt',
|
||||
'effectAfterRestart': 'Hiệu lực sau khi khởi động lại',
|
||||
'startAll': 'Bắt đầu tất cả',
|
||||
'pauseAll': 'Tạm dừng tất cả',
|
||||
'deleteTask': 'Xóa nhiệm vụ',
|
||||
'deleteTaskTip': 'Giữ các tệp đã tải về',
|
||||
'delete': 'Xóa',
|
||||
'newVersionTitle': 'Khám phá phiên bản mới @version',
|
||||
'newVersionUpdate': 'Cập nhật ngay',
|
||||
'newVersionLater': 'Sau',
|
||||
'extensions': 'Tiện ích mở rộng',
|
||||
'extensionInstallUrl': 'Liên kết cài đặt',
|
||||
'extensionInstallSuccess': 'Cài đặt thành công',
|
||||
'extensionUpdateSuccess': 'Cập nhật thành công',
|
||||
'extensionDelete': 'Xóa tiện ích mở rộng',
|
||||
'extensionAlreadyLatest': 'Đây đã là phiên bản mới nhất',
|
||||
'extensionFind': 'Tìm tiện ích mở rộng',
|
||||
'extensionDevelop': 'Phát triển tiện ích mở rộng',
|
||||
'history': 'Lịch sử',
|
||||
'clearHistory': 'Xóa lịch sử',
|
||||
'noHistoryFound': 'Không tìm thấy lịch sử',
|
||||
'serviceTitle': 'Dịch vụ Tải xuống',
|
||||
'serviceText': 'Đang chạy',
|
||||
'network': 'Mạng',
|
||||
'proxy': 'Proxy',
|
||||
'server': 'Máy chủ',
|
||||
'username': 'Tên đăng nhập',
|
||||
'password': 'Mật khẩu',
|
||||
'thanks': 'Cảm ơn',
|
||||
'thanksDesc':
|
||||
'Cảm ơn tất cả những người đóng góp đã giúp xây dựng và phát triển cộng đồng Gopeed!',
|
||||
'browserExtension': 'Tiện ích mở rộng trình duyệt',
|
||||
},
|
||||
};
|
||||
@@ -85,5 +85,6 @@ const zhCN = {
|
||||
'password': '密码',
|
||||
'thanks': '鸣谢',
|
||||
'thanksDesc': '感谢所有为 Gopeed 社区建设添砖加瓦的贡献者们!',
|
||||
'browserExtension': '浏览器扩展',
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
const zhTW = {
|
||||
"zh_TW": {
|
||||
'label': '中文 (繁體) ',
|
||||
'label': '中文 (正體) ',
|
||||
'error': '錯誤',
|
||||
'tip': '提示',
|
||||
'confirm': '確定',
|
||||
@@ -12,38 +12,38 @@ const zhTW = {
|
||||
'downloading': '下載中',
|
||||
'downloaded': '已完成',
|
||||
'setting': '設定',
|
||||
'donate': '斗內',
|
||||
'donate': '鬥內',
|
||||
'exit': '離開',
|
||||
'create': '新增任務',
|
||||
'directDownload': '直接下載',
|
||||
'advancedOptions': '進階選項',
|
||||
'downloadLink': '下載鏈接',
|
||||
'downloadLinkValid': '請輸入下載鏈接',
|
||||
'downloadLinkHit': '請輸入下載鏈接,支援 HTTP/HTTPS/MAGNET@append',
|
||||
'downloadLinkHitDesktop': ',也可以通過拖拽Torrent文件至此以新增任務',
|
||||
'downloadLink': '下載連結',
|
||||
'downloadLinkValid': '請輸入下載連結',
|
||||
'downloadLinkHit': '請輸入下載連結,支援 HTTP/HTTPS/MAGNET@append',
|
||||
'downloadLinkHitDesktop': ',也可以通過拖拽Torrent檔至此以新增任務',
|
||||
'download': '下載',
|
||||
'noFileSelected': '沒有選取的文件',
|
||||
'noStoragePermission': '沒有存儲權限',
|
||||
'selectFile': '選擇文件',
|
||||
'noFileSelected': '沒有選取的檔案',
|
||||
'noStoragePermission': '沒有存儲權',
|
||||
'selectFile': '選擇檔案',
|
||||
'rename': '重命名',
|
||||
'basic': '一般',
|
||||
'advanced': '進階',
|
||||
'general': '通用設定',
|
||||
'downloadDir': '下載目録',
|
||||
'downloadDirValid': '請選擇下載目録',
|
||||
'downloadDir': '下載目錄',
|
||||
'downloadDirValid': '請選擇下載目錄',
|
||||
'connections': '同時連接數',
|
||||
'useServerCtime': '使用伺服器時間作為檔案建立時間',
|
||||
'maxRunning': '最大同時下載數',
|
||||
'items': '@count 項',
|
||||
'subscribeTracker': '已訂閲的追蹤者列表',
|
||||
'subscribeFail': '訂閲失敗',
|
||||
'subscribeTracker': '已訂閱的追蹤者列表',
|
||||
'subscribeFail': '訂閱失敗',
|
||||
'update': '更新',
|
||||
'updateDaily': '每天自動更新',
|
||||
'lastUpdate': '上次更新時間: @time',
|
||||
'addTracker': '增加新的追蹤者',
|
||||
'addTrackerHit': '請輸入追蹤者服務器地址,每行一條',
|
||||
'addTrackerHit': '請輸入追蹤者伺服器地址,每行一條',
|
||||
'ui': '介面',
|
||||
'theme': '佈景主題',
|
||||
'theme': '主題',
|
||||
'themeSystem': '跟隨系統',
|
||||
'themeLight': '亮色主題',
|
||||
'themeDark': '深色主題',
|
||||
@@ -51,28 +51,28 @@ const zhTW = {
|
||||
'about': '關於',
|
||||
'homepage': '訪問主頁',
|
||||
'version': '版本資訊',
|
||||
'protocol': '端口設定',
|
||||
'port': '端口',
|
||||
'apiToken': '接口秘鑰',
|
||||
'protocol': '通信協定',
|
||||
'port': '埠',
|
||||
'apiToken': 'API令牌',
|
||||
'notSet': '未設定',
|
||||
'set': '已設定',
|
||||
'effectAfterRestart': '重啟後生效',
|
||||
'startAll': '全部開始',
|
||||
'pauseAll': '全部暫停',
|
||||
'deleteTask': '刪除任務',
|
||||
'deleteTaskTip': '保留已經下載的文件',
|
||||
'deleteTaskTip': '保留已經下載的檔案',
|
||||
'delete': '刪除',
|
||||
'newVersionTitle': '現新版本 @version 已發佈',
|
||||
'newVersionTitle': '新版本 @version 已發佈',
|
||||
'newVersionUpdate': '下載',
|
||||
'newVersionLater': '取消',
|
||||
'extensions': '擴充程序',
|
||||
'extensionInstallUrl': '安裝URL',
|
||||
'extensions': '擴充程式',
|
||||
'extensionInstallUrl': '安裝連結',
|
||||
'extensionInstallSuccess': '安裝成功',
|
||||
'extensionUpdateSuccess': '更新完成',
|
||||
'extensionDelete': '解除安裝',
|
||||
'extensionAlreadyLatest': '已是最新版本',
|
||||
'extensionFind': '取得擴充程序',
|
||||
'extensionDevelop': '開發擴充程序',
|
||||
'extensionFind': '取得擴充程式',
|
||||
'extensionDevelop': '開發擴充程式',
|
||||
'history': '歷史記錄',
|
||||
'clearHistory': '清空記錄',
|
||||
'noHistoryFound': '還沒有記錄',
|
||||
@@ -83,7 +83,8 @@ const zhTW = {
|
||||
'server': '伺服器',
|
||||
'username': '名稱',
|
||||
'password': '密碼',
|
||||
'thanks': '鳴謝',
|
||||
'thanksDesc': '感謝所有為 Gopeed 社群建設添磚加瓦的貢獻者們!'
|
||||
'thanks': '感謝',
|
||||
'thanksDesc': '感謝所有為 Gopeed 社區建設添磚加瓦的貢獻者們!',
|
||||
'browserExtension': '瀏覽器擴充程式',
|
||||
}
|
||||
};
|
||||
@@ -6,6 +6,8 @@ import 'package:gopeed/i18n/langs/zh_tw.dart';
|
||||
import 'langs/en_us.dart';
|
||||
import 'langs/ru_ru.dart';
|
||||
import 'langs/zh_cn.dart';
|
||||
import 'langs/vi_vn.dart';
|
||||
import 'langs/tr_tr.dart';
|
||||
|
||||
final messages = _Messages();
|
||||
|
||||
@@ -19,5 +21,7 @@ class _Messages extends Translations {
|
||||
...zhTW,
|
||||
...faIR,
|
||||
...jaJP,
|
||||
...viVN,
|
||||
...trTR,
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
@@ -8,6 +9,7 @@ import 'app/modules/app/controllers/app_controller.dart';
|
||||
import 'app/modules/app/views/app_view.dart';
|
||||
import 'core/libgopeed_boot.dart';
|
||||
import 'database/database.dart';
|
||||
import 'database/entity.dart';
|
||||
import 'i18n/message.dart';
|
||||
import 'util/locale_manager.dart';
|
||||
import 'util/log_util.dart';
|
||||
@@ -52,8 +54,23 @@ Future<void> init() async {
|
||||
try {
|
||||
await controller.loadStartConfig();
|
||||
final startCfg = controller.startConfig.value;
|
||||
controller.runningPort.value = await LibgopeedBoot.instance.start(startCfg);
|
||||
api.init(startCfg.network, controller.runningAddress(), startCfg.apiToken);
|
||||
// When the app is closed by swiping on the mobile, the backend server is actually still running, don't need to start again.
|
||||
final isRunning =
|
||||
Util.isMobile() && (await FlutterForegroundTask.isRunningService);
|
||||
if (!isRunning) {
|
||||
controller.runningPort.value =
|
||||
await LibgopeedBoot.instance.start(startCfg);
|
||||
api.init(
|
||||
startCfg.network, controller.runningAddress(), startCfg.apiToken);
|
||||
Database.instance.saveLastRunningConfig(StartConfigEntity(
|
||||
network: startCfg.network,
|
||||
address: controller.runningAddress(),
|
||||
apiToken: startCfg.apiToken));
|
||||
} else {
|
||||
final lastRunningConfig = Database.instance.getLastRunningConfig()!;
|
||||
api.init(lastRunningConfig.network, lastRunningConfig.address,
|
||||
lastRunningConfig.apiToken);
|
||||
}
|
||||
} catch (e) {
|
||||
logger.e("libgopeed init fail", e);
|
||||
}
|
||||
|
||||
+256
-248
File diff suppressed because it is too large.
Load diff
@@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.5.4+1
|
||||
version: 1.5.6+1
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
@@ -44,7 +44,7 @@ dependencies:
|
||||
path_provider: ^2.1.1
|
||||
file_picker: 5.3.1
|
||||
macos_secure_bookmarks: ^0.2.1
|
||||
rounded_loading_button: ^2.1.0
|
||||
rounded_loading_button_plus: ^3.0.1
|
||||
url_launcher: ^6.1.6
|
||||
logger: ^1.3.0
|
||||
desktop_drop: ^0.4.3
|
||||
|
||||
Reference in new issue
Block a user