|
@ -85,6 +85,7 @@ class Renamer(Plugin): |
|
|
movie_title = getTitle(group['library']) |
|
|
movie_title = getTitle(group['library']) |
|
|
|
|
|
|
|
|
# Add _UNKNOWN_ if no library item is connected |
|
|
# Add _UNKNOWN_ if no library item is connected |
|
|
|
|
|
unknown = False |
|
|
if not group['library'] or not movie_title: |
|
|
if not group['library'] or not movie_title: |
|
|
if group['dirname']: |
|
|
if group['dirname']: |
|
|
rename_files[group['parentdir']] = group['parentdir'].replace(group['dirname'], '_UNKNOWN_%s' % group['dirname']) |
|
|
rename_files[group['parentdir']] = group['parentdir'].replace(group['dirname'], '_UNKNOWN_%s' % group['dirname']) |
|
@ -94,6 +95,7 @@ class Renamer(Plugin): |
|
|
filename = os.path.basename(rename_me) |
|
|
filename = os.path.basename(rename_me) |
|
|
rename_files[rename_me] = rename_me.replace(filename, '_UNKNOWN_%s' % filename) |
|
|
rename_files[rename_me] = rename_me.replace(filename, '_UNKNOWN_%s' % filename) |
|
|
|
|
|
|
|
|
|
|
|
unknown = True |
|
|
# Rename the files using the library data |
|
|
# Rename the files using the library data |
|
|
else: |
|
|
else: |
|
|
group['library'] = fireEvent('library.update', identifier = group['library']['identifier'], single = True) |
|
|
group['library'] = fireEvent('library.update', identifier = group['library']['identifier'], single = True) |
|
@ -368,12 +370,13 @@ class Renamer(Plugin): |
|
|
except: |
|
|
except: |
|
|
log.error('Failed removing %s: %s' % (group['parentdir'], traceback.format_exc())) |
|
|
log.error('Failed removing %s: %s' % (group['parentdir'], traceback.format_exc())) |
|
|
|
|
|
|
|
|
# Search for trailers etc |
|
|
if not unknown: |
|
|
fireEventAsync('renamer.after', group) |
|
|
# Search for trailers etc |
|
|
|
|
|
fireEventAsync('renamer.after', group) |
|
|
|
|
|
|
|
|
# Notify on download |
|
|
# Notify on download |
|
|
download_message = 'Downloaded %s (%s)' % (movie_title, replacements['quality']) |
|
|
download_message = 'Downloaded %s (%s)' % (movie_title, replacements['quality']) |
|
|
fireEventAsync('movie.downloaded', message = download_message, data = group) |
|
|
fireEventAsync('movie.downloaded', message = download_message, data = group) |
|
|
|
|
|
|
|
|
# Break if CP wants to shut down |
|
|
# Break if CP wants to shut down |
|
|
if self.shuttingDown(): |
|
|
if self.shuttingDown(): |
|
|