From 9915fd0fdd52737876031238bb37a7aec85c63fe Mon Sep 17 00:00:00 2001 From: "Bartosz \" izdwuut" Date: Mon, 17 Feb 2020 13:23:06 +0100 Subject: [PATCH 1/2] Check if comment.steamProfile is undefined in thread.component.html. --- frontend/src/app/thread/thread.component.html | 17 ++++------------- frontend/src/app/thread/thread.component.ts | 6 ++---- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/frontend/src/app/thread/thread.component.html b/frontend/src/app/thread/thread.component.html index 3a1336e..bb9ab44 100644 --- a/frontend/src/app/thread/thread.component.html +++ b/frontend/src/app/thread/thread.component.html @@ -35,13 +35,10 @@

Scrapped comments

Comment karma: {{ comment.author.karma }}, age: {{ getAge(comment.author.age) }}
-
+
Steam profile: {{ getSteamProfile(comment) }}
-
- Steam profile: {{ getSteamProfile(comment) }} -

Warnings: {{ getWarnings(comment).join(', ') }}
@@ -59,13 +56,10 @@

Scrapped comments

Comment karma: {{ comment.author.karma }}, age: {{ getAge(comment.author.age) }}
-
+
Steam profile: {{ getSteamProfile(comment) }}
-
- Steam profile: {{ getSteamProfile(comment) }} -
@@ -93,14 +87,11 @@

Scrapped comments

target="_blank">{{ comment.author.name }} - Comment karma: {{ comment.author.karma }}, age: {{ getAge(comment.author.age) }}

-
+ Comment karma: {{ comment.author.karma }}, age: {{ getAge(comment.author.age) }}
+
Steam profile: {{ getSteamProfile(comment) }}
-
- Steam profile: {{ getSteamProfile(comment) }} -

Errors: {{ getErrors(comment).join(', ') }}
diff --git a/frontend/src/app/thread/thread.component.ts b/frontend/src/app/thread/thread.component.ts index 2a61b79..495abda 100644 --- a/frontend/src/app/thread/thread.component.ts +++ b/frontend/src/app/thread/thread.component.ts @@ -82,9 +82,7 @@ export class ThreadComponent implements OnInit, OnDestroy { if (comment.author.karma < environment.minKarma) { errors.push('not enough karma') } - if (comment.steamProfile == null) { - errors.push('no Steam profile') - } else { + if (comment.steamProfile) { if (comment.steamProfile.publicProfile) { if (comment.steamProfile.level < environment.minLevel) { errors.push('Steam level too low') @@ -140,7 +138,7 @@ export class ThreadComponent implements OnInit, OnDestroy { warnings.push("couldn't scrap comment") return warnings } - if (comment.steamProfile && comment.steamProfile.steamId == null) { + if ((comment.steamProfile && comment.steamProfile.steamId == null) || !comment.steamProfile) { warnings.push('no Steam profile detected') } if (comment.steamProfile && comment.steamProfile.gamesCount >= environment.hoarderNumber) { From c7f44f8446e9e06f966a8d84170d80da7563915c Mon Sep 17 00:00:00 2001 From: "Bartosz \" izdwuut" Date: Mon, 17 Feb 2020 13:34:33 +0100 Subject: [PATCH 2/2] Bump version number. --- backend/config.py | 2 +- frontend/src/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/config.py b/backend/config.py index 1682a87..fb44ee8 100644 --- a/backend/config.py +++ b/backend/config.py @@ -9,7 +9,7 @@ class RedditConfig: CLIENT_SECRET = os.environ['GOG_PICKER_REDDIT_CLIENT_SECRET'] USERNAME = os.environ['GOG_PICKER_REDDIT_USERNAME'] PASSWORD = os.environ['GOG_PICKER_REDDIT_PASSWORD'] - USER_AGENT = 'python:gog-picker:v0.11.0 (by /u/izdwuut)' + USER_AGENT = 'python:gog-picker:v0.12.0 (by /u/izdwuut)' NOT_ENTERING = 'not entering' MIN_KARMA = 300 diff --git a/frontend/src/index.html b/frontend/src/index.html index 460238d..95190ad 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -12,7 +12,7 @@