add more description to image/new

This commit is contained in:
Chaska 2024-04-21 20:41:04 -05:00
parent 328aa18dc3
commit ee001ffbe7
2 changed files with 13 additions and 3 deletions
lib
philomena/scrapers
philomena_web/templates/image

View file

@ -20,10 +20,17 @@ defmodule Philomena.Scrapers.Furaffinity do
_ -> nil
end
description = submission["description"]
|> HtmlSanitizeEx.strip_tags()
|> String.replace(~r/ +/, " ")
|> String.replace(~r/\n \n +/, "\n")
|> String.replace(~r/\n /, "\n")
|> String.trim()
%{
source_url: url,
author_name: submission["name"],
description: submission["description"],
description: description,
tags: [rating],
images: [
%{

View file

@ -10,7 +10,7 @@
h4 Select an image
.image-other
#js-image-upload-previews
p Upload a file from your computer, or provide a link to the page containing the image and click Fetch.
p Upload a file from your computer, or provide a link to the page containing the image and click Fetch.
.field
= file_input f, :image, class: "input js-scraper"
= error_tag f, :image
@ -22,10 +22,13 @@
= error_tag f, :image_duration
= error_tag f, :image_orig_sha512_hash
p - OR -
.field.field--inline
= url_input f, :scraper_url, class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, an X post, or the image directly"
= url_input f, :scraper_url, class: "input input--wide js-scraper", placeholder: "External Page Link"
button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled)
' Fetch
p Supports: DeviantArt, Tumblr, X/Twitter, Furaffinity, Inkbunny, E621 or a direct image link.
.field-error-js.hidden.js-scraper