Compare commits

...
3 Commits
Author SHA1 Message Date
Li Wei 4935dcd0e6 ci: fix 2022-12-16 15:02:33 +08:00
Li Wei e8fe6ad550 ci: docker supports more platforms (#64) 2022-12-16 14:56:56 +08:00
Li Wei db4003ad4f fix: speed calculate (#63) 2022-12-16 14:53:07 +08:00
5 changed files with 33 additions and 28 deletions

No files matched your search

+20 -8
View File
@@ -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 }}
+3 -8
View File
@@ -102,14 +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()
downloaded := current - task.Progress.Downloaded currUsedTime := float64(d.refreshInterval) / 1000
usedTime := float64(d.refreshInterval) / 1000 currSpeed := int64(float64(current-task.Progress.Downloaded) / currUsedTime)
if downloaded == 0 { task.Progress.Speed = (task.Progress.Speed + currSpeed) / 2
task.Progress.Speed = int64(float64(task.Progress.Speed) / (usedTime * 1.55))
} else {
usedTime := float64(d.refreshInterval) / 1000
task.Progress.Speed = int64(float64(current-task.Progress.Downloaded) / usedTime)
}
task.Progress.Downloaded = current task.Progress.Downloaded = current
d.emit(EventKeyProgress, task) d.emit(EventKeyProgress, task)
+1 -1
View File
@@ -34,7 +34,7 @@ func (cfg *DownloaderConfig) Init() *DownloaderConfig {
} }
if cfg.RefreshInterval == 0 { if cfg.RefreshInterval == 0 {
cfg.RefreshInterval = 500 cfg.RefreshInterval = 350
} }
return cfg return cfg
} }
+8 -10
View File
@@ -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(
+1 -1
View File
@@ -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"