This commit is contained in:
Hell13Cat
2026-05-26 21:28:43 +03:00
parent 843a3d4bc5
commit bdb9d599bd
5 changed files with 97 additions and 7 deletions
+1
View File
@@ -1,6 +1,7 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
old/
*.py[cod]
*$py.class
+64
View File
@@ -0,0 +1,64 @@
{
"total_images_analyzed": 14003,
"average_weight": {
"bytes": 2980950.54,
"formatted": "2.84 MB"
},
"storage_stats": {
"folders": {
"img": "38.88 GB",
"json_db": "24.39 MB",
"thumb": "331.45 MB",
"logs": "14.44 MB"
},
"types_in_img": {
"images": "38.56 GB",
"videos": "140.80 MB",
"gifs": "181.30 MB",
"logs": "14.44 MB"
},
"grand_total": "39.24 GB"
},
"ratings_stats": {
"explicit": {
"count": 1605,
"size_formatted": "4.52 GB"
},
"sensitive": {
"count": 6623,
"size_formatted": "19.35 GB"
},
"questionable": {
"count": 1591,
"size_formatted": "4.72 GB"
},
"general": {
"count": 4184,
"size_formatted": "10.29 GB"
}
},
"resolution_stats": {
"largest": {
"filename": "5adc7e0e773417f9c379accf.png",
"md5": "5a63c28906dc7e0e7734c379accf",
"resolution": "9921x14031"
},
"smallest": {
"filename": "8fc614e712ad21d2151ccde8a3c87.gif",
"md5": "8fc614e712ae22151ccde8a3c87",
"resolution": "240x280"
}
},
"weight_stats": {
"largest": {
"filename": "4cf0a32c61c7e7914095d1fe.png",
"md5": "4ab6acf0a32c61c7e79fe",
"size_formatted": "65.21 MB"
},
"smallest": {
"filename": "2e1c8a5870b90c3f538d7.png",
"md5": "28c679ea3470b90c3f538d7",
"size_formatted": "6.49 KB"
}
}
}
-1
View File
@@ -1 +0,0 @@
{"_default": {"1": {"name": "Alex", "age": 25}}}
+1
View File
@@ -24,6 +24,7 @@ def post(post_id):
@app.route("/api", methods=["GET", "POST"])
def api():
return "", 204
+31 -6
View File
@@ -1,7 +1,32 @@
# Образец для расширения!
from tinydb import TinyDB, Query
import os
import json
from tinydb import TinyDB
db = TinyDB("db.json")
db.insert({"name": "Alex", "age": 25})
class DB:
def __init__(self):
db_path = "datas"
if not os.path.exists(db_path):
os.makedirs(os.path.dirname(db_path), exist_ok=True)
json.dump({}, open(db_path+"/db.json", "w", encoding="utf-8"))
self.db = TinyDB(db_path+"/db.json")
self.File = Query()
def add(self, data_add):
self.db.insert(data_add)
def get_all(self):
return self.db.all()
def get_search(self, ratings, tags):
results = self.db.search(
self.File.rating.one_of(self.ratings) &
self.File.tags.any(self.tags)
)
return results
def get_unknow(self):
results = self.db.search(self.File.tags == [])
return results
def edit_data(self, id_file, edit_data):
self.db.update(self.edit_data, self.File.md5 == self.id_file)