mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-11 02:50:27 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4935dcd0e6 | ||
|
|
e8fe6ad550 | ||
|
|
db4003ad4f | ||
|
|
0a4be165a5 | ||
|
|
c62867e3ef |
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
name-template: 'v1.2.0 🌈'
|
name-template: 'v$NEXT_PATCH_VERSION 🌈'
|
||||||
tag-template: 'v1.2.0'
|
tag-template: 'v$NEXT_PATCH_VERSION'
|
||||||
categories:
|
categories:
|
||||||
- title: '🆕 Features'
|
- title: '🆕 Features'
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@@ -324,13 +324,25 @@ jobs:
|
|||||||
needs: [get-release]
|
needs: [get-release]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
VERSION: ${{ needs.get-release.outputs.tag_name }}
|
||||||
run: |
|
- name: Set up QEMU
|
||||||
tag=liwei2633/gopeed:${VERSION:1}
|
uses: docker/setup-qemu-action@v2
|
||||||
docker build -t $tag .
|
- name: Set up Docker Buildx
|
||||||
docker login -u liwei2633 -p ${{ secrets.DOCKER_PASSWORD }}
|
uses: docker/setup-buildx-action@v2
|
||||||
docker push $tag
|
- name: Login to DockerHub
|
||||||
docker tag $tag liwei2633/gopeed:latest
|
uses: docker/login-action@v1
|
||||||
docker push liwei2633/gopeed:latest
|
with:
|
||||||
|
username: liwei2633
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
platforms: |
|
||||||
|
linux/386
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
tags: |
|
||||||
|
liwei2633:latest
|
||||||
|
liwei2633:${{ env.VERSION }}
|
||||||
@@ -62,7 +62,7 @@ services:
|
|||||||
Use the command below to start container:
|
Use the command below to start container:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Access Gopeed
|
#### Access Gopeed
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ services:
|
|||||||
输入以下指令启动容器:
|
输入以下指令启动容器:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 访问服务
|
#### 访问服务
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ func (f *Fetcher) Create(res *base.Resource, opts *base.Options) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if opts.Extra == nil {
|
if opts.Extra == nil {
|
||||||
opts.Extra = &fhttp.ReqExtra{}
|
opts.Extra = &fhttp.OptsExtra{}
|
||||||
}
|
}
|
||||||
extra := opts.Extra.(*fhttp.OptsExtra)
|
extra := opts.Extra.(*fhttp.OptsExtra)
|
||||||
if extra.Connections == 0 {
|
if extra.Connections == 0 {
|
||||||
|
|||||||
@@ -142,12 +142,16 @@ func doDownloadReady(f fetcher.Fetcher, listener net.Listener, connections int,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
opts = &base.Options{
|
var extra any = nil
|
||||||
Name: test.DownloadName,
|
if connections > 0 {
|
||||||
Path: test.Dir,
|
extra = http.OptsExtra{
|
||||||
Extra: http.OptsExtra{
|
|
||||||
Connections: connections,
|
Connections: connections,
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
opts = &base.Options{
|
||||||
|
Name: test.DownloadName,
|
||||||
|
Path: test.Dir,
|
||||||
|
Extra: extra,
|
||||||
}
|
}
|
||||||
err = fetcher.Create(res, opts)
|
err = fetcher.Create(res, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -102,7 +102,9 @@ func (d *Downloader) Setup() error {
|
|||||||
|
|
||||||
current := task.fetcher.Progress().TotalDownloaded()
|
current := task.fetcher.Progress().TotalDownloaded()
|
||||||
task.Progress.Used = task.timer.Used()
|
task.Progress.Used = task.timer.Used()
|
||||||
task.Progress.Speed = current - task.Progress.Downloaded
|
currUsedTime := float64(d.refreshInterval) / 1000
|
||||||
|
currSpeed := int64(float64(current-task.Progress.Downloaded) / currUsedTime)
|
||||||
|
task.Progress.Speed = (task.Progress.Speed + currSpeed) / 2
|
||||||
task.Progress.Downloaded = current
|
task.Progress.Downloaded = current
|
||||||
d.emit(EventKeyProgress, task)
|
d.emit(EventKeyProgress, task)
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func (cfg *DownloaderConfig) Init() *DownloaderConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cfg.RefreshInterval == 0 {
|
if cfg.RefreshInterval == 0 {
|
||||||
cfg.RefreshInterval = 1000
|
cfg.RefreshInterval = 350
|
||||||
}
|
}
|
||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ android {
|
|||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion 29
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ class CreateTask {
|
|||||||
this.opts,
|
this.opts,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory CreateTask.fromJson(Map<String, dynamic> json) =>
|
factory CreateTask.fromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) =>
|
||||||
_$CreateTaskFromJson(json);
|
_$CreateTaskFromJson(json);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$CreateTaskToJson(this);
|
Map<String, dynamic> toJson() => _$CreateTaskToJson(this);
|
||||||
|
|||||||
@@ -64,12 +64,12 @@ ExtraConfigBt _$ExtraConfigBtFromJson(Map<String, dynamic> json) =>
|
|||||||
..trackerSubscribeUrls = (json['trackerSubscribeUrls'] as List<dynamic>)
|
..trackerSubscribeUrls = (json['trackerSubscribeUrls'] as List<dynamic>)
|
||||||
.map((e) => e as String)
|
.map((e) => e as String)
|
||||||
.toList()
|
.toList()
|
||||||
..lastTrackerUpdateTime = json['lastTrackerUpdateTime'] == null
|
|
||||||
? null
|
|
||||||
: DateTime.parse(json['lastTrackerUpdateTime'] as String)
|
|
||||||
..subscribeTrackers = (json['subscribeTrackers'] as List<dynamic>)
|
..subscribeTrackers = (json['subscribeTrackers'] as List<dynamic>)
|
||||||
.map((e) => e as String)
|
.map((e) => e as String)
|
||||||
.toList()
|
.toList()
|
||||||
|
..lastTrackerUpdateTime = json['lastTrackerUpdateTime'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json['lastTrackerUpdateTime'] as String)
|
||||||
..customTrackers = (json['customTrackers'] as List<dynamic>)
|
..customTrackers = (json['customTrackers'] as List<dynamic>)
|
||||||
.map((e) => e as String)
|
.map((e) => e as String)
|
||||||
.toList();
|
.toList();
|
||||||
@@ -77,6 +77,7 @@ ExtraConfigBt _$ExtraConfigBtFromJson(Map<String, dynamic> json) =>
|
|||||||
Map<String, dynamic> _$ExtraConfigBtToJson(ExtraConfigBt instance) {
|
Map<String, dynamic> _$ExtraConfigBtToJson(ExtraConfigBt instance) {
|
||||||
final val = <String, dynamic>{
|
final val = <String, dynamic>{
|
||||||
'trackerSubscribeUrls': instance.trackerSubscribeUrls,
|
'trackerSubscribeUrls': instance.trackerSubscribeUrls,
|
||||||
|
'subscribeTrackers': instance.subscribeTrackers,
|
||||||
};
|
};
|
||||||
|
|
||||||
void writeNotNull(String key, dynamic value) {
|
void writeNotNull(String key, dynamic value) {
|
||||||
@@ -87,7 +88,6 @@ Map<String, dynamic> _$ExtraConfigBtToJson(ExtraConfigBt instance) {
|
|||||||
|
|
||||||
writeNotNull('lastTrackerUpdateTime',
|
writeNotNull('lastTrackerUpdateTime',
|
||||||
instance.lastTrackerUpdateTime?.toIso8601String());
|
instance.lastTrackerUpdateTime?.toIso8601String());
|
||||||
val['subscribeTrackers'] = instance.subscribeTrackers;
|
|
||||||
val['customTrackers'] = instance.customTrackers;
|
val['customTrackers'] = instance.customTrackers;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,12 @@ import 'package:json_annotation/json_annotation.dart';
|
|||||||
|
|
||||||
part 'options.g.dart';
|
part 'options.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable(explicitToJson: true, genericArgumentFactories: true)
|
||||||
class Options {
|
class Options {
|
||||||
String name;
|
String name;
|
||||||
String path;
|
String path;
|
||||||
List<int> selectFiles;
|
List<int> selectFiles;
|
||||||
|
Map<String, dynamic>? extra;
|
||||||
|
|
||||||
Options({
|
Options({
|
||||||
required this.name,
|
required this.name,
|
||||||
@@ -19,3 +20,14 @@ class Options {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() => _$OptionsToJson(this);
|
Map<String, dynamic> toJson() => _$OptionsToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class OptsExtraHttp {
|
||||||
|
int connections = 0;
|
||||||
|
|
||||||
|
OptsExtraHttp();
|
||||||
|
|
||||||
|
factory OptsExtraHttp.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$OptsExtraHttpFromJson(json);
|
||||||
|
Map<String, dynamic> toJson() => _$OptsExtraHttpToJson(this);
|
||||||
|
}
|
||||||
@@ -11,10 +11,29 @@ Options _$OptionsFromJson(Map<String, dynamic> json) => Options(
|
|||||||
path: json['path'] as String,
|
path: json['path'] as String,
|
||||||
selectFiles:
|
selectFiles:
|
||||||
(json['selectFiles'] as List<dynamic>).map((e) => e as int).toList(),
|
(json['selectFiles'] as List<dynamic>).map((e) => e as int).toList(),
|
||||||
);
|
)..extra = json['extra'] as Map<String, dynamic>?;
|
||||||
|
|
||||||
Map<String, dynamic> _$OptionsToJson(Options instance) => <String, dynamic>{
|
Map<String, dynamic> _$OptionsToJson(Options instance) {
|
||||||
'name': instance.name,
|
final val = <String, dynamic>{
|
||||||
'path': instance.path,
|
'name': instance.name,
|
||||||
'selectFiles': instance.selectFiles,
|
'path': instance.path,
|
||||||
|
'selectFiles': instance.selectFiles,
|
||||||
|
};
|
||||||
|
|
||||||
|
void writeNotNull(String key, dynamic value) {
|
||||||
|
if (value != null) {
|
||||||
|
val[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeNotNull('extra', instance.extra);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
OptsExtraHttp _$OptsExtraHttpFromJson(Map<String, dynamic> json) =>
|
||||||
|
OptsExtraHttp()..connections = json['connections'] as int;
|
||||||
|
|
||||||
|
Map<String, dynamic> _$OptsExtraHttpToJson(OptsExtraHttp instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'connections': instance.connections,
|
||||||
};
|
};
|
||||||
@@ -2,17 +2,31 @@ import 'package:json_annotation/json_annotation.dart';
|
|||||||
|
|
||||||
part 'request.g.dart';
|
part 'request.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable(explicitToJson: true, genericArgumentFactories: true)
|
||||||
class Request {
|
class Request {
|
||||||
String url;
|
String url;
|
||||||
Map<String, dynamic>? extra;
|
Map<String, dynamic>? extra;
|
||||||
|
|
||||||
Request({
|
Request({
|
||||||
required this.url,
|
required this.url,
|
||||||
this.extra,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
factory Request.fromJson(Map<String, dynamic> json) =>
|
factory Request.fromJson(Map<String, dynamic> json) =>
|
||||||
_$RequestFromJson(json);
|
_$RequestFromJson(json);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$RequestToJson(this);
|
Map<String, dynamic> toJson() => _$RequestToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class ReqExtraHttp {
|
||||||
|
String method = 'GET';
|
||||||
|
Map<String, String> headers = {};
|
||||||
|
String body = '';
|
||||||
|
|
||||||
|
ReqExtraHttp();
|
||||||
|
|
||||||
|
factory ReqExtraHttp.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$ReqExtraHttpFromJson(json);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => _$ReqExtraHttpToJson(this);
|
||||||
|
}
|
||||||
@@ -8,8 +8,7 @@ part of 'request.dart';
|
|||||||
|
|
||||||
Request _$RequestFromJson(Map<String, dynamic> json) => Request(
|
Request _$RequestFromJson(Map<String, dynamic> json) => Request(
|
||||||
url: json['url'] as String,
|
url: json['url'] as String,
|
||||||
extra: json['extra'] as Map<String, dynamic>?,
|
)..extra = json['extra'] as Map<String, dynamic>?;
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$RequestToJson(Request instance) {
|
Map<String, dynamic> _$RequestToJson(Request instance) {
|
||||||
final val = <String, dynamic>{
|
final val = <String, dynamic>{
|
||||||
@@ -25,3 +24,15 @@ Map<String, dynamic> _$RequestToJson(Request instance) {
|
|||||||
writeNotNull('extra', instance.extra);
|
writeNotNull('extra', instance.extra);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReqExtraHttp _$ReqExtraHttpFromJson(Map<String, dynamic> json) => ReqExtraHttp()
|
||||||
|
..method = json['method'] as String
|
||||||
|
..headers = Map<String, String>.from(json['headers'] as Map)
|
||||||
|
..body = json['body'] as String;
|
||||||
|
|
||||||
|
Map<String, dynamic> _$ReqExtraHttpToJson(ReqExtraHttp instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'method': instance.method,
|
||||||
|
'headers': instance.headers,
|
||||||
|
'body': instance.body,
|
||||||
|
};
|
||||||
@@ -11,19 +11,19 @@ class Resource {
|
|||||||
int size;
|
int size;
|
||||||
bool range;
|
bool range;
|
||||||
List<FileInfo> files;
|
List<FileInfo> files;
|
||||||
Map<String, dynamic>? extra;
|
String hash;
|
||||||
|
|
||||||
Resource({
|
Resource(
|
||||||
required this.req,
|
{required this.req,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.range,
|
required this.range,
|
||||||
required this.files,
|
required this.files,
|
||||||
this.extra,
|
required this.hash});
|
||||||
});
|
|
||||||
|
|
||||||
factory Resource.fromJson(Map<String, dynamic> json) =>
|
factory Resource.fromJson(Map<String, dynamic> json) =>
|
||||||
_$ResourceFromJson(json);
|
_$ResourceFromJson(json);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$ResourceToJson(this);
|
Map<String, dynamic> toJson() => _$ResourceToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,27 +14,17 @@ Resource _$ResourceFromJson(Map<String, dynamic> json) => Resource(
|
|||||||
files: (json['files'] as List<dynamic>)
|
files: (json['files'] as List<dynamic>)
|
||||||
.map((e) => FileInfo.fromJson(e as Map<String, dynamic>))
|
.map((e) => FileInfo.fromJson(e as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList(),
|
||||||
extra: json['extra'] as Map<String, dynamic>?,
|
hash: json['hash'] as String,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$ResourceToJson(Resource instance) {
|
Map<String, dynamic> _$ResourceToJson(Resource instance) => <String, dynamic>{
|
||||||
final val = <String, dynamic>{
|
'req': instance.req.toJson(),
|
||||||
'req': instance.req.toJson(),
|
'name': instance.name,
|
||||||
'name': instance.name,
|
'size': instance.size,
|
||||||
'size': instance.size,
|
'range': instance.range,
|
||||||
'range': instance.range,
|
'files': instance.files.map((e) => e.toJson()).toList(),
|
||||||
'files': instance.files.map((e) => e.toJson()).toList(),
|
'hash': instance.hash,
|
||||||
};
|
};
|
||||||
|
|
||||||
void writeNotNull(String key, dynamic value) {
|
|
||||||
if (value != null) {
|
|
||||||
val[key] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
writeNotNull('extra', instance.extra);
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
FileInfo _$FileInfoFromJson(Map<String, dynamic> json) => FileInfo(
|
FileInfo _$FileInfoFromJson(Map<String, dynamic> json) => FileInfo(
|
||||||
name: json['name'] as String,
|
name: json['name'] as String,
|
||||||
|
|||||||
@@ -135,15 +135,12 @@ class SettingView extends GetView<SettingController> {
|
|||||||
controller: trackerUpdateController,
|
controller: trackerUpdateController,
|
||||||
child: Text('setting.update'.tr),
|
child: Text('setting.update'.tr),
|
||||||
),
|
),
|
||||||
Flexible(
|
Expanded(
|
||||||
child: SizedBox(
|
child: SwitchListTile(
|
||||||
width: 200,
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
child: SwitchListTile(
|
value: true,
|
||||||
controlAffinity: ListTileControlAffinity.leading,
|
onChanged: (bool value) {},
|
||||||
value: true,
|
title: Text('setting.updateDaily'.tr)),
|
||||||
onChanged: (bool value) {},
|
|
||||||
title: Text('setting.updateDaily'.tr)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -234,7 +231,8 @@ class SettingView extends GetView<SettingController> {
|
|||||||
title: Text('setting.homepage'.tr),
|
title: Text('setting.homepage'.tr),
|
||||||
subtitle: const Text('https://github.com/monkeyWie/gopeed'),
|
subtitle: const Text('https://github.com/monkeyWie/gopeed'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(Uri.parse('https://github.com/monkeyWie/gopeed'));
|
launchUrl(Uri.parse('https://github.com/monkeyWie/gopeed'),
|
||||||
|
mode: LaunchMode.externalApplication);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
buildVersion() => ListTile(
|
buildVersion() => ListTile(
|
||||||
|
|||||||
@@ -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.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.2.0+1
|
version: 1.2.2+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.6 <3.0.0"
|
sdk: ">=2.17.6 <3.0.0"
|
||||||
|
|||||||
Reference in new issue
Block a user