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

Under macOS, hidden files in the system are displayed by pigallery2. #929

Open
migumigu opened this issue Aug 11, 2024 · 3 comments
Open

Comments

@migumigu
Copy link

Hello, boss
Under macOS, hidden files in the system are displayed by pigallery2.

I installed Node.js and PIgallery2 according to the steps in macOS, and everything is normal.
But the files in my Mac system generate a large number of hidden files.
These hidden files have been displayed by pigallery2. But because files all start with., there is no good way to filter them.

image

Windows displays hidden files like this.
image
These files are showing up and I am very distressed. Currently, I can only sort them by placing them at the end.


你好,大佬
macos下,系统隐藏的文件,被pigallery2展示出来。

我在macos里,按照步骤 安装了 node.js、pigallery2,一切都正常。
但我mac系统里的文件,会生成大量的隐藏文件。
这些隐藏文件,被pigallery2显示出来了。但是因为文件都是以.开头的,没有好的办法做过滤。

Windows 显示隐藏文件,是这样子。

这些文件显示出来让我很苦恼,目前只能通过排序的方式,把它们排到后面。

@bpatrik
Copy link
Owner

bpatrik commented Aug 21, 2024

related to #803 and possible duplicate of #661

@crispybegs
Copy link

if it's helpful at all, I fixed this last night by putting two commands in a script then creating a cronjob that runs every 30 minutes to clean up those files.

For ref, my pigallery runs in docker on a linux machine, but all my day to day photo admin takes place on macs, including moving photos to that server, so I always get those annoying files. These are the notes I left myself:

Two commands to do this:

find /media/crispy/NAS_4TB_1/media/photos/ -type f -name "*._*" -exec rm -f {} \;
find /media/crispy/NAS_4TB_1/media/photos/ -type f -name "*.DS_Store*" -exec rm -f {} \;

The first deletes ._ and the second deletes .DS_Store files

These two are put into a script called remove_apple_shit_from_photos.sh and this is saved at /home/crispy/scripts/remove_apple_shit_from_photos.sh

This script is run every 30 mins via cronjob (crontab -e) and the contents of the crontab looks like this:

*/30 * * * * /home/chris/scripts/remove_apple_shit_from_photos.sh

@kagahd
Copy link
Contributor

kagahd commented Oct 30, 2024

@crispybegs I'd remove the leading * of the -name "*._*" parameter in order to delete only those files that start with ._.
Since this would also delete ._.DS_Store files, I'd also remove the leading and trailing * of the -name *.DS_Store* parameter.
So the commands would be:

find /media/crispy/NAS_4TB_1/media/photos/ -type f -name "._*" -exec rm -f {} \; 
find /media/crispy/NAS_4TB_1/media/photos/ -type f -name ".DS_Store" -exec rm -f {} \; 

Otherwise, you could delete more files as you really wanted, e.g. the files shopping.in.DS_Store.N.Y.jpg or foo._bla.jpg just to give an example.

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

No branches or pull requests

4 participants