mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Only query the dir_filter for directories
This commit is contained in:
parent
34152fbe54
commit
2aed4f6d1f
@ -38,6 +38,12 @@ class IliasElementType(Enum):
|
|||||||
FORUM = "FORUM"
|
FORUM = "FORUM"
|
||||||
EXTERNAL_LINK = "EXTERNAL_LINK"
|
EXTERNAL_LINK = "EXTERNAL_LINK"
|
||||||
|
|
||||||
|
def is_folder(self) -> bool:
|
||||||
|
"""
|
||||||
|
Returns whether this type is some kind of folder.
|
||||||
|
"""
|
||||||
|
return "FOLDER" in str(self.name)
|
||||||
|
|
||||||
|
|
||||||
IliasDirectoryFilter = Callable[[Path, IliasElementType], bool]
|
IliasDirectoryFilter = Callable[[Path, IliasElementType], bool]
|
||||||
|
|
||||||
@ -167,7 +173,7 @@ class IliasCrawler:
|
|||||||
PRETTY.not_searching(entry.path, "forum")
|
PRETTY.not_searching(entry.path, "forum")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not self.dir_filter(entry.path, entry.entry_type):
|
if entry.entry_type.is_folder() and not self.dir_filter(entry.path, entry.entry_type):
|
||||||
PRETTY.not_searching(entry.path, "user filter")
|
PRETTY.not_searching(entry.path, "user filter")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user