Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33103243
backup_view.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
830 B
Referenced Files
None
Subscribers
None
backup_view.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Web.PleromaAPI.BackupView
do
use
Pleroma.Web
,
:view
alias
Pleroma.User.Backup
alias
Pleroma.Web.CommonAPI.Utils
def
render
(
"show.json"
,
%{
backup
:
%
Backup
{}
=
backup
})
do
%{
id
:
backup
.
id
,
content_type
:
backup
.
content_type
,
url
:
download_url
(
backup
),
file_size
:
backup
.
file_size
,
processed
:
backup
.
processed
,
inserted_at
:
Utils
.
to_masto_date
(
backup
.
inserted_at
)
}
end
def
render
(
"index.json"
,
%{
backups
:
backups
})
do
render_many
(
backups
,
__MODULE__
,
"show.json"
)
end
def
download_url
(%
Backup
{
file_name
:
file_name
})
do
Pleroma.Upload
.
base_url
()
<>
"/backups/"
<>
file_name
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Tue, Jan 20, 1:28 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
973717
Default Alt Text
backup_view.ex (830 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment