yihong0618 / running_page

Make your own running home page
https://running-page.vercel.app
MIT License
3.56k stars 1.02k forks source link

nike to strava 上传跑步数据变成了workout而不是跑步 #495

Closed schenxia closed 1 year ago

schenxia commented 1 year ago

最近一两周才出现的新问题,每个跑步记录在strava都变成了workout类型,名字也从Morning Run 变成了Morning Workout

yihong0618 commented 1 year ago

这个大概率是 strava 那边识别的问题

schenxia commented 1 year ago

好的,我看了一下stravalib里面的client.upload_activity https://github.com/stravalib/stravalib/blob/main/src/stravalib/client.py#L841 然后试着在我的fork里面把这一行变成 https://github.com/yihong0618/running_page/blob/59ff75a7f09189273c42cac0c863217965ca94d1/scripts/utils.py#L96

r = client.upload_activity(activity_file=f, data_type=data_type, activity_type="run")

然后在CI里面得到了这个error msg

  black . --check
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/schenxia/running_page/actions/runs/6226943652/job/16900530082#step:7:3).8.18/x6[4](https://github.com/schenxia/running_page/actions/runs/6226943652/job/16900530082#step:7:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x[6](https://github.com/schenxia/running_page/actions/runs/6226943652/job/16900530082#step:7:6)4/lib
would reformat /home/runner/work/running_page/running_page/scripts/utils.py

Oh no! 💥 💔 💥
1 file would be reformatted, 33 files would be left unchanged.
Error: Process completed with exit code 1.

能麻烦您帮我看一下是什么问题吗?多谢了!

yihong0618 commented 1 year ago

black . 然后 add commit push

schenxia commented 1 year ago

多谢,加了activity_type="run"之后问题解决了

yihong0618 commented 1 year ago

我们看看怎么在代码里支持