Closed tymmej closed 11 months ago
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.
No, it doesn't work. I had to add album name to make it work.
For example, I have two albums:
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.
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 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.