Browse Source

Add group to untag release

pull/2711/head
Ruud 11 years ago
parent
commit
8a11f246b1
  1. 31
      couchpotato/core/plugins/renamer/main.py

31
couchpotato/core/plugins/renamer/main.py

@ -651,24 +651,33 @@ Remove it if you want it to be renamed (again, or at least let it try again)
if not os.path.isfile(tag_filename): if not os.path.isfile(tag_filename):
self.createFile(tag_filename, text) self.createFile(tag_filename, text)
def untagRelease(self, release_download, tag = ''): def untagRelease(self, group = None, release_download = None, tag = ''):
if not release_download: if not release_download:
return return
tag_files = [] tag_files = []
folder = release_download['folder'] # Tag movie files if they are known
if not os.path.isdir(folder): if isinstance(group, dict):
return False tag_files = [sorted(list(group['files']['movie']))[0]]
# Untag download_files if they are known folder = group['parentdir']
if release_download['files']: if not group.get('dirname') or not os.path.isdir(folder):
tag_files = splitString(release_download['files'], '|') return False
# Untag all files in release folder elif isinstance(release_download, dict):
else: # Untag download_files if they are known
for root, folders, names in os.walk(release_download['folder']): if release_download['files']:
tag_files.extend([sp(os.path.join(root, name)) for name in names if not os.path.splitext(name)[1] == '.ignore']) tag_files = splitString(release_download['files'], '|')
# Untag all files in release folder
else:
for root, folders, names in os.walk(release_download['folder']):
tag_files.extend([sp(os.path.join(root, name)) for name in names if not os.path.splitext(name)[1] == '.ignore'])
folder = release_download['folder']
if not os.path.isdir(folder):
return False
# Find all .ignore files in folder # Find all .ignore files in folder
ignore_files = [] ignore_files = []

Loading…
Cancel
Save