netbrain / zwift

Easily zwift on linux
The Unlicense
238 stars 27 forks source link

Retrieve activity after crash/battery empty #52

Closed nowave7 closed 8 months ago

nowave7 commented 8 months ago

Hello,

First off, thanks for making this, it works flawlessly on Linux Mint! I do have one question thought. During one activity, my laptop ran out of battery, and the activity wasn't saved/recorded. Normally, one could retrieve such an activity from a specific folder, (for windows "%USER%\Documents\Zwift\Activities\"). I was just wondering if this is possible with the docker container? I guess not, since, as far as I can see, the container is created and deleted each time the script is ran? Thanks in advance!

quietvoid commented 8 months ago

If they saved they should be present in the mounted Docker volume. Unless they explicitly get saved to Documents.

docker run -it --rm -v zwift-$USER:/data busybox
/ # ls -la /data/Activities/

total 460
drwxr-xr-x    2 1000     1000          4096 Dec 21 21:51 .
drwxr-xr-x    9 1000     1000          4096 Dec 21 21:48 ..
-rw-r--r--    1 1000     1000        112177 Dec 21 22:42 2023-12-21-21-51-45.fit
-rw-r--r--    1 1000     1000         97229 Dec 21 22:35 inProgressActivity.fit

I'm not sure if the current Docker image does save them though, since if the Zwift volume isn't being detected in Documents then it might not? I've personally had to make a symlink in mine:

ln -s "$HOME/Zwift" "$HOME/.wine/drive_c/users/user/Documents/Zwift"

Someone using the netbrain/zwift image could check.

gallais commented 8 months ago

Have you had a look on zwift.com? Cf. https://github.com/netbrain/zwift/issues/39#issuecomment-1807138471

nowave7 commented 8 months ago

Hey guys, thanks for your comments. As it turns out, the companion app on the phone did save the activity, it just wasn't displayed immediately, but only after some 20 minutes or so. So I could download it from zwift.com, and sync it to Strava/Garmin.

If they saved they should be present in the mounted Docker volume. Unless they explicitly get saved to Documents.

docker run -it --rm -v zwift-$USER:/data busybox
/ # ls -la /data/Activities/

total 460
drwxr-xr-x    2 1000     1000          4096 Dec 21 21:51 .
drwxr-xr-x    9 1000     1000          4096 Dec 21 21:48 ..
-rw-r--r--    1 1000     1000        112177 Dec 21 22:42 2023-12-21-21-51-45.fit
-rw-r--r--    1 1000     1000         97229 Dec 21 22:35 inProgressActivity.fit

I'm not sure if the current Docker image does save them though, since if the Zwift volume isn't being detected in Documents then it might not? I've personally had to make a symlink in mine:

ln -s "$HOME/Zwift" "$HOME/.wine/drive_c/users/user/Documents/Zwift"

Someone using the netbrain/zwift image could check.

Yes, I just had a look, and indeed all of the activities as well as images, are still there. So that is also great to know in case this happens once again. Thanks!

nowave7 commented 8 months ago

Closing this as all is clear and there really is no issue.