(new small feature) 0.1.1 - update anime status

main
KKlochko 3 years ago
parent fd0a1d0bf4
commit fc43ec713a

@ -1,3 +1,5 @@
* Change Log * Change Log
** 0.1.0 <2022-07-08 чт> ** 0.1.0 <2022-07-08>
First release First release
** 0.1.1 <2022-07-08>
New small feature: update anime status

@ -63,3 +63,12 @@ class DataBase:
connect.commit() connect.commit()
cursor.close() cursor.close()
connect.close() connect.close()
def update_anime_status(self, url, new_status):
"""Add entry of a content."""
connect = sqlite3.connect(self.PATH)
cursor = connect.cursor()
cursor.execute(f"UPDATE {self.TABLE} SET Status = {new_status} WHERE Url = '{url}'")
connect.commit()
cursor.close()
connect.close()

@ -23,6 +23,7 @@ def main():
db = DataBase() db = DataBase()
# Test data # Test data
db.add_anime("test.url", "The anime", "1") db.add_anime("test.url", "The anime", "1")
db.update_anime_status("test.url", "2")
if __name__ == "__main__": if __name__ == "__main__":
main() main()

Loading…
Cancel
Save