-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Richer activity title with more sport types and locations #733
Richer activity title with more sport types and locations #733
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems we added a new column did it a break change?
I'm not quite sure what you mean. There are no new columns added here, just more diverse sports titles. |
cool will take a look these days thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is working perfectly, great job.
However, I have two concerns:
- Is it possible to modify the default track name("none")?
- The newly added column might break syncing for current users.
run_page/gpxtrackposter/track.py
Outdated
f"run from {run_from} by {self.device}" | ||
if self.device | ||
else f"run from {run_from}" | ||
self.track_name if self.track_name else "none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the default value, can we use "" instead of "none"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, for names already synced in the db, please include instructions in the readme on enabling the feature for all data, possibly with a SQL, to reset names to default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the default value, can we use "" instead of "none"?
no problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, for names already synced in the db, please include instructions in the readme on enabling the feature for all data, possibly with a SQL, to reset names to default.
It works if I remove all the caches and regenerate the running page completely. I am trying resolving problems on updating synced activities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the default value, can we use "" instead of "none"?
resolved in d9ae3ac
run_page/gpxtrackposter/track.py
Outdated
), # maybe change later | ||
"type": "Run", # Run for now only support run for now maybe change later | ||
"type": self.type, | ||
"subtype": (self.subtype if self.subtype else "none"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in d9ae3ac
@@ -29,6 +29,7 @@ def randomword(): | |||
"distance", | |||
"moving_time", | |||
"type", | |||
"subtype", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new column is not present in the SQLite file if the user syncs before this pull request. Users may face difficulties adding this column manually, or else syncing will fail. Perhaps you should add instructions in the readme or include a script to assist users in doing this easily, as seen in this ref1 ref2. There might be a simpler solution that I'm unaware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The db checks whether the new column exists after commit c86d040. If any column defined in class Activity
does not exist, it will add a new column in data.db.
src/utils/utils.ts
Outdated
const titleForRun = (run: Activity): string => { | ||
if (RICH_TITLE) { | ||
// 1. try to use user defined name | ||
if (run.name != 'none') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's not a good default value?
Thanks for your review :) I will take a look in a few days, make changes and get back to you. |
@ben-29 @yihong0618 This feature only applies to newly added activities; if there were some previous activities, their activity names won't change (they will be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done
@@ -135,10 +148,37 @@ def update_or_create_activity(session, run_activity): | |||
return created | |||
|
|||
|
|||
def add_missing_columns(engine, model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Maybe we can consider setting default value of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
That's cool
yes we can make it to another pull request |
@NaturezzZ |
Try to delete |
copy that |
The activity title by default use user-defined title in the activity. It can also be garmin-style location+sport type. BTW, it supports more types of sports, such as trail running, treadmill running, hiking, and etc.
FYI, an example website is shown in https://run.zhengnq.com