diff --git a/CHANGES.md b/CHANGES.md index a8b330a..3143533 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -90,6 +90,12 @@ * Change revert all IMDb ids to 7 chars +### 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 diff --git a/lib/sg_helpers.py b/lib/sg_helpers.py index 8627005..12aeacd 100644 --- a/lib/sg_helpers.py +++ b/lib/sg_helpers.py @@ -1196,13 +1196,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): diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py index da49528..3c73441 100644 --- a/lib/tvdb_api/tvdb_api.py +++ b/lib/tvdb_api/tvdb_api.py @@ -540,13 +540,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] diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 29033b3..51358c2 100644 --- a/sickbeard/postProcessor.py +++ b/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: