|
|
@ -85,6 +85,7 @@ class Renamer(Plugin): |
|
|
|
movie_title = getTitle(group['library']) |
|
|
|
|
|
|
|
# Add _UNKNOWN_ if no library item is connected |
|
|
|
unknown = False |
|
|
|
if not group['library'] or not movie_title: |
|
|
|
if 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) |
|
|
|
rename_files[rename_me] = rename_me.replace(filename, '_UNKNOWN_%s' % filename) |
|
|
|
|
|
|
|
unknown = True |
|
|
|
# Rename the files using the library data |
|
|
|
else: |
|
|
|
group['library'] = fireEvent('library.update', identifier = group['library']['identifier'], single = True) |
|
|
@ -368,6 +370,7 @@ class Renamer(Plugin): |
|
|
|
except: |
|
|
|
log.error('Failed removing %s: %s' % (group['parentdir'], traceback.format_exc())) |
|
|
|
|
|
|
|
if not unknown: |
|
|
|
# Search for trailers etc |
|
|
|
fireEventAsync('renamer.after', group) |
|
|
|
|
|
|
|