[books] Fix streaming SQL requets bug

This commit is contained in:
2024-04-09 00:30:36 -04:00
parent a0c414135c
commit 2bf0ca1a8c

View File

@ -5,6 +5,7 @@ from datetime import datetime, timedelta
from enum import Enum
import pytz
import requests
from books.models import Author, Book
from books.openlibrary import get_author_openlibrary_id
from django.apps import apps
@ -39,8 +40,8 @@ class KoReaderPageStatColumn(Enum):
def _sqlite_bytes(sqlite_url):
with httpx.stream("GET", sqlite_url) as r:
yield from r.iter_bytes(chunk_size=65_536)
with requests.get(sqlite_url, stream=True) as r:
yield from r.iter_content(chunk_size=65_536)
# Grace period between page reads for it to be a new scrobble