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

Hard-code ignore files with prefix .trashed #14384

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

0ranki
Copy link

@0ranki 0ranki commented Jan 13, 2025

  • Tests written, or not not needed

Creating initally as a draft. Help on how to write tests for this is most welcome, if necessary, as other comments too.

Fixes issue #10645 for people using Google Photos for handling their local copies of photos. Samsung Photos seems to use the same trashcan method too, though this hasn't been tried on a Samsung phone.

Files with the prefix .trashed are excluded from the list of files eligible for sync using the same method as is used for thumbnail files (hard-coded).

@tobiasKaminsky
Copy link
Member

@alperozturk96 I have the same problem with ".nomedia".
I think this is because the logic of subfolder detection changed?

@0ranki
Copy link
Author

0ranki commented Jan 13, 2025

@tobiasKaminsky @Aohzan Sure, I'll include .nomedia and .pending to the list. What app creates those .pending files, by the way?

- Added '.pending' and '.nomedia' to the list of exclude prefixes

Signed-off-by: Jarno Rankinen <[email protected]>
@0ranki 0ranki marked this pull request as ready for review January 14, 2025 16:43
@Aohzan
Copy link

Aohzan commented Jan 14, 2025

@tobiasKaminsky @Aohzan Sure, I'll include .nomedia and .pending to the list. What app creates those .pending files, by the way?

For .pending, I think it's done by Google Photos, I don't have any other app relating with Camera dir 🤔 , I see some discussion about those files and people owning Pixel phones. I have the issue with two Pixel myself

@0ranki
Copy link
Author

0ranki commented Jan 14, 2025

For .pending, I think it's done by Google Photos, I don't have any other app relating with Camera dir 🤔 , I see some discussion about those files and people owning Pixel phones. I have the issue with two Pixel myself

Ok, I have a Pixel too, but don't have Google stuff on it. Well, right now I do to test the trashcan stuff, but no sync to Google.

I did write a rudimentary unit test for the added hasExcludePrefix function, which isn't included yet. Should the branch be rebased to current master?

@tobiasKaminsky
Copy link
Member

Thanks for your help!

I think this should also be added to SyncedFolderUtils -> isQualifiedFolder (L108), as then it ignores all folders with these names.

In my case, I only have an empty ".nomedia" folder, but no files in it.

What do you think?

@0ranki
Copy link
Author

0ranki commented Jan 15, 2025

Thanks for your help!

I think this should also be added to SyncedFolderUtils -> isQualifiedFolder (L108), as then it ignores all folders with these names.

In my case, I only have an empty ".nomedia" folder, but no files in it.

What do you think?

I'd guess folders with those prefixes would be safe to ignore too, so .thumbdata could be added to the same list and the same function used for both

- Rename EXCLUDE_FILENAME_PREFIXES to EXCLUDE_PREFIXES
- Add '.thumbnail' to EXCLUDE_PREFIXES
- Use for folder upload check

Signed-off-by: Jarno Rankinen <[email protected]>
@0ranki
Copy link
Author

0ranki commented Jan 18, 2025

SyncedFolderUtils -> hasExludePrefix is now used in SyncedFolderUtils -> isQualifiedFolder too.

Added a simple unit test.

@0ranki 0ranki requested a review from Aohzan January 18, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants