Skip to content
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

Fix AttributeError in Activity class #713

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Build
run: PATH_PREFIX=/${{ github.event.repository.name }} pnpm build
run: PATH_PREFIX=/ pnpm build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ on:

env:
# please change to your own config.
RUN_TYPE: pass # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon/oppo, Please change the 'pass' it to your own
ATHLETE: yihong0618
TITLE: Yihong0618 Running
MIN_GRID_DISTANCE: 10 # change min distance here
TITLE_GRID: Over 10km Runs # also here
GITHUB_NAME: yihong0618 # change to yours
GITHUB_EMAIL: zouzou0208@gmail.com # change to yours
RUN_TYPE: strava # support strava/nike/garmin/coros/garmin_cn/garmin_sync_cn_global/keep/only_gpx/only_fit/nike_to_strava/strava_to_garmin/tcx_to_garmin/strava_to_garmin_cn/garmin_to_strava/garmin_to_strava_cn/codoon/oppo, Please change the 'pass' it to your own
ATHLETE: Liudon
TITLE: Liudon Workout
MIN_GRID_DISTANCE: 5 # change min distance here
TITLE_GRID: Over 5km Workout # also here
GITHUB_NAME: Liudon # change to yours
GITHUB_EMAIL: i.mu@qq.com # change to yours

# IGNORE_BEFORE_SAVING: True # if you want to ignore some data before saving, set this to True
IGNORE_START_END_RANGE: 10 # Unit meter
Expand Down
2 changes: 1 addition & 1 deletion assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions assets/github_2021.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/github_2022.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/github_2023.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/github_2024.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/grid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions assets/year_2012.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2013.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2014.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2015.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2016.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2017.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2018.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2019.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2020.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2021.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2022.svg

This file was deleted.

2 changes: 0 additions & 2 deletions assets/year_2023.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/year_2024.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon.ico
Binary file not shown.
Binary file removed public/images/favicon.png
Binary file not shown.
Binary file added run_page/data.db
Binary file not shown.
5 changes: 4 additions & 1 deletion run_page/generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def sync(self, force):
if self.only_run and activity.type != "Run":
continue
if IGNORE_BEFORE_SAVING:
activity.summary_polyline = filter_out(activity.summary_polyline)
if activity.map and activity.map.summary_polyline:
activity.map.summary_polyline = filter_out(
activity.map.summary_polyline
)
created = update_or_create_activity(self.session, activity)
if created:
sys.stdout.write("+")
Expand Down
2 changes: 2 additions & 0 deletions src/components/RunMap/mapbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
a.mapboxgl-ctrl-logo {
width: 88px;
height: 23px;
opacity: .4;
margin: 0 0 -4px -4px;
display: block;
background-repeat: no-repeat;
Expand All @@ -317,6 +318,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
}
}
.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
display: none;
padding: 0 5px;
background-color: hsla(0, 0%, 100%, 0.5);
margin: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const Index = () => {

return (
<Layout>
<div className="w-full lg:w-1/3">
{/* <div className="w-full lg:w-1/3">
<h1 className="my-12 text-5xl font-extrabold italic">
<a href="/">{siteTitle}</a>
</h1>
Expand All @@ -185,8 +185,8 @@ const Index = () => {
) : (
<YearsStat year={year} onClick={changeYear} />
)}
</div>
<div className="w-full lg:w-2/3">
</div> */}
<div className="w-full">
<RunMap
title={title}
viewState={viewState}
Expand Down
2 changes: 1 addition & 1 deletion src/static/activities.json

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions src/static/site-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ interface ISiteMetadataResult {
}

const data: ISiteMetadataResult = {
siteTitle: 'Running Page',
siteUrl: 'https://yihong.run',
logo: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQTtc69JxHNcmN1ETpMUX4dozAgAN6iPjWalQ&usqp=CAU',
siteTitle: 'Workout Page',
siteUrl: 'https://workout.liudon.com',
logo: 'https://liudon.com/avatar.png',
description: 'Personal site and blog',
navLinks: [
{
name: 'Blog',
url: 'https://github.com/yihong0618/gitblog',
},
{
name: 'About',
url: 'https://github.com/yihong0618/running_page/blob/master/README-CN.md',
url: 'https://liudon.com',
},
],
};
Expand Down
5 changes: 3 additions & 2 deletions src/utils/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const LINE_OPACITY = 0.4;
// styling: map height
const MAP_HEIGHT = 600;
//set to `false` if you want to hide the road label characters
const ROAD_LABEL_DISPLAY = true;
const ROAD_LABEL_DISPLAY = false;
//set to `true` if you want to display only the routes without showing the map.
const PRIVACY_MODE = false;
//set to `false` if you want to make light off as default, only effect when `PRIVACY_MODE` = false
Expand Down Expand Up @@ -98,11 +98,12 @@ export {
};

const nike = 'rgb(224,237,94)'; // if you want change the main color change here src/styles/variables.scss
const green = 'rgb(0,237,94)';
const dark_vanilla = 'rgb(228,212,220)';

// If your map has an offset please change this line
// issues #92 and #198
export const NEED_FIX_MAP = false;
export const MAIN_COLOR = nike;
export const MAIN_COLOR = green;
export const PROVINCE_FILL_COLOR = '#47b8e0';
export const COUNTRY_FILL_COLOR = dark_vanilla;