Please enable 'Use embedded tags' in Photo libraries

That would work great…thanks. Also is there a way to donate for your great work ?

Hi,
have put some error checking in the latest version. Please check it.
At the moment there is no way to donate. As I do it in my free time and I needed this functionality myself it is just fine.

BTW, I will create a new version of the script and a prebuilt docker image. This way is the easiest to get it running in background even in windows.

I am getting a lot of these ‘‘OverflowError at position: 4036160491, length: 2684119519’’’
are they critical ?

An overflow error should not happen but can have serveral reasons. I need more information. how many photos you have in the library? Is this the only message you get?

I have 72,406 photos :slight_smile: (wife is photo happy). It has been running all day and so far i have the following errors. However it is updating ok, as far as i can tell.
No EXIF information found

No EXIF information found

Possibly corrupted field Tag 0x001A in MakerNote IFD
No EXIF information found

No EXIF information found

No EXIF information found

OverflowError at position: 3098888203, length: 4252505431
OverflowError at position: 2967516384, length: 4261439442
No EXIF information found

No EXIF information found

OverflowError at position: 818, length: 3154142976
OverflowError at position: 818, length: 3154142976
Possibly corrupted field Copyright in Image IFD
Possibly corrupted field Copyright in Image IFD
Possibly corrupted field Copyright in Image IFD
OverflowError at position: 3128587450, length: 2233794304
OverflowError at position: 4294905868, length: 4278648832
OverflowError at position: 3819736430, length: 2454666932
OverflowError at position: 1412460207, length: 2948905189
OverflowError at position: 2792574195, length: 3653878215
MemoryError at position: 2323889054, length: 1882283827
OverflowError at position: 3308728859, length: 2443066097
MemoryError at position: 2821014470, length: 2111853814
MemoryError at position: 4097657463, length: 2147145160
OverflowError at position: 2438482505, length: 2623736919
OverflowError at position: 3767805823, length: 2882138740
OverflowError at position: 3355708531, length: 3063975288
OverflowError at position: 5058, length: 2953248800

Hi @andreasrehbein, I noticed you have 2 tags labelled “Try” in the revised ppTag.py script. Not sure if it matters, but thought I’d mention it. (There’s a third instance in the observer sleep section of the code)
image

Also, I have been able to get the script running in Windows10 background mode by running pythonw.exe and adding it to my task scheduler using following params:
General: [Run whether user is logged on or not]
General: Hidden=[True]
Triggers: [At system startup]
Triggers: [Delay 15min]
Actions: Start a program=[True]
Actions: Program: [path to python program] \pythonw.exe
Actions: Arguments: [pptag.py]
Actions: Start in: [path to ppTag.py] \ppTag.py
Settings: Allow task to run on demand=[True]
Settings: If task does not end when requested, force it to stop=[True]

Does anyone know whether it is possible to view error messages printed to the terminal console while the script is running in background mode? (I fear the script could be logging lots of error messages but not knowing about it)

Shout out to super hero @Andreasrehbein on making it possible to elegantly update Lightroom tags in PLEX!!!

Feature request - would it be possible to set a flag in the initialization portion of the script so that upon computer reboot the script goes straight into observer mode? (It takes a few hours to process 28K+ photos and am thinking its not necessary to reprocess all the files that have previously been tagged every time the server is rebooted?). e.g. if Flag=TRUE always processes all picture tags, if Flag=FALSE go straight to observer mode

Hi @EEDacho, @George-Bakopoulos and all

I have created a new version and released it as v1.0.0. In addition to the source code there is a Docker Image in the Docker Hub: ppTag which gets automatically created once I realese a new version.

The repository now contains a modified version of exifread which allows to parse the xmp data without the debug setting turned on. This should remove all the (debug) output.

The config is now seperated in the file config.py. Make sure to put your settings there!
There is a new setting: FORCE_RUN_AT_START. This can be set to True or False to turn on the initial processing at the start of the script.

Works great…thanks. Also is it possible to run the script over one directory(folder) only ?

What do you mean with one folder?
The script fetches all photos from plex.

