gh-119 Use XMP-xmpDM:Album instead of user defined tag with fallback support

This commit is contained in:
Jaisen Mathai 2016-06-24 00:34:51 -04:00
parent cb38bf5176
commit cbfd39a20e
2 changed files with 8 additions and 9 deletions

View File

@ -98,7 +98,7 @@ Here's an example of a very asynchronous setup.
* Periodically recategorize photos by fixing their location or date or by adding them to an album.
* Have a Synology at home set to automatically sync down from Dropbox/Google Drive.
This setup means you can quickly get photos off your or anyone's phone and know that they'll be organized and backed up in 3 locations by the time they're ready to view them.
This setup means you can quickly get photos off your or anyone's phone and know that they'll be organized and backed up in 3 locations by the time you're ready to view them.
<p align="center"><img src ="creative/workflow-simplified-white-bg.png" /></p>
@ -189,7 +189,7 @@ Organizing your existing photos is great. But I'd be lying if I said I was the o
In order to sort new photos that I haven't already organized I need someone to tell me about them. There's no single way to do this. You could use inotify, cron, Automator or my favorite app - Hazel; it doesn't matter.
If you'd like to let me know of a specific photo or group of photos to add to your library you would run one of the following command. Use fully qualified paths for everything since you won't be running this manually.
If you'd like to let me know of a specific photo or group of photos to add to your library you would run one of the following commands. Use fully qualified paths for everything since you won't be running this manually.
```
# I can import a single file into your library.

View File

@ -39,7 +39,7 @@ class Media(Base):
'EXIF:DateTimeDigitized'
]
}
self.album_key = 'XMP:Album'
self.album_keys = ['XMP-xmpDM:Album', 'XMP:Album']
self.title_key = 'XMP:Title'
self.latitude_keys = ['EXIF:GPSLatitude']
self.longitude_keys = ['EXIF:GPSLongitude']
@ -64,10 +64,11 @@ class Media(Base):
if exiftool_attributes is None:
return None
if self.album_key not in exiftool_attributes:
return None
for album_key in self.album_keys:
if album_key in exiftool_attributes:
return exiftool_attributes[album_key]
return exiftool_attributes[self.album_key]
return None
def get_coordinate(self, type='latitude'):
"""Get latitude or longitude of media from EXIF
@ -153,9 +154,7 @@ class Media(Base):
if(not self.is_valid()):
return None
source = self.source
tags = {self.album_key: album}
tags = {self.album_keys[0]: album}
status = self.__set_tags(tags)
self.reset_cache()