mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Merge pull request #693 from JackDandy/feature/FixOrphanImages
Fix find associated meta files to prevent orphan episode images.
This commit is contained in:
commit
e31f6cdac6
2 changed files with 17 additions and 15 deletions
|
@ -63,6 +63,7 @@
|
|||
* Change add 'nocache' kwarg to helpers.getURL to facilitate non-cached requests
|
||||
* Change instantly use saved value from Search Settings/Episode Search/"Check propers every" instead of after a restart
|
||||
* Change include OSError system messages in file system failure logs during post process
|
||||
* Fix find associated meta files to prevent orphan episode images
|
||||
|
||||
|
||||
### 0.11.11 (2016-04-05 19:20:00 UTC)
|
||||
|
|
|
@ -170,19 +170,20 @@ class PostProcessor(object):
|
|||
|
||||
file_path_list = []
|
||||
|
||||
base_name = file_path.rpartition('.')[0]
|
||||
tmp_base = base_name = file_path.rpartition('.')[0]
|
||||
|
||||
if not base_name_only:
|
||||
base_name += '.'
|
||||
tmp_base += '.'
|
||||
|
||||
# don't strip it all and use cwd by accident
|
||||
if not base_name:
|
||||
if not tmp_base:
|
||||
return []
|
||||
|
||||
# don't confuse glob with chars we didn't mean to use
|
||||
base_name = re.sub(r'[\[\]\*\?]', r'[\g<0>]', base_name)
|
||||
|
||||
for associated_file_path in ek.ek(glob.glob, base_name + '*'):
|
||||
for meta_ext in ['', '-thumb', '.ext', '.ext.cover', '.metathumb']:
|
||||
for associated_file_path in ek.ek(glob.glob, '%s%s.*' % (base_name, meta_ext)):
|
||||
# only add associated to list
|
||||
if associated_file_path == file_path:
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue