Browse Source

Change media process move process method for *nix systems that don't support native move.

A copy/unlink method is used on systems that fail a native Python move; source file is no longer removed if the destination file fails.
Fix do not display empty show name results returned from TVDb.
tags/release_0.24.15^2
JackDandy 4 years ago
parent
commit
e7c543aa42
  1. 8
      CHANGES.md
  2. 8
      lib/sg_helpers.py
  3. 14
      lib/tvdb_api/tvdb_api.py
  4. 2
      sickbeard/postProcessor.py

8
CHANGES.md

@ -1,4 +1,10 @@
### 0.24.14 (2021-07-31 08:50:00 UTC)
### 0.24.15 (2021-08-05 11:45:00 UTC)
* Change media process move process method for *nix systems that don't support native move
* Fix do not display empty show name results returned from TVDb
### 0.24.14 (2021-07-31 08:50:00 UTC)
* Change add compatibility for Transmission 3.00 client with label support
* Change ensure cookies are split only into 2 parts at the lhs of multiple occurrences of '='

8
lib/sg_helpers.py

@ -1171,13 +1171,17 @@ def copy_file(src_file, dest_file):
pass
def move_file(src_file, dest_file):
def move_file(src_file, dest_file, raise_exceptions=False):
try:
ek.ek(shutil.move, src_file, dest_file)
fix_set_group_id(dest_file)
except OSError:
copy_file(src_file, dest_file)
ek.ek(os.unlink, src_file)
if ek.ek(os.path.exists, dest_file):
fix_set_group_id(dest_file)
ek.ek(os.unlink, src_file)
elif raise_exceptions:
raise OSError('Destination file could not be created: %s' % dest_file)
def remove_file_perm(filepath, log_err=True):

14
lib/tvdb_api/tvdb_api.py

@ -456,13 +456,13 @@ class Tvdb(TVInfoBase):
v = ''
else:
v = clean_data(v)
else:
if 'seriesname' == k:
if isinstance(data.get('aliases'), list) and 0 < len(data.get('aliases')):
v = data['aliases'].pop(0)
# this is a invalid show, it has no Name
if None is v:
return None
if not v and 'seriesname' == k:
if isinstance(data.get('aliases'), list) and 0 < len(data.get('aliases')):
v = data['aliases'].pop(0)
# this is a invalid show, it has no Name
if not v:
return None
if k in map_show:
k = map_show[k]

2
sickbeard/postProcessor.py

@ -353,7 +353,7 @@ class PostProcessor(object):
def _int_move(cur_file_path, new_file_path, success_tmpl=u' %s to %s'):
try:
helpers.move_file(cur_file_path, new_file_path)
helpers.move_file(cur_file_path, new_file_path, raise_exceptions=True)
helpers.chmod_as_parent(new_file_path)
self._log(u'Moved file from' + (success_tmpl % (cur_file_path, new_file_path)), logger.DEBUG)
except (IOError, OSError) as e:

Loading…
Cancel
Save