Skip to content

Commit 6300f08

Browse files
committed
Fix wrong startswith syntax and also filter for https
1 parent 17f8df2 commit 6300f08

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

utilities.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,74 +117,74 @@ def checkExclusion(fullpath):
117117
return True
118118

119119
# Live TV exclusion
120-
if (fullpath.startswith("pvr://") > -1) and getSettingAsBool('ExcludeLiveTV'):
120+
if fullpath.startswith("pvr://") and getSettingAsBool('ExcludeLiveTV'):
121121
logger.debug("checkExclusion(): Video is playing via Live TV, which is currently set as excluded location.")
122122
return True
123123

124124
# HTTP exclusion
125-
if (fullpath.startswith("http://") > -1) and getSettingAsBool('ExcludeHTTP'):
125+
if (fullpath.startswith("http://") or fullpath.startswith("https://")) and getSettingAsBool('ExcludeHTTP'):
126126
logger.debug("checkExclusion(): Video is playing via HTTP source, which is currently set as excluded location.")
127127
return True
128128

129129
# Path exclusions
130130
ExcludePath = getSetting('ExcludePath')
131131
if ExcludePath != "" and getSettingAsBool('ExcludePathOption'):
132-
if fullpath.startswith(ExcludePath) > -1:
132+
if fullpath.startswith(ExcludePath):
133133
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 1.")
134134
return True
135135
ExcludePath2 = getSetting('ExcludePath2')
136136
if ExcludePath2 != "" and getSettingAsBool('ExcludePathOption2'):
137-
if fullpath.startswith(ExcludePath2) > -1:
137+
if fullpath.startswith(ExcludePath2):
138138
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 2.")
139139
return True
140140
ExcludePath3 = getSetting('ExcludePath3')
141141
if ExcludePath3 != "" and getSettingAsBool('ExcludePathOption3'):
142-
if fullpath.startswith(ExcludePath3) > -1:
142+
if fullpath.startswith(ExcludePath3):
143143
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 3.")
144144
return True
145145
ExcludePath4 = getSetting('ExcludePath4')
146146
if ExcludePath4 != "" and getSettingAsBool('ExcludePathOption4'):
147-
if fullpath.startswith(ExcludePath4) > -1:
147+
if fullpath.startswith(ExcludePath4):
148148
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 4.")
149149
return True
150150
ExcludePath5 = getSetting('ExcludePath5')
151151
if ExcludePath5 != "" and getSettingAsBool('ExcludePathOption5'):
152-
if fullpath.startswith(ExcludePath5) > -1:
152+
if fullpath.startswith(ExcludePath5):
153153
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 5.")
154154
return True
155155
ExcludePath6 = getSetting('ExcludePath6')
156156
if ExcludePath6 != "" and getSettingAsBool('ExcludePathOption6'):
157-
if fullpath.startswith(ExcludePath6) > -1:
157+
if fullpath.startswith(ExcludePath6):
158158
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 6.")
159159
return True
160160
ExcludePath7 = getSetting('ExcludePath7')
161161
if ExcludePath7 != "" and getSettingAsBool('ExcludePathOption7'):
162-
if fullpath.startswith(ExcludePath7) > -1:
162+
if fullpath.startswith(ExcludePath7):
163163
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 7.")
164164
return True
165165
ExcludePath8 = getSetting('ExcludePath8')
166166
if ExcludePath8 != "" and getSettingAsBool('ExcludePathOption8'):
167-
if fullpath.startswith(ExcludePath8) > -1:
167+
if fullpath.startswith(ExcludePath8):
168168
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 8.")
169169
return True
170170
ExcludePath9 = getSetting('ExcludePath9')
171171
if ExcludePath9 != "" and getSettingAsBool('ExcludePathOption9'):
172-
if fullpath.startswith(ExcludePath9) > -1:
172+
if fullpath.startswith(ExcludePath9):
173173
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 9.")
174174
return True
175175
ExcludePath10 = getSetting('ExcludePath10')
176176
if ExcludePath10 != "" and getSettingAsBool('ExcludePathOption10'):
177-
if fullpath.startswith(ExcludePath10) > -1:
177+
if fullpath.startswith(ExcludePath10):
178178
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 10.")
179179
return True
180180
ExcludePath11 = getSetting('ExcludePath11')
181181
if ExcludePath11 != "" and getSettingAsBool('ExcludePathOption11'):
182-
if fullpath.startswith(ExcludePath11) > -1:
182+
if fullpath.startswith(ExcludePath11):
183183
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 11.")
184184
return True
185185
ExcludePath12 = getSetting('ExcludePath12')
186186
if ExcludePath12 != "" and getSettingAsBool('ExcludePathOption12'):
187-
if fullpath.startswith(ExcludePath12) > -1:
187+
if fullpath.startswith(ExcludePath12):
188188
logger.debug("checkExclusion(): Video is from location, which is currently set as excluded path 12.")
189189
return True
190190

0 commit comments

Comments
 (0)