Meta
This commit is contained in:
parent
d08bac2c41
commit
4e54445170
@ -100,6 +100,7 @@ class EventsPullerThread(threading.Thread):
|
|||||||
while not self.shutdown.is_set():
|
while not self.shutdown.is_set():
|
||||||
producedMessage: bool = False
|
producedMessage: bool = False
|
||||||
|
|
||||||
|
try:
|
||||||
connection = mysql.connector.connect(
|
connection = mysql.connector.connect(
|
||||||
host=events_server_address,
|
host=events_server_address,
|
||||||
port=events_server_port,
|
port=events_server_port,
|
||||||
@ -107,6 +108,9 @@ class EventsPullerThread(threading.Thread):
|
|||||||
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:
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user