A bunch of changes
This commit is contained in:
@@ -16,6 +16,7 @@ except ImportError:
|
||||
exiv2 = None
|
||||
HAVE_EXIV2 = False
|
||||
from utils import preserve_mtime
|
||||
from constants import RATING_XATTR_NAME, XATTR_NAME
|
||||
|
||||
|
||||
def notify_baloo(path):
|
||||
@@ -40,6 +41,24 @@ def notify_baloo(path):
|
||||
QDBusConnection.sessionBus().call(msg, QDBus.NoBlock)
|
||||
|
||||
|
||||
def load_common_metadata(path):
|
||||
"""
|
||||
Loads tag and rating data for a path using extended attributes.
|
||||
"""
|
||||
tags = []
|
||||
raw_tags = XattrManager.get_attribute(path, XATTR_NAME)
|
||||
if raw_tags:
|
||||
tags = sorted(list(set(t.strip()
|
||||
for t in raw_tags.split(',') if t.strip())))
|
||||
|
||||
raw_rating = XattrManager.get_attribute(path, RATING_XATTR_NAME, "0")
|
||||
try:
|
||||
rating = int(raw_rating)
|
||||
except ValueError:
|
||||
rating = 0
|
||||
return tags, rating
|
||||
|
||||
|
||||
class MetadataManager:
|
||||
"""Manages reading EXIF, IPTC, and XMP metadata."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user