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

Fix standard mode folder comparison view generating "---" in results table #677

Merged
merged 3 commits into from
Jun 24, 2020

Conversation

glubsy
Copy link
Contributor

@glubsy glubsy commented Jun 24, 2020

  • When loading an XML result file containing folder only, the view doesn't read the Folder attributes.
  • A NotImplementedError exception is thrown by get_display_info() since the wrong implementation is called (core.fs.Folder, instead of core.sf.fs.Folder)
  • It seems that adding the corresponding type to the fileclasses attribute fixes the problem
  • Fix bug report Loading Result of 'Scan Type: Folders' shows only '---' in every table cell #676

WARNING: this pull request might need some more proper testing.

* In standard mode, for folder comparison, dupe type is wrongly set as core.fs.Folder
while it should be core.se.fs.Folder.
* Catching the NotImplementedError exception redirects to the appropriate handler
* This is only a temporary workaround until a better fix is implemented
* results.py doesn't set the proper type for dupes at the line
"file = get_file(path)" so we add it on top
* Perhap it could have been added to _get_fileclasses() in core.app.py too
but I have not tested it
core/app.py Outdated
@@ -259,7 +259,7 @@ def _do_delete_dupe(self, dupe, link_deleted, use_hardlinks, direct_deletion):

def _create_file(self, path):
# We add fs.Folder to fileclasses in case the file we're loading contains folder paths.
return fs.get_file(path, self.fileclasses + [fs.Folder])
return fs.get_file(path, self.fileclasses + [se.fs.Folder] + [fs.Folder])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing fs.Folder with se.fs.Folder should be fine in all cases from what I can tell.

Copy link
Contributor Author

@glubsy glubsy Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you're right. It seems the function called will return the first fileclass.can_handle(path) anyway... https://github.com/arsenetar/dupeguru/blob/master/core/fs.py#L257

@arsenetar arsenetar merged commit de0542d into arsenetar:master Jun 24, 2020
@glubsy
Copy link
Contributor Author

glubsy commented Jun 30, 2020

The last commit introduced a regression. The scanner gets stuck at the "Verified X/X matches" dialog window. Might want to revert that last commit. edit: nevermind, I was too quick to judge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants