mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2024-11-25 13:21:29 +00:00
Oops, sqlite not support SELECT in executemany...
This commit is contained in:
parent
fe6fc2a415
commit
33792da574
|
@ -84,14 +84,22 @@ def convert_datasets_to_db():
|
||||||
|
|
||||||
|
|
||||||
def get_title_by_id(films_ids=list):
|
def get_title_by_id(films_ids=list):
|
||||||
tt_list = c.executemany("SELECT * FROM titles WHERE tt_id = (?)", films_ids).fetchall()
|
tt_list = []
|
||||||
|
for i in films_ids:
|
||||||
|
tt_film = c.execute("SELECT * FROM titles WHERE tt_id = (?)", (i,)).fetchone()
|
||||||
|
if tt_film:
|
||||||
|
tt_list.append(tt_film)
|
||||||
if tt_list != []:
|
if tt_list != []:
|
||||||
return tt_list
|
return tt_list
|
||||||
|
|
||||||
|
|
||||||
def get_title_by_names_and_year(film_names=list):
|
def get_title_by_names_and_year(film_names=list):
|
||||||
tt_list = c.executemany('''SELECT * FROM titles
|
tt_list = []
|
||||||
|
for i in film_names:
|
||||||
|
tt_film = c.execute('''SELECT * FROM titles
|
||||||
WHERE (original_name = (?) OR ru_name = (?))
|
WHERE (original_name = (?) OR ru_name = (?))
|
||||||
AND year = (?)''', film_names).fetchall()
|
AND year = (?)''', i).fetchone()
|
||||||
|
if tt_film:
|
||||||
|
tt_list.append(tt_film)
|
||||||
if tt_list != []:
|
if tt_list != []:
|
||||||
return tt_list
|
return tt_list
|
||||||
|
|
Loading…
Reference in a new issue