This commit is contained in:
bskjon 2024-07-23 16:53:57 +02:00
parent d08bac2c41
commit 4e54445170
3 changed files with 11 additions and 4 deletions

View File

@ -100,13 +100,17 @@ class EventsPullerThread(threading.Thread):
while not self.shutdown.is_set(): while not self.shutdown.is_set():
producedMessage: bool = False producedMessage: bool = False
connection = mysql.connector.connect( try:
connection = mysql.connector.connect(
host=events_server_address, host=events_server_address,
port=events_server_port, port=events_server_port,
database=events_server_database_name, database=events_server_database_name,
user=events_server_username, user=events_server_username,
password=events_server_password password=events_server_password
) )
except:
logging.error(f"Unable to connect to {events_server_address}:{events_server_port}. Either the server or database: {events_server_database_name} is not present yet!")
try: try:
rows = self.getEventsAvailable(connection=connection) rows = self.getEventsAvailable(connection=connection)
for row in rows: for row in rows:

View File

@ -48,11 +48,14 @@ class Imdb(SourceBase):
async def __getMetadata(self, id: str) -> Optional[Metadata]: async def __getMetadata(self, id: str) -> Optional[Metadata]:
try: try:
result = await asyncio.to_thread(Cinemagoer().get_movie, id) result = await asyncio.to_thread(Cinemagoer().get_movie, id)
cover = result.get_fullsizeURL()
if cover is None or len(cover) == 0:
cover = result.get("cover url", None)
summary = result.get("plot outline", None) summary = result.get("plot outline", None)
return Metadata( return Metadata(
title=result.get("title", None), title=result.get("title", None),
altTitle=[result.get("localized title", [])], altTitle=[result.get("localized title", [])],
cover=result.get("cover url", None), cover=cover,
banner=None, banner=None,
summary=[] if summary is None else [ summary=[] if summary is None else [
Summary( Summary(

View File

@ -73,7 +73,7 @@ class SourceBase(ABC):
for title in titles: for title in titles:
for id, stored_title in filtered_idToTitle.items(): for id, stored_title in filtered_idToTitle.items():
ratio = fuzz.ratio(title, stored_title) ratio = fuzz.ratio(title, stored_title[0])
if ratio > best_ratio: if ratio > best_ratio:
best_ratio = ratio best_ratio = ratio
best_match_id = id best_match_id = id