server/posts: add featured post retrieval

This commit is contained in:
rr-
2016-04-23 08:07:21 +02:00
parent cf00a3a2de
commit 1476c84a9d
9 changed files with 115 additions and 23 deletions

View File

@ -2,7 +2,7 @@ from szurubooru import search
from szurubooru.api.base_api import BaseApi
from szurubooru.func import auth, snapshots
def _serialize_snapshot(snapshot):
def serialize_snapshot(snapshot):
earlier_snapshot = snapshots.get_previous_snapshot(snapshot)
return snapshots.serialize_snapshot(snapshot, earlier_snapshot)
@ -14,4 +14,4 @@ class SnapshotListApi(BaseApi):
def get(self, ctx):
auth.verify_privilege(ctx.user, 'snapshots:list')
return self._search_executor.execute_and_serialize(
ctx, _serialize_snapshot, 'snapshots')
ctx, serialize_snapshot, 'snapshots')