From b3390940a59a8f4c64b5feff0bff3a902638622c Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 3 Jun 2022 19:54:35 -0700 Subject: [PATCH] Use worms select_one_value. --- ycdl/objects.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ycdl/objects.py b/ycdl/objects.py index 13ec57a..fbb59ad 100644 --- a/ycdl/objects.py +++ b/ycdl/objects.py @@ -149,10 +149,10 @@ class Channel(ObjectBase): ''' query = 'SELECT id FROM videos WHERE author_id == ? ORDER BY published DESC LIMIT 1' bindings = [self.id] - row = self.ycdldb.select_one(query, bindings) - if row is None: + video_id = self.ycdldb.select_one_value(query, bindings) + if video_id is None: raise exceptions.NoVideos(self) - return row[0] + return video_id def has_pending(self) -> bool: ''' @@ -162,7 +162,7 @@ class Channel(ObjectBase): ''' query = 'SELECT 1 FROM videos WHERE author_id == ? AND state == "pending" LIMIT 1' bindings = [self.id] - return self.ycdldb.select_one(query, bindings) is not None + return self.ycdldb.select_one_value(query, bindings) is not None def jsonify(self): j = {