Browse Source

Update last_edit when tagging with recent

pull/3629/merge
Ruud 11 years ago
parent
commit
687221f035
  1. 7
      couchpotato/core/media/_base/media/main.py
  2. 2
      couchpotato/core/media/movie/searcher.py
  3. 2
      couchpotato/core/plugins/renamer.py

7
couchpotato/core/media/_base/media/main.py

@ -488,18 +488,21 @@ class MediaPlugin(MediaBase):
db.update(m) db.update(m)
# Tag media as recent # Tag media as recent
self.tag(media_id, 'recent') self.tag(media_id, 'recent', update_edited = True)
return m['status'] return m['status']
except: except:
log.error('Failed restatus: %s', traceback.format_exc()) log.error('Failed restatus: %s', traceback.format_exc())
def tag(self, media_id, tag): def tag(self, media_id, tag, update_edited = False):
try: try:
db = get_db() db = get_db()
m = db.get('id', media_id) m = db.get('id', media_id)
if update_edited:
m['last_edit'] = int(time.time())
tags = m.get('tags') or [] tags = m.get('tags') or []
if tag not in tags: if tag not in tags:
tags.append(tag) tags.append(tag)

2
couchpotato/core/media/movie/searcher.py

@ -240,7 +240,7 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
break break
if total_result_count > 0: 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: if len(too_early_to_search) > 0:
log.info2('Too early to search for %s, %s', (too_early_to_search, default_title)) log.info2('Too early to search for %s, %s', (too_early_to_search, default_title))

2
couchpotato/core/plugins/renamer.py

@ -522,7 +522,7 @@ class Renamer(Plugin):
# Mark media for dashboard # Mark media for dashboard
if mark_as_recent: 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 # Remove leftover files
if not remove_leftovers: # Don't remove anything if not remove_leftovers: # Don't remove anything

Loading…
Cancel
Save