|
|
@@ -210,6 +210,8 @@ sub get ($self, %request) {
|
|
|
@filtered = _add_post_type(@filtered);
|
|
|
# Next, add the type of post this is
|
|
|
@filtered = _add_media_type(@filtered);
|
|
|
+ # Finally, add visibility
|
|
|
+ @filtered = _add_visibility(@filtered);
|
|
|
|
|
|
return ($pages,\@filtered);
|
|
|
}
|
|
|
@@ -241,6 +243,15 @@ sub _add_media_type (@posts) {
|
|
|
} @posts;
|
|
|
}
|
|
|
|
|
|
+sub _add_visibility (@posts) {
|
|
|
+ return map {
|
|
|
+ my $post = $_;
|
|
|
+ my @visibilities = grep { my $tag = $_; grep { $_ eq $tag } qw{private unlisted public} } @{$post->{tags}};
|
|
|
+ $post->{visibility} = $visibilities[0];
|
|
|
+ $post
|
|
|
+ } @posts;
|
|
|
+}
|
|
|
+
|
|
|
sub add ($self, @posts) {
|
|
|
require UUID::Tiny;
|
|
|
foreach my $post (@posts) {
|