Skip to content

Commit

Permalink
automatically add summary for archive upload and edits (#969)
Browse files Browse the repository at this point in the history
* render html in summary

* add summary from upload and metadata plugin call

* Revert "render html in summary"

This reverts commit 33cf1d3.

* shorten archive summary notice
  • Loading branch information
psilabs-dev authored Apr 22, 2024
1 parent e362455 commit 6c2be00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/LANraragi/Model/Plugins.pm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ sub exec_metadata_plugin {
$newtitle = trim($newtitle);
$returnhash{title} = $newtitle;
}

# Include updated summary data in response
if ( exists $newmetadata{summary} ) {
$returnhash{summary} = $newmetadata{summary};
}

return %returnhash;
}
return ( error => "Plugin doesn't implement get_tags despite having a 'metadata' type." );
Expand Down
8 changes: 8 additions & 0 deletions public/js/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ Edit.getTags = function () {
});
}

if (result.data.summary && result.data.summary !=="") {
$("#summary").val(result.data.summary);
LRR.toast({
heading: "Archive summary updated!",
icon: "info",
});
}

if (result.data.new_tags !== "") {
result.data.new_tags.split(/,\s?/).forEach((tag) => {
// Remove trailing/leading spaces from tag before adding it
Expand Down

0 comments on commit 6c2be00

Please sign in to comment.