mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 03:20:46 +02:00
feat(merge): use metadata for sortByDate (#4461)
# Description of Changes Follow-up for: https://github.com/Stirling-Tools/Stirling-PDF/issues/4233#issuecomment-3299735631 Please read thread there. ### Quick summary: - Paths/BasicFileAttributes for getting creaton/modifcation date ALWAYS resulted on 0 - Comporator, therefore always merged in the order it was handed to it - -\> when calling this was not an issue because front-end arranged the files on right sortByDate - -\> when calling from API however, due to this, it wasn't working ### Fix: - Rely on PDF/XMP metadata on the back-end for merging, while that is also not completely reliable still better Closes: #4233 <!-- Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --> --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Signed-off-by: Balázs Szücs <[email protected]>
This commit is contained in:
@@ -175,6 +175,13 @@ function updateFiles() {
|
||||
}
|
||||
}
|
||||
document.getElementById("fileInput-input").files = dataTransfer.files;
|
||||
|
||||
// Also populate hidden fileOrder to preserve visible order
|
||||
const order = Array.from(liElements)
|
||||
.map((li) => li.querySelector(".filename").innerText)
|
||||
.join("\n");
|
||||
const orderInput = document.getElementById("fileOrder");
|
||||
if (orderInput) orderInput.value = order;
|
||||
}
|
||||
|
||||
document.querySelector("#resetFileInputBtn").addEventListener("click", ()=>{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<span class="tool-header-text" th:text="#{merge.header}"></span>
|
||||
</div>
|
||||
<form th:action="@{'api/v1/general/merge-pdfs'}" method="post" enctype="multipart/form-data">
|
||||
<input id="fileOrder" name="fileOrder" type="hidden" />
|
||||
<div class="mb-3">
|
||||
<label th:text="#{multiPdfDropPrompt}" for="fileInput-input"></label>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user