core: fixes for include/exclude mode

This commit is contained in:
panni
2018-07-15 05:54:51 +02:00
parent 53e92ed3dc
commit 7c80ea515f
3 changed files with 6 additions and 10 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ class SubZeroAgent(object):
use_any_parts = False
for video in videos:
if not is_wanted(video["id"]):
Log.Debug(u"Ignoring %s" % video)
Log.Debug(u"Skipping %s" % video)
continue
use_any_parts = True
+2 -3
View File
@@ -476,7 +476,6 @@ class Config(object):
self.missing_permissions = []
use_include_exclude_fs = self.include_exclude_sz_files
cmp_val = self.include
all_permissions_ok = True
for section in self.sections:
if section.key not in self.enabled_sections:
@@ -493,10 +492,10 @@ class Config(object):
if use_include_exclude_fs:
# check whether we've got an ignore file inside the section path
if self.is_physically_wanted(path_str) == cmp_val:
if not self.is_physically_wanted(path_str):
continue
if self.is_path_wanted(path_str) == cmp_val:
if not self.is_path_wanted(path_str):
# is the path in our ignored paths setting?
continue
+3 -6
View File
@@ -302,13 +302,12 @@ def is_wanted(rating_key, item=None):
for media in item.media:
for part in media.parts:
if is_physically_wanted(part.file, kind):
return ret_val
return True
return not ret_val
def is_physically_wanted(fn, kind):
ret_val = config.include
if config.include_exclude_sz_files or config.include_exclude_paths:
# normally check current item folder and the library
check_paths = [".", "../"]
@@ -317,14 +316,12 @@ def is_physically_wanted(fn, kind):
check_paths.append("../../")
if config.include_exclude_paths and config.is_path_wanted(fn):
Log.Debug("Item %s's path is manually %s" % (fn, "included" if ret_val else "excluded"))
return ret_val
return True
if config.include_exclude_sz_files:
for sub_path in check_paths:
if config.is_physically_wanted(os.path.normpath(os.path.join(os.path.dirname(fn), sub_path))):
Log.Debug("An include/exclude indicator file exists in either the items or its parent folders")
return ret_val
return True
def refresh_item(rating_key, force=False, timeout=8000, refresh_kind=None, parent_rating_key=None):