Skip to content

Commit

Permalink
Merge pull request #341 from EstrellaXD/3.0-dev
Browse files Browse the repository at this point in the history
3.0.8
  • Loading branch information
EstrellaXD authored Jun 15, 2023
2 parents f1c4e02 + 4c94a51 commit 89b4c1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
28 changes: 6 additions & 22 deletions src/module/database/bangumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ def search_official_title(self, official_title: str) -> BangumiData | None:
def match_poster(self, bangumi_name: str) -> str:
data = self._cursor.execute(
"""
SELECT official_title, poster_link FROM bangumi
WHERE INSTR(:title_raw, title_raw) > 0
SELECT poster_link FROM bangumi
WHERE INSTR(official_title, :official_title) > 0
""",
{"title_raw": bangumi_name},
{"official_title": bangumi_name},
).fetchone()
if not data:
return ""
official_title, poster_link = data
poster_link = data[0]
if not poster_link:
return ""
return poster_link
Expand Down Expand Up @@ -219,21 +219,5 @@ def __check_list_exist(self, data_list: list[BangumiData]):

if __name__ == '__main__':
with BangumiDatabase() as db:
db.update_table()
data = BangumiData(
id=1,
title_raw="",
official_title="",
poster_link="",
rss_link=[],
eps_collect=0,
eps_total=0,
eps_update=0,
eps_complete=False,
added=False,
rule_name=None,
save_path=None,
)
db.insert(data)
print(db.not_added())
print(db.not_complete())
name = "久保"
print(db.match_poster(name))
3 changes: 2 additions & 1 deletion src/module/notification/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ def __enter__(self):
def __exit__(self, exc_type, exc_val, exc_tb):
self.notifier.__exit__(exc_type, exc_val, exc_tb)


if __name__ == "__main__":
info = Notification(
official_title="魔法纪录 魔法少女小圆外传",
official_title="久保同学不放过我",
season=2,
episode=1,
)
Expand Down

0 comments on commit 89b4c1e

Please sign in to comment.