diff --git a/src/app.py b/src/app.py index 11f2a9a..51efd62 100644 --- a/src/app.py +++ b/src/app.py @@ -70,6 +70,14 @@ async def fetch_data(data: Dict[str, Any]) -> List[Dict[str, Any]]: in_komga = komga.getSeries( manga.title.english if manga.title.english else manga.title.romaji ) + requested = cache.fetch_one( + query="SELECT manga_id, grabbed FROM manga_requests WHERE manga_id = ?", + args=(manga.id,), + ) + komga_request = False + if requested: + komga_request = True + results.append( { "id": manga.id, @@ -88,6 +96,7 @@ async def fetch_data(data: Dict[str, Any]) -> List[Dict[str, Any]]: else "No description available", "isAdult": manga.isAdult, "in_komga": in_komga, + "requested": komga_request, } ) diff --git a/src/static/style.css b/src/static/style.css index 4291f69..7ce6d90 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -167,6 +167,19 @@ body.nsfw-disabled .image-container.nsfw:hover img { } +.card.requested { + border: 3px solid orange; + box-sizing: border-box; + /* disable the request button for entries in Komga */ + /* only allow the info button to be clicked */ + opacity: 0.3; +} + +.card.manga.requested .request { + pointer-events: none; + opacity: 0.5; +} + .card.komga .request { pointer-events: none; opacity: 0.5; diff --git a/src/templates/index.html b/src/templates/index.html index 4086836..58f617e 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -51,7 +51,9 @@