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

Ignore media files #221

Merged
merged 2 commits into from Mar 12, 2021
Merged

Ignore media files #221

merged 2 commits into from Mar 12, 2021

Conversation

Kjeldgaard
Copy link
Contributor

Added feature to ignore specific media files. E.g. to ignore .png media
files, add '*.png' to .photoviewignore file or add 'img_1234.jpg' to
ignore a specific file. This applies to the current dir and any
potential subdir. Matching is case sensitive. File ignore pattern must
include a '.', otherwise the pattern is treated as a dir ignore pattern.

Signed-off-by: Kjeldgaard Kjeldgaard@users.noreply.github.com

Added feature to ignore specific media files. E.g. to ignore .png media
files, add '*.png' to .photoviewignore file or add 'img_1234.jpg' to
ignore a specific file. This applies to the current dir and any
potential subdir. Matching is case sensitive. File ignore pattern must
include a '.', otherwise the pattern is treated as a dir ignore pattern.

Signed-off-by: Kjeldgaard <Kjeldgaard@users.noreply.github.com>
@Kjeldgaard
Copy link
Contributor Author

First attempt at a media file ignore feature. Comments are welcome.

Copy link
Member

@viktorstrate viktorstrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Kjeldgaard thank you for the pull-request. I've added some comments. I'd like to hear what you think as well. Please feel free to reply to them if you think I've missed something or it's unclear.

api/graphql/models/album.go Outdated Show resolved Hide resolved
api/scanner/scanner_album.go Outdated Show resolved Hide resolved
api/scanner/scanner_user.go Outdated Show resolved Hide resolved
api/scanner/scanner_user.go Outdated Show resolved Hide resolved
api/scanner/scanner_user.go Outdated Show resolved Hide resolved
@viktorstrate viktorstrate added this to In progress in Roadmap Mar 1, 2021
Store album ignore data in cache and not database. Fix albums with only
ignore-media-only not to be shown in album list. Use
github.com/sabhiram/go-gitignore exclusively for photoviewignore.

Signed-off-by: Kjeldgaard <Kjeldgaard@users.noreply.github.com>
@Kjeldgaard
Copy link
Contributor Author

Ok, so I'm now using cache for storing ignore data. And I'm not using path/filepath for any file matching anymore. I had an issue with albums showing up, despite the album only contained files which should be ignored. It required me to change directoryContainsPhotos(), but now it passes my own tests.

@viktorstrate
Copy link
Member

Looks great, I'll test it my self in one of the following days 👍

@viktorstrate viktorstrate merged commit 08a9919 into photoview:master Mar 12, 2021
Roadmap automation moved this from In progress to Done Mar 12, 2021
@Kjeldgaard Kjeldgaard deleted the ignore_media branch March 16, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants