Use sql.row_factory = sqlite3.Row.
This commit is contained in:
parent
cf01ca24ff
commit
efcc224a50
2 changed files with 1 additions and 2 deletions
|
@ -24,7 +24,6 @@ class Channel(ObjectBase):
|
||||||
|
|
||||||
def __init__(self, ycdldb, db_row):
|
def __init__(self, ycdldb, db_row):
|
||||||
super().__init__(ycdldb)
|
super().__init__(ycdldb)
|
||||||
db_row = self.ycdldb.normalize_db_row(db_row, self.table)
|
|
||||||
|
|
||||||
self.id = db_row['id']
|
self.id = db_row['id']
|
||||||
self.name = db_row['name'] or self.id
|
self.name = db_row['name'] or self.id
|
||||||
|
@ -326,7 +325,6 @@ class Video(ObjectBase):
|
||||||
|
|
||||||
def __init__(self, ycdldb, db_row):
|
def __init__(self, ycdldb, db_row):
|
||||||
super().__init__(ycdldb)
|
super().__init__(ycdldb)
|
||||||
db_row = self.ycdldb.normalize_db_row(db_row, self.table)
|
|
||||||
|
|
||||||
self.id = db_row['id']
|
self.id = db_row['id']
|
||||||
self.published = db_row['published']
|
self.published = db_row['published']
|
||||||
|
|
|
@ -476,6 +476,7 @@ class YCDLDB(
|
||||||
|
|
||||||
self.data_directory.makedirs(exist_ok=True)
|
self.data_directory.makedirs(exist_ok=True)
|
||||||
self.sql = sqlite3.connect(self.database_filepath)
|
self.sql = sqlite3.connect(self.database_filepath)
|
||||||
|
self.sql.row_factory = sqlite3.Row
|
||||||
|
|
||||||
if existing_database:
|
if existing_database:
|
||||||
if not skip_version_check:
|
if not skip_version_check:
|
||||||
|
|
Loading…
Reference in a new issue