Merge branch 'refs/heads/develop'
This commit is contained in:
commit
f80559d380
6 files changed
+26
-10
No files matched your search
@@ -77,7 +77,8 @@ class Core(Plugin):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def cleanUpFolders(self):
|
def cleanUpFolders(self):
|
||||||
self.deleteEmptyFolder(Env.get('app_dir'), show_error = False)
|
only_clean = ['couchpotato', 'libs', 'init']
|
||||||
|
self.deleteEmptyFolder(Env.get('app_dir'), show_error = False, only_clean = only_clean)
|
||||||
|
|
||||||
def available(self, **kwargs):
|
def available(self, **kwargs):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ class MediaPlugin(MediaBase):
|
|||||||
db.delete(release)
|
db.delete(release)
|
||||||
total_deleted += 1
|
total_deleted += 1
|
||||||
|
|
||||||
if (total_releases == total_deleted and media['status'] != 'active') or (delete_from == 'wanted' and media['status'] == 'active'):
|
if (total_releases == total_deleted and media['status'] != 'active') or (delete_from == 'wanted' and media['status'] == 'active') or (not new_media_status and delete_from == 'late'):
|
||||||
db.delete(media)
|
db.delete(media)
|
||||||
deleted = True
|
deleted = True
|
||||||
elif new_media_status:
|
elif new_media_status:
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ class Base(TorrentProvider):
|
|||||||
http_time_between_calls = 1 # Seconds
|
http_time_between_calls = 1 # Seconds
|
||||||
cat_backup_id = None
|
cat_backup_id = None
|
||||||
|
|
||||||
def _search(self, media, quality, results):
|
def _searchOnTitle(self, title, media, quality, results):
|
||||||
|
|
||||||
url = self.urls['search'] % self.buildUrl(media, quality)
|
url = self.urls['search'] % self.buildUrl(title, media, quality)
|
||||||
|
|
||||||
data = self.getHTMLData(url)
|
data = self.getHTMLData(url)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from couchpotato import fireEvent
|
|
||||||
from couchpotato.core.helpers.encoding import tryUrlencode
|
from couchpotato.core.helpers.encoding import tryUrlencode
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
from couchpotato.core.media._base.providers.torrent.torrentleech import Base
|
from couchpotato.core.media._base.providers.torrent.torrentleech import Base
|
||||||
@@ -21,8 +20,8 @@ class TorrentLeech(MovieProvider, Base):
|
|||||||
([12], ['dvdr']),
|
([12], ['dvdr']),
|
||||||
]
|
]
|
||||||
|
|
||||||
def buildUrl(self, media, quality):
|
def buildUrl(self, title, media, quality):
|
||||||
return (
|
return (
|
||||||
tryUrlencode(fireEvent('library.query', media, single = True)),
|
tryUrlencode(title.replace(':', '')),
|
||||||
self.getCatId(quality)[0]
|
self.getCatId(quality)[0]
|
||||||
)
|
)
|
||||||
@@ -5,8 +5,6 @@ from couchpotato.core.logger import CPLog
|
|||||||
from couchpotato.core.notifications.base import Notification
|
from couchpotato.core.notifications.base import Notification
|
||||||
import xmpp
|
import xmpp
|
||||||
|
|
||||||
print xmpp
|
|
||||||
|
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -140,13 +140,31 @@ class Plugin(object):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def deleteEmptyFolder(self, folder, show_error = True):
|
def deleteEmptyFolder(self, folder, show_error = True, only_clean = None):
|
||||||
folder = sp(folder)
|
folder = sp(folder)
|
||||||
|
|
||||||
|
allowed_dirs = []
|
||||||
|
if only_clean:
|
||||||
|
for item in os.listdir(folder):
|
||||||
|
full_path = os.path.join(folder, item)
|
||||||
|
if item in only_clean and os.path.isdir(full_path):
|
||||||
|
allowed_dirs.append(full_path)
|
||||||
|
|
||||||
for root, dirs, files in os.walk(folder):
|
for root, dirs, files in os.walk(folder):
|
||||||
|
|
||||||
for dir_name in dirs:
|
for dir_name in dirs:
|
||||||
full_path = os.path.join(root, dir_name)
|
full_path = os.path.join(root, dir_name)
|
||||||
|
|
||||||
|
if only_clean:
|
||||||
|
allow = False
|
||||||
|
for allowed_dir in allowed_dirs:
|
||||||
|
if allowed_dir in full_path:
|
||||||
|
allow = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not allow:
|
||||||
|
continue
|
||||||
|
|
||||||
if len(os.listdir(full_path)) == 0:
|
if len(os.listdir(full_path)) == 0:
|
||||||
try:
|
try:
|
||||||
os.rmdir(full_path)
|
os.rmdir(full_path)
|
||||||
|
|||||||
Reference in new issue
Block a user