-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
实现了缩略图的本地缓存, 实现了Mock缩略图数据的获取,形成本地缓存,展示.
Signed-off-by: Sadam·Sadik <[email protected]>
- Loading branch information
Showing
5 changed files
with
114 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# _*_ codign:utf8 _*_ | ||
"""==================================== | ||
@Author:Sadam·Sadik | ||
@Email:[email protected] | ||
@Date:2024/2/22 | ||
@Software: PyCharm | ||
@disc: | ||
=======================================""" | ||
from .image_grid import ScrollableImageGrid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# _*_ codign:utf8 _*_ | ||
"""==================================== | ||
@Author:Sadam·Sadik | ||
@Email:[email protected] | ||
@Date:2024/2/23 | ||
@Software: PyCharm | ||
@disc: | ||
=======================================""" | ||
import requests | ||
|
||
|
||
def mock_images(nsfw: str, page: int = 1, limit: int = 100): | ||
""" | ||
:param page: | ||
:param nsfw: boolean | enum (None, Soft, Mature, X) Filter to images that contain mature content flags or not (undefined returns all) | ||
:param limit: The number of results to be returned per page. This can be a number between 0 and 200. By default, each page will return 100 results. | ||
:return: | ||
""" | ||
resp = requests.get( | ||
"https://civitai.com/api/v1/images?&limit=" + str(limit) + "&page=" + str(page) + "&nsfw=" + nsfw) | ||
items = resp.json()["items"] | ||
return items |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pyicloud~=1.0.0 | ||
colorlog~=6.6.0 | ||
piexif~=1.1.3 | ||
pillow~=10.2.0 | ||
pillow~=10.2.0 | ||
opencv-python~=4.9.0.80 |