GithubHelp home page GithubHelp logo

Comments (4)

yihong0618 avatar yihong0618 commented on July 20, 2024

result.extend([i["logs"][0]["stats"]["id"] for i in run_logs])

i["logs"][0]

这里好像只获取每天的最后一条记录,如果一天有多条数据,较早的数据被跳过了。
(只看了代码觉得有问题,还没有实测)

理论没问题,这块获取的不是最后一条。~ 记忆里是,我明天看下。

from running_page.

yihong0618 avatar yihong0618 commented on July 20, 2024

仔细看了下,没问题

old_tracks_ids = generator.get_old_tracks_ids()

这块获取新的 track 的逻辑在这儿。
是用 data.db 判断的。

获取新 gpx 的逻辑在这儿

runs = [run for run in runs if run.split("_")[1] not in old_tracks_ids]

from running_page.

Lax avatar Lax commented on July 20, 2024

跟 data.db 对比判断的逻辑没问题。

这个逻辑会导致从 keep api 的 json 里读数据时没有读全,漏了一些 track。

从api 返回的 json 结构如下,这里只取了第一条 logs[0].stats.id,漏了后面两条。

data:
  records:
    - date: 2月04日
      logs:
        - type: stats
          stats:
            id: 57b479009962c35607c65348_9223370424448641007_rn
        - type: stats
          stats:
            id: 57b479009962c35607c65348_9223370424516957507_rn
        - type: stats
          stats:
            id: 57b479009962c35607c65348_9223370424529356007_rn
    - date: 2月03日

那行代码修改后执行了一下,找回了几条记录。

from running_page.

yihong0618 avatar yihong0618 commented on July 20, 2024

@Lax
懂了。感谢

from running_page.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.