Use sql.row_factory = sqlite3.Row.

This commit is contained in:
voussoir 2022-03-15 18:19:32 -07:00
parent cf01ca24ff
commit efcc224a50
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 1 additions and 2 deletions

View file

@ -24,7 +24,6 @@ class Channel(ObjectBase):
def __init__(self, ycdldb, db_row):
super().__init__(ycdldb)
db_row = self.ycdldb.normalize_db_row(db_row, self.table)
self.id = db_row['id']
self.name = db_row['name'] or self.id
@ -326,7 +325,6 @@ class Video(ObjectBase):
def __init__(self, ycdldb, db_row):
super().__init__(ycdldb)
db_row = self.ycdldb.normalize_db_row(db_row, self.table)
self.id = db_row['id']
self.published = db_row['published']

View file

@ -476,6 +476,7 @@ class YCDLDB(
self.data_directory.makedirs(exist_ok=True)
self.sql = sqlite3.connect(self.database_filepath)
self.sql.row_factory = sqlite3.Row
if existing_database:
if not skip_version_check: