Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

changing imagedir without reloading fotos to flickr #13

Open
MrBovert opened this issue Feb 3, 2014 · 4 comments
Open

changing imagedir without reloading fotos to flickr #13

MrBovert opened this issue Feb 3, 2014 · 4 comments

Comments

@MrBovert
Copy link

MrBovert commented Feb 3, 2014

Due to the large collection of fotos I have I played with different settings of "imagedir" in uploadr.ini:

  1. I set
    imagedir = d:\CamPics\aaa
    --> all fotos of aaa and subdirectories of aaa were loaded
  2. I changes to a sub directory
    imagedir = d:\CamPics\aaa\bbb
    --> all fotos of aaa\bbb were loaded again and appear twice in flickr

It seems as if the identifier in the history files contains not the full path of the image but a relative path. So the check against double loading fails when you change the starting point in the directory.
I did 2 changes in uploafr.py to use the full path and to avoid the double uplaod to fickr when changing imagedir:

Line 319:
old: if self.uploaded.has_key(folderTag):
new: if self.uploaded.has_key(image):

Line 388:
old: self.logUpload( res.photoid, folderTag )
new: self.logUpload( res.photoid, image )

Being new with python I am not sure if there are any side effects and ask myself if that patch is a good idea.

@richq
Copy link
Owner

richq commented Feb 4, 2014

Weeeellll, that's fine, but the problem I see is that it would mess up people who have already uploaded stuff and have a big history file with relative paths. I think I agree that absolute paths are probably a better solution. It's easier to retag things alread uploaded that spend your life re-uploading everything.

The whole history file thing is a pain TBH. I wish it were more transparent - right now it is a big binary blob that you can fiddle with if you use python's shelve, but it isn't very user friendly.

I am loathed to add a flag like "relative path" to the ini file, but that would be one solution. i.e. by default it is assumed to be a relative path, but if you like it can be an abs path. Although that wouldn't even help out in your case. Gah, it's tricky!!

@MrBovert
Copy link
Author

MrBovert commented Feb 4, 2014

A flag in the ini file would be a good solution I think. I am happy not having loaded up all my pics til now. Never trust a software you have not tested before ;-)

@richq
Copy link
Owner

richq commented Feb 5, 2014

The other flag problem is that I have uploaded photos already with this relative path, so I wouldn't really be able to well-test the absolute path solution. So it'd be likely to break.

I trust this for myself, as I've tested it for my use cases, but... you're right: software not tested is the same as software that's broken :)

@MrBovert
Copy link
Author

MrBovert commented Feb 5, 2014

Because I got bad tags when using absolute path I looked at the code again.
There is an easyer way to introduce the absolute path and to get correct tags:

  1. Do not change line 319 and 388 as described above.
  2. Instead only change line 317:

old: folderTag = image[len(IMAGE_DIR):]
new: folderTag = image

That's all but read the comments from Richard above because your directory will be lost.

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

No branches or pull requests

2 participants