TagStudioDev / TagStudio

A User-Focused Photo & File Management System
https://docs.tagstud.io/
GNU General Public License v3.0
5.29k stars 376 forks source link

[Bug]: Ignoring `.DS_Store` files doesn't seem to work #399

Open vladfrangu opened 3 months ago

vladfrangu commented 3 months ago

Checklist

TagStudio Version

Alpha 9.3.2

Operating System & Version

macOS 15.0 Beta (24A5327a)

Description

Using this on macOS, I tried ignoring .DS_Store files via the exclusion list for extensions. This however didn't seem to do anything (unless I did something wrong). I'd love to also try and help out debugging, which I may try later today if I've gotten some time 😅.

(If this is duplicated or wrongly filed, super sorry! Couldn't exactly tell if this was a feature req or a bug)

Expected Behavior

Adding in .DS_Store to the ignored extensions should remove them from the UI

Steps to Reproduce

  1. Be on macOS (or just create a file called .DS_Store in your folder)
  2. Add .DS_Store to the exclusion list (I see it gets lowercased but the code also seems to check lowercased anyways)
  3. Refresh library and observe

Logs

No response

CyanVoxel commented 3 months ago

Looking at some of the DS_Store files I have collecting dust on my system (currently testing this on Windows) I have a hunch what it might be. Are the DS_Store files that remain after excluding .ds_store these type of "_DS_Store" with no extension? They also wouldn't have the "DS_STORE" extension label in TagStudio. The ones with the extension get excluded fine for me but the ones without it do not.

image

vladfrangu commented 3 months ago

This is what it currently shows for me. The exclusion of .ds_store didn't actually hide any of the files. 😅 And I thought it might've been the Google Drive virtual folder, but I tried another folder and the .DS_Store files still show up (and also don't get that DS_STORE label yours have

TagStudio - 2024-08-26 at 21 06 19

CyanVoxel commented 3 months ago

This is what it currently shows for me. The exclusion of .ds_store didn't actually hide any of the files. 😅 And I thought it might've been the Google Drive virtual folder, but I tried another folder and the .DS_Store files still show up (and also don't get that DS_STORE label yours have

Ah, it's the leading solo dot in the filename causing the issue - I'm able to replicate it. I believe the pathlib Python library treats this as the entire filename with no extension, when really it should be doing the opposite for what we want here. ".DS_Store" is probably the most likely case affected by this but it could in theory affect any similar filename.

image

Toby222 commented 3 months ago

a leading dot on unix-like systems is used to just mean "hidden" and isn't a file extension