Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically add summary for archive upload and edits #969

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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