Polish upload drafts, restore availability and offline API docs

This commit is contained in:
Pigway
2026-10-02 00:11:37 +08:00
parent 6652590b84
commit a4a257553a
9 changed files with 96 additions and 5 deletions
+8
View File
@@ -79,6 +79,14 @@ class Assets:
)
return self.info(asset_id)
def promote(self, asset_id):
row = self.db.one("SELECT * FROM assets WHERE id=?", (asset_id,))
if row and row["kind"] == "cache":
target = self.settings.data_dir / "images" / (asset_id + ".jpg")
self.path(asset_id).replace(target)
self.db.execute("UPDATE assets SET kind='images' WHERE id=?", (asset_id,))
return self.info(asset_id)
def info(self, asset_id):
row = self.db.one("SELECT * FROM assets WHERE id=?", (asset_id,))
if not row: