mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-02 17:33:37 +00:00
Merge branch 'feature/FixSendToTrash' into develop
This commit is contained in:
commit
6b37024da7
7 changed files with 5 additions and 31 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
|
||||
[develop changelog]
|
||||
* Fix issue when deleting files and "Send to trash for actions" is enabled
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ import adba
|
|||
import requests
|
||||
import requests.exceptions
|
||||
from cfscrape import CloudflareScraper
|
||||
from lib.send2trash import send2trash
|
||||
import sickbeard
|
||||
import subliminal
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue