mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-12-22 20:43:32 +02:00
Correct fetching IMDB database
This commit is contained in:
parent
e782cacf5a
commit
4d02fde9aa
1 changed files with 5 additions and 11 deletions
|
@ -84,20 +84,14 @@ def convert_datasets_to_db():
|
|||
|
||||
|
||||
def get_title_by_id(films_ids=list):
|
||||
tt_list = []
|
||||
for i in films_ids:
|
||||
tt_film = c.execute("SELECT * FROM titles WHERE tt_id = (?)", (i,)).fetchone()
|
||||
tt_list.append(tt_film)
|
||||
return tt_list
|
||||
tt_list = c.executemany("SELECT * FROM titles WHERE tt_id = (?)", films_ids).fetchall()
|
||||
if tt_list != []:
|
||||
return tt_list
|
||||
|
||||
|
||||
def get_title_by_names_and_year(film_names=list):
|
||||
tt_list = []
|
||||
for i in film_names:
|
||||
tt_film = c.execute('''SELECT * FROM titles
|
||||
tt_list = c.executemany('''SELECT * FROM titles
|
||||
WHERE (original_name = (?) OR ru_name = (?))
|
||||
AND year = (?)''', i).fetchone()
|
||||
if tt_film:
|
||||
tt_list.append(tt_film)
|
||||
AND year = (?)''', film_names).fetchall()
|
||||
if tt_list != []:
|
||||
return tt_list
|
||||
|
|
Loading…
Reference in a new issue