Updated xmp_rating example
This commit is contained in:
@@ -7,6 +7,7 @@ from typing import Callable
|
|||||||
|
|
||||||
from osxphotos import ExportResults, PhotoInfo
|
from osxphotos import ExportResults, PhotoInfo
|
||||||
from osxphotos.exiftool import ExifTool
|
from osxphotos.exiftool import ExifTool
|
||||||
|
from osxphotos.utils import normalize_unicode
|
||||||
|
|
||||||
# Update this for your custom keyword to rating mapping
|
# Update this for your custom keyword to rating mapping
|
||||||
RATINGS = {
|
RATINGS = {
|
||||||
@@ -17,6 +18,9 @@ RATINGS = {
|
|||||||
"★★★★★︎": 5,
|
"★★★★★︎": 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):
|
def rating(photo: PhotoInfo, results: ExportResults, verbose: Callable, **kwargs):
|
||||||
"""Call this with `osxphotos export /path/to/export --post-function xmp_rating.py::rating`
|
"""Call this with `osxphotos export /path/to/export --post-function xmp_rating.py::rating`
|
||||||
|
|||||||
Reference in New Issue
Block a user