Polish upload drafts, restore availability and offline API docs
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user