Fix: Correctly ignore files that start with a . (eg. .DS_Store)#406
Fix: Correctly ignore files that start with a . (eg. .DS_Store)#406jlwbr wants to merge 0 commit intoTagStudioDev:mainfrom
. (eg. .DS_Store)#406Conversation
tagstudio/src/core/library.py
Outdated
| else: | ||
| entry_id = self.filename_to_entry_id_map.get( | ||
| f.relative_to(self.library_dir), None | ||
| ) | ||
|
|
||
| if entry_id: | ||
| # A exclude file is in the library, let's remove it. | ||
| self.remove_entry(entry_id) |
There was a problem hiding this comment.
Not touching file entries that fall under the exclusion list is intended behavior. This would not only wipe entry data when playing with the exclusion list, but the user wouldn't even be notified of it.
|
Is this a to broad fix? seems overkill to exclude all files that are hidden under linux/macos/unix just to remove a macos |
That's not how this fix works, it just treats the name of the dot file the same as an extension of a normal file. (Eg excluding |
I also presumed that this was hiding all files with a leading dot as Unix would, my mistake for not reading more closely. I feel treating files with leading dots as toggleable hidden files instead of as extensions would make more sense, since that's how these files are designed to be treated. Plus if you had a file such as ".file.json", this wouldn't be registered as a proper ".json" file despite it being a valid file extension on a Unix hidden file. |
I will try this next week, I had the idea of changing up the system so that uses the same syntax as |
There's actually an issue associated with this (#14) if you'd be interested in taking a stab at it |

This pr adresses 2 issues:
.DS_Storefiles doesn't seem to work #399:.DS_Storefiles where not ignored, this was caused by the pathlib library treating a file starting with a dot the same as a file without an extension. We now treat the whole filename as the extension in this case.Closes #399