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

Download all albums, add album name to file name #130

Closed
wants to merge 3 commits into from

Conversation

tymmej
Copy link
Contributor

@tymmej tymmej commented Mar 4, 2023

  1. Download all albums recursively if new config option Is set
  2. Add album name to filename.
    I'm using photoview to provide online gallery. It uses only filename to identify photos. So if one photo is in multiple albums there's problem. Adding album name to filename solves it.

There's no 100% coverage in unit tests - it requires mocking data for all Smart Albums, I do not know how to do it.

@mandarons
Copy link
Owner

Wouldn't fixing just #128 solve your problem? Every album (on disk, in its folder) will have unique file name. Per https://github.com/photoview/photoview#main-features, it looks like directories (folders) are mapped to albums in the app. No need to rename the file names with prepended album names.

@tymmej
Copy link
Contributor Author

tymmej commented Mar 6, 2023

No, it doesn't work. I had to add album name to make it work.

For example, I have two albums:

  • Vacation 2022
  • Printed photos

I have same photo in both albums. In current version it will be downloaded to different folders, but same filenames.
In photoview photo will be visible only in one folder. Which one? First scanned.

Adding to database happens here. Removing check origURL == nil "fixes" problem, but creates new - every scan adds all photos to database again.

Alternatively I was thinking to add config option to provide custom filename.

@mandarons
Copy link
Owner

Adding a new config option e.g. globally_unique_filenames = True/False is a good approach. Your case is specific. The solution you proposed is not generic enough to apply for the default use case.

Regarding

In current version it will be downloaded to different folders, but same filenames. In photoview photo will be visible only in one folder. Which one? First scanned.

This seems like a bug in photoview app.

Lastly, please split this PR into two:

  1. Download all albums
  2. Globally unique filenames

Copy link

@jiaoting jiaoting left a comment

Choose a reason for hiding this comment

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

yeah

@tymmej tymmej closed this Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants