Updated xmp_rating example

This commit is contained in:
Rhet Turnbull 2022-08-15 10:13:25 -07:00
parent 1e053aa708
commit 46738d05b2

View File

@ -7,6 +7,7 @@ from typing import Callable
from osxphotos import ExportResults, PhotoInfo
from osxphotos.exiftool import ExifTool
from osxphotos.utils import normalize_unicode
# Update this for your custom keyword to rating mapping
RATINGS = {
@ -17,6 +18,9 @@ RATINGS = {
"★★★★★︎": 5,
}
# normalize the unicode to match what osxphotos uses internally
RATINGS = {normalize_unicode(k): v for k, v in RATINGS.items()}
def rating(photo: PhotoInfo, results: ExportResults, verbose: Callable, **kwargs):
"""Call this with `osxphotos export /path/to/export --post-function xmp_rating.py::rating`