~nhanb/pytaku

dd995dd6428f6b9edb7c71c8de7b88353604d230 — Bùi Thành Nhân a month ago 161ce7e 0.3.25
update mangasee cover image server

Also apparently latest `black` takes trailing slash in function argument
list into account, so in order to keep things in 1 line we'll need to
remove the trailing slash.
M pyproject.toml => pyproject.toml +1 -1
@@ 1,6 1,6 @@
[tool.poetry]
name = "pytaku"
version = "0.3.24"
version = "0.3.25"
description = "Self-hostable web-based manga reader"
authors = ["Bùi Thành Nhân <hi@imnhan.com>"]
license = "AGPL-3.0-only"

M src/mangoapi/mangasee.py => src/mangoapi/mangasee.py +4 -4
@@ 117,7 117,7 @@ class Mangasee(Site):
                "id": row[0],
                "name": row[1],
                "site": "mangasee",
                "thumbnail": f"https://cover.mangabeast01.com/cover/{row[0]}.jpg",
                "thumbnail": f"https://cover.nep.li/cover/{row[0]}.jpg",
            }
            for row in self.search_table.search(query)
        ]


@@ 126,7 126,7 @@ class Mangasee(Site):
        return self.title_thumbnail(title_id)

    def title_thumbnail(self, title_id):
        return f"https://cover.mangabeast01.com/cover/{title_id}.jpg"
        return f"https://cover.nep.li/cover/{title_id}.jpg"

    def title_source_url(self, title_id):
        return f"https://mangasee123.com/manga/{title_id}"


@@ 148,13 148,13 @@ class SearchTable:
            rows.append((id, name, " ".join(alt_names)))

        cursor.executemany(
            "INSERT INTO titles(id, name, alt_names) VALUES(?,?,?);", rows,
            "INSERT INTO titles(id, name, alt_names) VALUES(?,?,?);", rows
        )

    def search(self, query):
        query = '"' + query.replace('"', '""') + '"'
        return self.db.cursor().execute(
            "SELECT id, name FROM titles WHERE titles MATCH ? ORDER BY rank;", (query,),
            "SELECT id, name FROM titles WHERE titles MATCH ? ORDER BY rank;", (query,)
        )



M src/pytaku/persistence.py => src/pytaku/persistence.py +1 -1
@@ 371,7 371,7 @@ def get_username(user_id):

def delete_token(token):
    num_deleted = run_sql(
        "DELETE FROM token WHERE token=?;", (token,), return_num_affected=True,
        "DELETE FROM token WHERE token=?;", (token,), return_num_affected=True
    )
    return num_deleted


M tests/mangoapi/test_mangasee.py => tests/mangoapi/test_mangasee.py +1 -1
@@ 60,6 60,6 @@ def test_search_title():
            "id": "Sayonara-Football",
            "name": "Sayonara Football",
            "site": "mangasee",
            "thumbnail": "https://cover.mangabeast01.com/cover/Sayonara-Football.jpg",
            "thumbnail": "https://cover.nep.li/cover/Sayonara-Football.jpg",
        }
    ]