rpiwebapp-public/test.py

32 lines
778 B
Python
Raw Normal View History

2019-07-06 23:00:00 -07:00
import threading
import time
import os
import sqlite3
from comicapi import comicarchive
from comicapi.issuestring import IssueString
from urllib import parse
from io import BytesIO
from PIL import Image
2019-07-06 23:00:00 -07:00
os.environ["UNRAR_LIB_PATH"] = 'C:\\Program Files (x86)\\UnrarDLL\\UnRAR.dll'
DATABASE = "C:\\Users\\Matthew\\Documents\\MyPrograms\\Websites\\rpi web interface\\database.db"
db = sqlite3.connect(DATABASE)
def get_db():
return db
row_id = 1
comic_id = 0
for row in get_db().execute("SELECT pageNumber, ROWID FROM comic_thumbnails ORDER BY ROWID").fetchall():
print("ROWID:", row[1])
if row[0] == 0:
comic_id += 1
print("comic id:", comic_id)
2019-07-06 23:00:00 -07:00
get_db().execute("UPDATE comic_thumbnails SET id=? WHERE ROWID=?", (comic_id, row[1]))
row_id += 1
get_db().commit()