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

Star ratings from iPhoto should go to the XMP:Rating field #1353

Closed
mlevin77 opened this issue Dec 27, 2023 · 4 comments
Closed

Star ratings from iPhoto should go to the XMP:Rating field #1353

mlevin77 opened this issue Dec 27, 2023 · 4 comments

Comments

@mlevin77
Copy link

From our email discussion:

given that there's a field called XMP:Rating, won't it work to convert the star ratings from iPhoto to the XMP:Rating field?

Yes that would work. The iPhoto code provides a rating property:

@property
def rating(self) -> int:
    """Rating of photo as int from 0 to 5"""
    return self._db._db_photos[self._uuid]["rating"]

Please open an issue on GitHub to add this. Will be a 2 line fix but need to add a test case, etc.

@RhetTbull
Copy link
Owner

  • Will need to figure out how to handle rating for Photos. Current implementation of PhotoInfo.rating returns 5 if favorite else 0. But this would make --favorite-rating actually do nothing as rating would always get written if favorite. Could change implementation of rating to return None for Photos or just get rid of --favorite-rating
   @property
    def rating(self) -> int:
        """Star rating of photo as int from 0 to 5; for iPhoto, returns star rating; for Photos, returns 5 if favorite, else 0"""
        return 5 if self.favorite else 0

@RhetTbull
Copy link
Owner

@all-contributors please add @mlevin77 for ideas

Copy link
Contributor

@RhetTbull

I've put up a pull request to add @mlevin77! 🎉

RhetTbull added a commit that referenced this issue Dec 29, 2023
* Implemented fix for XMP:Rating on iPhoto #1353

* Fixed test data
@RhetTbull
Copy link
Owner

Fixed in current branch. Will be in next release.

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

No branches or pull requests

2 participants