').confirm(function(answer){
+ if(answer.response){
+ console.log("Selected " + $('select',this).val());
+ var flagType = $('select',this).val();
+ if (flagType == null){
+ console.log("Invalid flagType");
+ return;
+ }
+ if (!SetFlagOnScene(flagType, ActionID))
+ return;
+ ActionID = ActionID + ":" + flagType;
+ console.log("ActionID = " + ActionID);
+ RunPluginOperation(Mode, ActionID, button, false);
+ }
+ else console.log("Not valid response");
+ });
+}
+$(document).ready(function(){
+ OrgPrevPage = $("#PrevPage").attr('href');
+ OrgNextPage = $("#NextPage").attr('href');
+ OrgHomePage = $("#HomePage").attr('href');
+ console.log("OrgNextPage = " + OrgNextPage);
+
+ const queryString = window.location.search;
+ const urlParams = new URLSearchParams(queryString);
+ console.log("urlParams = " + urlParams);
+ RemoveToKeepConfirmValue = StrRemoveToKeepConfirm + "false";
+ RemoveValidatePromptValue = StrRemoveValidatePrompt + "false";
+ var FetchCookies = true;
+ if (urlParams.get('RemoveToKeepConfirm') != null && urlParams.get('RemoveToKeepConfirm') !== ""){
+ FetchCookies = false;
+ RemoveToKeepConfirmValue = StrRemoveToKeepConfirm + urlParams.get('RemoveToKeepConfirm');
+ if (urlParams.get('RemoveToKeepConfirm') === "true")
+ $( "#RemoveToKeepConfirm" ).prop("checked", true);
+ else
+ $( "#RemoveToKeepConfirm" ).prop("checked", false);
+ }
+ if (urlParams.get('RemoveValidatePrompt') != null && urlParams.get('RemoveValidatePrompt') !== ""){
+ FetchCookies = false;
+ RemoveValidatePromptValue = StrRemoveValidatePrompt + urlParams.get('RemoveValidatePrompt');
+ console.log("RemoveValidatePromptValue = " + RemoveValidatePromptValue);
+ if (urlParams.get('RemoveValidatePrompt') === "true")
+ $( "#RemoveValidatePrompt" ).prop("checked", true);
+ else
+ $( "#RemoveValidatePrompt" ).prop("checked", false);
+ }
+ if (FetchCookies){
+ console.log("Cookies = " + document.cookie);
+ var cookies = document.cookie;
+ if (cookies.indexOf(StrRemoveToKeepConfirm) > -1){
+ var idx = cookies.indexOf(StrRemoveToKeepConfirm) + StrRemoveToKeepConfirm.length;
+ var s = cookies.substring(idx);
+ console.log("StrRemoveToKeepConfirm Cookie = " + s);
+ if (s.startsWith("true"))
+ $( "#RemoveToKeepConfirm" ).prop("checked", true);
+ else
+ $( "#RemoveToKeepConfirm" ).prop("checked", false);
+ }
+ if (cookies.indexOf(StrRemoveValidatePrompt) > -1){
+ var idx = cookies.indexOf(StrRemoveValidatePrompt) + StrRemoveValidatePrompt.length;
+ var s = cookies.substring(idx);
+ console.log("StrRemoveValidatePrompt Cookie = " + s);
+ if (s.startsWith("true"))
+ $( "#RemoveValidatePrompt" ).prop("checked", true);
+ else
+ $( "#RemoveValidatePrompt" ).prop("checked", false);
+ }
+ }
+ SetPaginateButtonChange();
+ function ProcessClick(This_){
+ if (This_ == null)
+ return;
+ const ID = This_.id;
+ var Value = This_.getAttribute("value");
+ if ((ID == null || ID === "") && (Value == null || Value === ""))
+ return;
+ if (Value == null) Value = "";
+ var Mode = Value;
+ var ActionID = ID;
+ console.log("Mode = " + Mode + "; ActionID =" + ActionID);
+ if (Mode === "DoNothing")
+ return;
+ if (ActionID === "AdvanceMenu" || ActionID === "AdvanceMenu_")
+ {
+ var newUrl = window.location.href;
+ if (isAxterCom)
+ newUrl = newUrl.replace("/file.html", "/advance_options.html");
+ else
+ newUrl = newUrl.replace(/report\/DuplicateTagScenes[_0-9]*.html/g, "advance_options.html?GQL=" + GraphQl_URL + "&apiKey=" + apiKey);
+ window.open(newUrl, "_blank");
+ return;
+ }
+ if (Mode.startsWith("deleteScene") || Mode === "removeScene"){
+ var chkBxDisableDeleteConfirm = document.getElementById("RemoveToKeepConfirm");
+ question = "Are you sure you want to delete this file and remove scene from stash?";
+ if (Mode !== "deleteScene" && Mode.startsWith("deleteScene")) question = "Are you sure you want to delete all the flagged files and remove them from stash?";
+ if (Mode === "removeScene") question = "Are you sure you want to remove scene from stash?";
+ if (!chkBxDisableDeleteConfirm.checked && !confirm(question))
+ return;
+ if (Mode === "deleteScene" || Mode === "removeScene"){
+ $('.ID_' + ActionID).css('background-color','gray');
+ $('.ID_' + ActionID).css('pointer-events','none');
+ }
+ }
+ else if (ID === "viewStashPlugin")
+ window.open(GetStashTabUrl("plugins"), "_blank");
+ else if (ID === "viewStashTools")
+ window.open(GetStashTabUrl("tools"), "_blank");
+ else if (Mode === "newName" || Mode === "renameFile"){
+ var myArray = ActionID.split(":");
+ var promptStr = "Enter new name for scene ID " + myArray[0] + ", or press escape to cancel.";
+ if (Mode === "renameFile")
+ promptStr = "Press enter to rename scene ID " + myArray[0] + ", or press escape to cancel.";
+ var newName=prompt(promptStr,trim(myArray[1], "'"));
+ if (newName === null)
+ return;
+ ActionID = myArray[0] + ":" + newName;
+ Mode = "renameFile";
+ }
+ else if (Mode === "flagScene"){
+ selectMarker(Mode, ActionID, This_);
+ return;
+ }
+ else if (Mode.startsWith("flagScene")){
+ var flagType = Mode.substring(9);
+ Mode = "flagScene";
+ if (!SetFlagOnScene(flagType, ActionID))
+ return;
+ ActionID = ActionID + ":" + flagType;
+ console.log("ActionID = " + ActionID);
+ }
+ RunPluginOperation(Mode, ActionID, This_, true);
+ }
+ $("button").click(function(){
+ ProcessClick(this);
+ });
+ $("a").click(function(){
+ if (this.id.startsWith("btn_mnu"))
+ return;
+ if (this.id === "reload"){
+ window.location.reload();
+ return;
+ }
+ if (this.id === "PrevPage" || this.id === "NextPage" || this.id === "HomePage" || this.id === "PrevPage_Top" || this.id === "NextPage_Top" || this.id === "HomePage_Top"){
+ return;
+ }
+ ProcessClick(this);
+ });
+ $("div").click(function(){
+ if (this.id.startsWith("btn_mnu"))
+ return;
+ if (this.id === "reload"){
+ window.location.reload();
+ return;
+ }
+ ProcessClick(this);
+ });
+ $("#RemoveValidatePrompt").change(function() {
+ console.log("checkbox clicked");
+ SetPaginateButtonChange();
+ });
+ $("#RemoveToKeepConfirm").change(function() {
+ SetPaginateButtonChange();
+ });
+});
diff --git a/plugins/DupFileManager/DupFileManager_report_config.py b/plugins/DupFileManager/DupFileManager_report_config.py
index 08837a7..1d0bc4f 100644
--- a/plugins/DupFileManager/DupFileManager_report_config.py
+++ b/plugins/DupFileManager/DupFileManager_report_config.py
@@ -45,4 +45,8 @@ report_config = {
"htmlReportName" : "DuplicateTagScenes.html",
# If enabled, create an HTML report when tagging duplicate files
"createHtmlReport" : True,
+ # To use a private or an alternate site to access report and advance menu
+ "remoteReportDirURL" : "https://stash.axter.com/1.1/",
+ # To use a private or an alternate site to access jquery, easyui, and jquery.prompt
+ "js_DirURL" : "https://www.axter.com/js/",
}
diff --git a/plugins/DupFileManager/DupFileManager_report_header b/plugins/DupFileManager/DupFileManager_report_header
index 425f06d..67aee0e 100644
--- a/plugins/DupFileManager/DupFileManager_report_header
+++ b/plugins/DupFileManager/DupFileManager_report_header
@@ -3,304 +3,29 @@
Stash Duplicate Report
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
Report Info
Report Options
@@ -313,7 +38,7 @@ $(document).ready(function(){
Menu
-
Advance Duplicate File Deletion Menu
+
Advance Duplicate File Menu
Reload Page
Stash Plugins
Stash Tools
diff --git a/plugins/DupFileManager/README.md b/plugins/DupFileManager/README.md
index f70269b..80319d9 100644
--- a/plugins/DupFileManager/README.md
+++ b/plugins/DupFileManager/README.md
@@ -1,11 +1,11 @@
-# DupFileManager: Ver 1.1.2 (By David Maisonave)
+# DupFileManager: Ver 1.1.3 (By David Maisonave)
DupFileManager is a [Stash](https://github.com/stashapp/stash) plugin which manages duplicate files in the Stash system.
It has both **task** and **tools-UI** components.
### Features
-- Creates a duplicate file report which can be accessed from the settings->tools menu options.The report is created as an HTML file and stored in local path under plugins\DupFileManager\report\DuplicateTagScenes.html.
+- Creates a duplicate file report which can be accessed from the Stash->Settings->Tools menu options.The report is created as an HTML file and stored in local path under plugins\DupFileManager\report\DuplicateTagScenes.html.
- See screenshot at the bottom of this page for example report.
- Items on the left side of the report are the primary duplicates designated for deletion. By default, these duplicates are given a special _duplicate tag.
- Items on the right side of the report are designated as primary duplicates to keep. They usually have higher resolution, duration and/or preferred paths.
@@ -24,8 +24,7 @@ It has both **task** and **tools-UI** components.
- Normally when Stash searches the file name for tag names, performers, and studios, it only does so using the primary file.
- Advance menu
- 
- - Advance menu can be access from the Settings->Tools->**[DupFileManager Tools and Utilities]** menu or from the **reports**.
- - Only access Advance Menu from the report when using Stash setup requiring a password.
+ - Advance menu can be access from the Stash->Settings->Tools->**[Duplicate File Report]** menu or from the **DupFileManager Tools & Util**.
- Here are **some** of the options available in the **Advance Menu**.
- Delete specially tagged duplicates in blacklist path.
- Delete duplicates with specified file path.
@@ -39,11 +38,11 @@ It has both **task** and **tools-UI** components.
- Bottom extended portion of the Advanced Menu is for customizing the report.
- 
- Delete duplicate file task with the following options:
- - Tasks (Settings->Task->[Plugin Tasks]->DupFileManager)
+ - Tasks (Stash->Settings->Task->[Plugin Tasks]->DupFileManager)
- **Tag Duplicates** - Set tag DuplicateMarkForDeletion to the duplicates with lower resolution, duration, file name length, and/or black list path.
- **Delete Tagged Duplicates** - Delete scenes having DuplicateMarkForDeletion tag.
- **Delete Duplicates** - Deletes duplicate files. Performs deletion without first tagging.
- - Plugin UI options (Settings->Plugins->Plugins->[DupFileManager])
+ - Plugin UI options (Stash->Settings->Plugins->Plugins->[DupFileManager])
- Has a 3 tier path selection to determine which duplicates to keep, and which should be candidates for deletions.
- **Whitelist** - List of paths NOT to be deleted.
- E.g. C:\Favorite\,E:\MustKeep\
@@ -80,8 +79,39 @@ That's it!!!
### Options
-- Options are accessible in the GUI via Settings->Plugins->Plugins->[DupFileManager].
-- More options available in DupFileManager_config.py.
+- Options are accessible in the GUI via Stash->Settings->Plugins->Plugins->[DupFileManager].
+- Also see:
+ - Stash->Settings->Tools->[Duplicate File Report]
+ - Stash->Settings->Tools->[DupFileManager Tools and Utilities]
+- More options available on the following link:
+ - [advance_options.html](https://stash.axter.com/1.1/advance_options.html)
+ - When using a Stash installation that requires a password or that is not using port 9999...
+ - Access above link from Stash->Settings->Tools->[Duplicate File Report]->[**Advance Duplicate File Menu**]
+ - Or add the GQL and apiKey as parameters to the URL.
+ - Example: https://stash.axter.com/1.1/advance_options.html?GQL=http://localhost:9999/graphql&apiKey=1234567890abcdefghijklmnop
+ - See following for more details: [Stash Password](README.md#Stash-Password)
+
+### Advanced Options
+
+Users can setup a private or alternate remote site by changing variables **remoteReportDirURL** and **js_DirURL** in file DupFileManager_report_config.py.
+- The following files are needed at the remote site that is pointed to by **remoteReportDirURL**.
+ - DupFileManager_report.js
+ - DupFileManager_report.css
+ - file.html
+ - advance_options.html
+- The **js_DirURL** path requires the following:
+ - jquery-3.7.1.min.js
+ - EasyUI associated files
+ - jquery.prompt.js and jquery.prompt.css
+
+### Stash Password
+
+- Stash installation configured with a password, need to generate an API-Key.
+ - To generate an API-Key:
+ - Go to Stash->Settings->Security->Authentication->[API Key]
+ - Click on [Generate API-Key]
+- Once the API key is generated, DupFileManager will automatically fetch the key.
+
### Screenshots
@@ -103,6 +133,7 @@ That's it!!!
### Future Planned Features, Changes, or Fixes
- Scheduled Changes
+ - Remove [Max Dup Process] from the Stash->Plugins GUI. This option already exist in advance menu. Planned for 1.2.0 Version.
- Add chat icon to report which on hover, displays a popup window showing scene details content. Planned for 1.2.0 Version.
- Add image icon to report; on hover show scene cover image. Planned for 1.2.0 Version.
- Add studio icon to report; on hover show studio name. Planned for 1.2.0 Version.
@@ -121,12 +152,13 @@ That's it!!!
- Fix errors on HTML page listed in https://validator.w3.org.
- Add logic to merge performers and galaries seperatly from tag merging on report.
- Add logic to merge group metadata when selecting merge option on report.
- - Add advanced menu directly to the Settings->Tools menu.
- - Add report directly to the Settings->Tools menu.
+ - Add advanced menu directly to the Stash->Settings->Tools menu. (This change does not look doable!!!)
+ - Add report directly to the Stash->Settings->Tools menu. (This change does not look doable!!!)
- Create cookies for the options in the [**Advance Duplicate File Menu**].
- Add doulbe strike-through option to flagging.
- Add option to report to avoid reloading page after updating report.
- Add option to report to automatically strip width & height from name on rename.
- Add link to version history to [**Advance Duplicate File Menu**] and to [DupFileManager Tools and Utilities]
+ - Move [Merge Duplicate Tags], [Whitelist Delete In Same Folder], and [Swap Better **] field options from the Stash->Plugins GUI to the advance menu.
diff --git a/plugins/DupFileManager/advance_options.html b/plugins/DupFileManager/advance_options.html
index ba07b16..d914edb 100644
--- a/plugins/DupFileManager/advance_options.html
+++ b/plugins/DupFileManager/advance_options.html
@@ -10,13 +10,12 @@ table, th, td {border:1px solid black;}
}
html.wait, html.wait * { cursor: wait !important; }
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+