| @@ -16,25 +16,25 @@ def get_last_read(uid, mid): | |||||
| def chapter_read_manual(uid, mid, chap): | def chapter_read_manual(uid, mid, chap): | ||||
| username = get_dbusername(uid) | username = get_dbusername(uid) | ||||
| title = get_dbtitle(mid) | title = get_dbtitle(mid) | ||||
| print("User : %s" % username) | |||||
| print("Manga : %s" % mid) | |||||
| print("User : %s" % str(username)) | |||||
| print("Manga : %s" % str(mid)) | |||||
| print("Chapter : %s" % str(chap)) | print("Chapter : %s" % str(chap)) | ||||
| rows = cursor.fetchall() | rows = cursor.fetchall() | ||||
| print("Last Chap: %s " % get_last_dread(uid, mid) ) | |||||
| print("Last Chap: %s " % get_last_read(uid, mid) ) | |||||
| if str(get_last_read(uid, mid)) == str(chap) : | if str(get_last_read(uid, mid)) == str(chap) : | ||||
| print("Vous avez deja lu ce chapitre") | print("Vous avez deja lu ce chapitre") | ||||
| else : | else : | ||||
| print("Vous n'avez pas vu le chapitre {} du manga {}".format(chap, username)) | |||||
| print("Vous n'avez pas vu le chapitre {} du manga {}".format(chap, title)) | |||||
| cursor.execute("UPDATE readings SET chap = '{}' WHERE mid = '{}' AND uid = '{}';".format(chap, mid, uid) ) | cursor.execute("UPDATE readings SET chap = '{}' WHERE mid = '{}' AND uid = '{}';".format(chap, mid, uid) ) | ||||
| conn.commit() | conn.commit() | ||||
| # cursor.execute("SELECT password FROM users WHERE username = '%s' ;") | |||||
| #cursor.execute("INSERT INTO manga(id, title, author, url, chap, img) VALUES(:id, :title, :author, :url, :chap, :img)") | |||||
| def main(): | def main(): | ||||
| input("") | |||||
| chapter_read_manual(1, 31477, 2) | |||||
| uid = input("UserID : ") | |||||
| mid = input("MangaID : ") | |||||
| chap = input("Chap : ") | |||||
| chapter_read_manual(uid, mid, chap) | |||||