Fixed thumbnail reload on metadata change
This commit is contained in:
@@ -16,6 +16,9 @@ try:
|
||||
except ImportError:
|
||||
exiv2 = None
|
||||
HAVE_EXIV2 = False
|
||||
|
||||
_app_modified_callback = None
|
||||
|
||||
from utils import preserve_mtime
|
||||
from constants import RATING_XATTR_NAME, XATTR_NAME
|
||||
|
||||
@@ -23,6 +26,15 @@ MetadataResult = collections.namedtuple('MetadataResult', ['tags', 'rating'])
|
||||
EMPTY_METADATA = MetadataResult([], 0)
|
||||
|
||||
|
||||
def set_app_modified_callback(callback):
|
||||
global _app_modified_callback
|
||||
_app_modified_callback = callback
|
||||
|
||||
def mark_app_modified(path):
|
||||
"""Triggers the application-modified callback for a path."""
|
||||
if _app_modified_callback:
|
||||
_app_modified_callback(path)
|
||||
|
||||
def notify_baloo(path):
|
||||
"""
|
||||
Notifies the Baloo file indexer about a file change using DBus.
|
||||
@@ -148,6 +160,7 @@ class XattrManager:
|
||||
return
|
||||
try:
|
||||
with preserve_mtime(file_path):
|
||||
mark_app_modified(file_path)
|
||||
if value:
|
||||
os.setxattr(file_path, attr_name, str(value).encode('utf-8'))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user