MediaElch
MediaElch copied to clipboard
Movie excluding filter on folders doesn't work for nested directories
Describe the bug Folder excluding filter (ie. <exclude><pattern applyTo="folders">...</exclude>) in advancedsettings.xml doen't work.
To Reproduce
- Define a folder excluding pattern in advancedsettings.xml.
- Eg.
<pattern applyTo="folders">test-movies</pattern>
- Eg.
- Start MediaElch.
- Perform rescan.
Expected behavior Excluded folders are not be shown in the movie list.
MediaElch Version:
- 2.8.2 stable
Operating System:
- Linux (distribution: Linux Mint 20)
Additional context On the other hand, filename filter works.
Thanks you for reporting this issue! #1112 will fix your issue. Do you use the AppImage oder launchpad PPA? :-)
Hi, I am using AppImage.
Ah, ok. Then I'll release a Nightly version that you can download. I won't update the PPA, yet. I only do that for releases. :-)
I'll let you know when it's available.
Thanks!
AppImage is now available here: https://bintray.com/bugwelle/MediaElch/MediaElch-Nightly/v2.8.3-dev#files
Thanks for the AppImage. It worked: Movies in directories matched with exclude patterns are excluded.
Unfortunately, the behaviour is a little bit different from my expectation:
- Expectation: Movie's path's directory is filtered.
- Actual: Only direct parent (just upper the movie file) directory is filtered.
For example, when the pattern is <pattern applyTo="folders">test-movies</pattern>
,
- "/home/uname/My Videos/test-movies/test-152.vob" is excluded, but,
- "/home/uname/My Videos/test-movies/test3/video1/test-001.vob" is not excluded.
I think this is not a bug anymore, however, I wish movie path can be filtered. And because I have read related thread (feature request) before, will wait for it implemented.
Thank you.
Yes, that's correct. I noticed that as well and added an inline comment:
https://github.com/Komet/MediaElch/pull/1112/files#r546548419
It's on my TODO list.
Note: Just noticed that this nightly has a new bug in it. Loading movie scraper settings may not work. Will fix this issue today.
Thanks!
Hi,
Yes, that's correct. I noticed that as well and added an inline comment:
https://github.com/Komet/MediaElch/pull/1112/files#r546548419
I just looked the code(MovieFileSearcher.cpp). Although I have no experiance on Qt programming, I have an idea to implement excluding directories by path (not the last part of the path).
In the iterator block, check if the path matches with current directory excluding filter. Eg.:
// TODO: If there is a BluRay structure then the directory filter may not work // because BDMV's parent directory is not listed. if ((isDir && Settings::instance()->advanced()->isFolderExcluded(fileName)) || Settings::instance()->advanced()->isFolderExcluded(dirName) // This can be disabled. || Settings::instance()->advanced()->isFolderExcluded(path) // ADD: Check if path is excluded. ) { continue; }
But, sorry, I am not sure this is really ok (isFolderExcluded() can take path?).
Hi,
I explicitly didn't want to check for the path because it may include segments that the user does not want to check against. The issue is that the Qt file iterator automatically goes into sub-directories and matches files (and directories) that match a certain pattern.
I have a good idea how I can fix it. However, it's a days work and I have other issues to fix first. :-/
But I'll reopen this issue to keep track of it. 😄
Hi,
Okay, no problem. I am willing to wait for your fix. For me, this is just a minor problem.
Fixed via https://github.com/Komet/MediaElch/pull/1653 ; #1547 seems to be a duplicate of this issue