forked from yihong0618/running_page
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upstream: Save synced filenams and skip sync next times (yihong0618#454) Update README-CN.md (yihong0618#459) Fix Sports Type in codoon_sync.py (yihong0618#457) Update README.md (yihong0618#455) # Conflicts: # README-CN.md # README.md
- Loading branch information
Showing
6 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ | |
# for multi sports | ||
TYPE_DICT = { | ||
0: "Hike", | ||
1: "Run", | ||
1: "Running", | ||
2: "Ride", | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
from config import SYNCED_FILE | ||
import json | ||
|
||
|
||
def save_synced_data_file_list(file_list: list): | ||
old_list = load_synced_file_list() | ||
|
||
with open(SYNCED_FILE, "w") as f: | ||
file_list.extend(old_list) | ||
|
||
json.dump(file_list, f) | ||
|
||
|
||
def load_synced_file_list(): | ||
if os.path.exists(SYNCED_FILE): | ||
with open(SYNCED_FILE, "r") as f: | ||
try: | ||
return json.load(f) | ||
except Exception as e: | ||
print(f"json load {SYNCED_FILE} \nerror {e}") | ||
pass | ||
|
||
return [] |