Browse Source

Fix issue when deleting files and "Send to trash for actions" is enabled.

pull/1108/head
JackDandy 7 years ago
parent
commit
c5b5a7af0c
  1. 1
      CHANGES.md
  2. 1
      sickbeard/helpers.py
  3. 1
      sickbeard/image_cache.py
  4. 13
      sickbeard/postProcessor.py
  5. 14
      sickbeard/processTV.py
  6. 5
      sickbeard/tv.py
  7. 1
      sickbeard/webserve.py

1
CHANGES.md

@ -21,6 +21,7 @@
[develop changelog]
* Fix issue when deleting files and "Send to trash for actions" is enabled

1
sickbeard/helpers.py

@ -42,6 +42,7 @@ import adba
import requests
import requests.exceptions
from cfscrape import CloudflareScraper
from lib.send2trash import send2trash
import sickbeard
import subliminal

1
sickbeard/image_cache.py

@ -33,7 +33,6 @@ from sickbeard.metadata.generic import GenericMetadata
from lib.hachoir.parser import createParser
from lib.hachoir.metadata import extractMetadata
from lib.send2trash import send2trash
try:
import zlib
except:

13
sickbeard/postProcessor.py

@ -43,11 +43,6 @@ from sickbeard.name_parser.parser import NameParser, InvalidNameException, Inval
from lib import adba
try:
from lib.send2trash import send2trash
except ImportError:
pass
class PostProcessor(object):
"""
@ -235,13 +230,7 @@ class PostProcessor(object):
except:
self._log(u'Cannot change permissions to writeable to delete file: %s' % cur_file, logger.WARNING)
try:
if self.use_trash:
ek.ek(send2trash, cur_file)
else:
ek.ek(os.remove, cur_file)
except OSError as e:
self._log(u'Unable to delete file %s: %s' % (cur_file, str(e.strerror)), logger.DEBUG)
helpers.remove_file(cur_file, log_level=logger.DEBUG)
if True is not ek.ek(os.path.isfile, cur_file):
self._log(u'Deleted file ' + cur_file, logger.DEBUG)

14
sickbeard/processTV.py

@ -48,11 +48,6 @@ try:
except ImportError:
from lib import simplejson as json
try:
from lib.send2trash import send2trash
except ImportError:
pass
# noinspection PyArgumentList
class ProcessTVShow(object):
@ -150,13 +145,8 @@ class ProcessTVShow(object):
ek.ek(os.chmod, cur_file_path, stat.S_IWRITE)
except OSError as e:
self._log_helper(u'Cannot change permissions of %s: %s' % (cur_file_path, str(e.strerror)))
try:
if use_trash:
ek.ek(send2trash, cur_file_path)
else:
ek.ek(os.remove, cur_file_path)
except OSError as e:
self._log_helper(u'Unable to delete file %s: %s' % (cur_file, str(e.strerror)))
helpers.remove_file(cur_file_path)
if ek.ek(os.path.isfile, cur_file_path):
result = False

5
sickbeard/tv.py

@ -38,11 +38,6 @@ import fnmatch
from imdb._exceptions import IMDbError
try:
from lib.send2trash import send2trash
except ImportError:
pass
from lib.imdb import imdb
from sickbeard import db

1
sickbeard/webserve.py

@ -77,7 +77,6 @@ from trakt_helpers import build_config, trakt_collection_remove_account
from sickbeard.bs4_parser import BS4Parser
from lib.fuzzywuzzy import fuzz
from lib.send2trash import send2trash
from lib.tmdb_api import TMDB
from lib.tvdb_api.tvdb_exceptions import tvdb_exception

Loading…
Cancel
Save