From 0285135d4f7dfa412a560a517f5d6879ce4428f4 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Tue, 8 Sep 2020 00:02:51 +0200 Subject: [PATCH 1/4] Fix db error. last_seen throws errors on production server. I'm investigating. commented for now. --- app/routes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/routes.py b/app/routes.py index f1df17b..555929d 100644 --- a/app/routes.py +++ b/app/routes.py @@ -45,7 +45,7 @@ ALLOWED_EXTENSIONS = {'json', 'db'} @app.route('/index') @login_required def index(): - current_user.last_seen = datetime.datetime.utcnow() + #current_user.last_seen = datetime.datetime.utcnow() return render_template('home.html') @app.route('/twitter') @@ -390,18 +390,18 @@ def logout(): @app.route('/settings') @login_required def settings(): - active = 1 + '''active = 1 for user in User.query.all(): if not user.last_seen == None: t = datetime.datetime.utcnow() - user.last_seen s = t.total_seconds() m = s/60 if m < 40: - active = active+1 + active = active+1''' instanceInfo = { "totalUsers":db.session.query(User).count(), - "active":active, + "active":"unknown", "location":config['serverLocation'], "serverName":config['serverName'] } @@ -745,4 +745,4 @@ def getYoutubePosts(ids): video.description = re.sub(r'^https?:\/\/.*[\r\n]*', '', video.description[0:120]+"...", flags=re.MULTILINE) videos.append(video) return videos - \ No newline at end of file + From b410e46f69b3356da1256c6da34a1b2f7af2a7d4 Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Tue, 8 Sep 2020 00:03:42 +0200 Subject: [PATCH 2/4] Fix db error Comment last_seen. Is throwing error. --- app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index 235ba11..d90b599 100644 --- a/app/models.py +++ b/app/models.py @@ -22,7 +22,7 @@ class User(UserMixin, db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(64), index=True, unique=True) password_hash = db.Column(db.String(128)) - last_seen = db.Column(db.DateTime, default=datetime.utcnow) + #last_seen = db.Column(db.DateTime, default=datetime.utcnow) posts = db.relationship('Post', backref='author', lazy='dynamic') def __repr__(self): @@ -169,4 +169,4 @@ class Post(db.Model): def __repr__(self): return ''.format(self.body) - \ No newline at end of file + From a9611645c6f6f9415ade7b458d0b3b31cc32c7eb Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Tue, 8 Sep 2020 00:06:55 +0200 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f87682..e341649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - [x] Changed video streaming chunk size. - [x] Video streaming now has a smaller load for the server. - [x] Video streaming is (a bit) more efficient - YoutubeDL executed on /watch instead. +- [x] Settings page improved. ### Added - [x] Add instance info on settings page. @@ -22,6 +23,7 @@ - [x] Option to delete an account. - [x] Show video title on browser tab title on `/watch`. - [x] Ability for admins to allow non-registered users to use the service. +- [x] Prepared for adding last_seen - See #? ### Fixed - [x] Video descriptions overflowing the description box. From ae7a24f3ea3050860878f85c2a1454afb05705ff Mon Sep 17 00:00:00 2001 From: PLUJA <64632615+pluja@users.noreply.github.com> Date: Tue, 8 Sep 2020 00:12:04 +0200 Subject: [PATCH 4/4] Add issue number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e341649..7b407f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ - [x] Option to delete an account. - [x] Show video title on browser tab title on `/watch`. - [x] Ability for admins to allow non-registered users to use the service. -- [x] Prepared for adding last_seen - See #? +- [x] Prepared for adding last_seen - See #35 ### Fixed - [x] Video descriptions overflowing the description box.