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

/photos/scan creates duplicates #38

Open
nullmedium opened this issue Mar 13, 2013 · 2 comments
Open

/photos/scan creates duplicates #38

nullmedium opened this issue Mar 13, 2013 · 2 comments
Labels

Comments

@nullmedium
Copy link

I moved some images on my server from one old gallery to the uploads folder into a new album. When I called /photos/scan to import the new photos, the scan algorithm created
new records for the previous images within the "photos" table.

@espen
Copy link
Owner

espen commented Mar 14, 2013

The script was supposed to ignore existing photos. It uses 'Photo.find_or_initialize_by_path(path)'. I guess this should be changed as path is not really used for photos. Maybe using 'Photo.find_or_initialize_by_file(path)' would work. I assume the existing photos had a null value for path? Can you post some examples of duplicate photos? Or at least the value of 'file'.

@nullmedium
Copy link
Author

When I had a look at my database the "file" column contained the absolute path to the images. The records for the photos I had uploaded earlier, had just the filename. I think, modifying the script to check for the file's basename would work.

If I get to it, I will try a development database to mess with.

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

No branches or pull requests

2 participants