Update last_edit when tagging with recent

This commit is contained in:
Ruud
2014-07-12 19:38:49 +02:00
parent 06f49be090
commit 687221f035
3 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -488,18 +488,21 @@ class MediaPlugin(MediaBase):
db.update(m)
# Tag media as recent
self.tag(media_id, 'recent')
self.tag(media_id, 'recent', update_edited = True)
return m['status']
except:
log.error('Failed restatus: %s', traceback.format_exc())
def tag(self, media_id, tag):
def tag(self, media_id, tag, update_edited = False):
try:
db = get_db()
m = db.get('id', media_id)
if update_edited:
m['last_edit'] = int(time.time())
tags = m.get('tags') or []
if tag not in tags:
tags.append(tag)
+1 -1
View File
@@ -240,7 +240,7 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
break
if total_result_count > 0:
fireEvent('media.tag', movie['_id'], 'recent', single = True)
fireEvent('media.tag', movie['_id'], 'recent', update_edited = True, single = True)
if len(too_early_to_search) > 0:
log.info2('Too early to search for %s, %s', (too_early_to_search, default_title))
+1 -1
View File
@@ -522,7 +522,7 @@ class Renamer(Plugin):
# Mark media for dashboard
if mark_as_recent:
fireEvent('media.tag', group['media'].get('_id'), 'recent', single = True)
fireEvent('media.tag', group['media'].get('_id'), 'recent', update_edited = True, single = True)
# Remove leftover files
if not remove_leftovers: # Don't remove anything