The only option is to set a path (restriction) and verify that the processing only takes place if the path is correct. But once such an option is implemented there would be a need to allow several paths. I will think about it… all this is only possible for sub folders within the main path.

Because I have so many photos, it takes over 24 hours to update. I only add new photos to a staging directory, so it would be great if I could point the script to only look in that directory, otherwise the script will run for over 24 hours, every time I add a few new photos…thanks in advance.

@George-Bakopoulos, I don’t think you need to do the staging folder approach now that @andreasrehbein has provided the option to set the FORCE_RUN_AT_START flag?

Set the flag False to only process changes/updates to the photo library. (previously processed photos will not be rescanned).

That is what i thought as well, until i ran few tests and it actually goes through the whole library when a change is triggered and in my case with over 70,000 photos it runs for over a day.

Hi @George-Bakopoulos and @EEDacho

the script triggers a run when a modified or new file was detected. It fetches all data from plex as the key of each photo is not known. Then the path of each photo from plex is compared to the ones detected for changes. This process should be fast in a local network. The data from Plex is fetched in blocks of 100. In your case this means it creates 700 request to fetch data from your Plex server. All of the 70000 data needs to be processed at least for the path. What is missing in the script is break in the loop once all files that were detected for changes are processed. As the script uses the timeline feature from plex it always starts from the newest photos. This means when edit a file that is one of the oldest this won’t speed up the process.

I have an idea how to speed up the process a lot, but I need to implement another approach. I keep you updated.

I might be in the minority with so many files, so if an option to only target one directory is easier, i am happy with that. You have done enough already, i am over the moon with this script as is(unless you enjoy doing it :slight_smile: many thanks again.

1 Like

@andreasrehbein I’m not clear as to the purpose of the FORCE_RUN_AT_START flag. What processing is invoked when TRUE versus not invoked when FALSE? (Sorry if it is clear for everyone else :wink:).

I just tried the latest version of the program, setting the flag=False and it did not reprocess the 28K+ previously tagged photos. It did update the photo tags within a moment or two when I added 2 new folders. So as best I can tell it’s working as expected! I’m thrilled with the latest version! THANK YOU

Hi @EEDacho,

When the flag is set to true the script updates all metadata (tags and rating) for all photos which synchronizes all tags with plex. When set to false the update is not triggered. The process of fetching and comparing like described above is always done (because of the lack of the ID of the photo in the plex library)
Therefor, there is room for improvement.
Like I said I have already an idea how to improve the performance.

I have tried this and it works from tagthatphoto, i use it as well :wink:

Hi @EEDacho, @George-Bakopoulos,

there is a new version which includes a new mechanism for updating the plex data in the dynamic observer mode. It is date based. So the script fetches all metadata for the photos taken on a specific date (parsed from the exif data of the photo that were detected for changes). This is faster than the old method that is still used for the initial startup update if you set the flag to TRUE and as a fallback method.
In addition there is a bugfix which targets a problem when a mixed setup is used (Linux / Windows for Plex Server / ppTag or vice versa)

@andreasrehbein - I rescanned/retagged my entire photo library (28K photos in 1100 folders) and it took just under 2hr to complete. When photos are added or changed, subsequent rescans of all photo takes < 1 min. However my photo tags are not updating when the flag is set false and I add new photos to the library. Not sure what the problem is…I’ll spend more time tomorrow to see if I can figure out what might be the problem.

Update…everything seems to be working well now.

But I did experience some random issues over the last day or two where photos added to the library were not updating tags when FORCE_RUN_AT_START = False.

I’ve not been able to discern the circumstances when tags do not update, but it may have to do with my library scans taking too long before trying to update tags? I have tried variations of Settings / Scan My Library Automatically = ON / OFF and Scan My Library Periodically = ON / OFF as well as setting both flags OFF and triggering photo library scan update manually. It could also have been related to removing photo directories and adding them back too quickly during my testing activities. I’m not able to determine the exact scenario that results in the tags not being updated.

At the moment I have Settings / Scan My Library Automatically = ON / OFF and Scan My Library Periodically = OFF and everything seems to be working fine.

Also, having all the user’s settings in the config.py file makes it a lot easier to apply program updates!

Thanks again for everything you’ve done to make photo tag updates possible!!!