Skip to content

Commit

Permalink
[autotimer] revert - if service filter enabled the bouquet filter ign…
Browse files Browse the repository at this point in the history
…ored (#550)
  • Loading branch information
Dima73 authored and WanWizard committed Dec 31, 2019
1 parent 570ba81 commit 2b1211b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
27 changes: 14 additions & 13 deletions autotimer/src/AutoTimer.py
Expand Up @@ -318,19 +318,20 @@ def parseTimer(self, timer, epgcache, serviceHandler, recordHandler, checkEvtLim
match = match.lower()

test = []
if timer.services:
test = [(service, 0, -1, -1) for service in timer.services]
elif timer.bouquets:
for bouquet in timer.bouquets:
services = serviceHandler.list(eServiceReference(bouquet))
if services:
while True:
service = services.getNext()
if not service.valid():
break
playable = not (service.flags & (eServiceReference.isMarker|eServiceReference.isDirectory)) or (service.flags & eServiceReference.isNumberedMarker)
if playable:
test.append((service.toString(), 0, -1, -1))
if timer.services or timer.bouquets:
if timer.services:
test = [(service, 0, -1, -1) for service in timer.services]
if timer.bouquets:
for bouquet in timer.bouquets:
services = serviceHandler.list(eServiceReference(bouquet))
if services:
while True:
service = services.getNext()
if not service.valid():
break
playable = not (service.flags & (eServiceReference.isMarker|eServiceReference.isDirectory)) or (service.flags & eServiceReference.isNumberedMarker)
if playable:
test.append((service.toString(), 0, -1, -1))
else: # Get all bouquets
bouquetlist = []
if config.usage.multibouquet.value:
Expand Down
4 changes: 0 additions & 4 deletions autotimer/src/AutoTimerComponent.py
Expand Up @@ -416,8 +416,6 @@ def checkIncluded(self, title, short, extended, dayofweek):
def checkServices(self, check_service):
services = self.services
bouquets = self.bouquets
if services:
bouquets = []
if services or bouquets:
addbouquets = []

Expand Down Expand Up @@ -689,8 +687,6 @@ def getFastServices(self):
addbouquets = []
services = self.services
bouquets = self.bouquets
if services:
bouquets = []
for service in services:
myref = eServiceReference(str(service))
if myref.flags & eServiceReference.isGroup:
Expand Down
6 changes: 3 additions & 3 deletions autotimer/src/AutoTimerEditor.py
Expand Up @@ -583,7 +583,7 @@ def renameServiceButton(self):
self.isActive_services_value = _("enabled")
else:
self.isActive_services_value = _("disabled")
if self.bouquets and not self.services:
if self.bouquets:
self.isActive_bouquets_value = _("enabled")
else:
self.isActive_bouquets_value = _("disabled")
Expand Down Expand Up @@ -651,8 +651,8 @@ def initHelpTexts(self):
self.descShortEqualExt: _("When this option enabled, short description to equal extended description if short description is empty."),
self.descShortExtEmpty: _("When this option enabled and short description and extended description match is empty and timer title exist in match title, match is not a duplicate. Attention, this may result in double timers."),
self.ratioThresholdDuplicate: _("To cater for spelling mistakes and small deviations in the EPG information, you can make the matching algorithm fuzzy by setting the percentage both programmes must be equal for. Use 100% if you only want a match when both are completely identical. Recommended default ratio 80%."),
self.isActive_services: _("Use blue key to edit bouquets or services.") + _(" (if services are enabled, bouquets are ignored.)."),
self.isActive_bouquets: _("Use blue key to edit bouquets or services.") + _(" (if services are enabled, bouquets are ignored)."),
self.isActive_services: _("Use blue key to edit bouquets or services."),
self.isActive_bouquets: _("Use blue key to edit bouquets or services."),
self.isActive_dayofweek: _("Use yellow key to edit filters."),
self.isActive_otherfilters: _("Use yellow key to edit filters."),
}
Expand Down
19 changes: 12 additions & 7 deletions autotimer/src/AutoTimerList.py
Expand Up @@ -95,20 +95,25 @@ def buildListboxEntry(self, timer):

channels = []
bouquets = []
channel = ""
if timer.services:
for t in timer.services:
channels.append(ServiceReference(t).getServiceName())
elif timer.bouquets:
if timer.bouquets:
for t in timer.bouquets:
bouquets.append(ServiceReference(t).getServiceName())
if len(channels) > 0:
channel = _("[S] ")
channel += ", ".join(channels)
elif len(bouquets) > 0:
channel = _("[B] ")
channel += ", ".join(bouquets)
if channels or bouquets:
if channels:
channel = _("[S] ")
channel += ", ".join(channels)
channel += " "
if bouquets:
channel += _("[B] ")
channel += ", ".join(bouquets)
else:
channel = _("All channels")
if timer.searchType == "favoritedesc":
channel = _("[B] ") + channel
height = self.l.getItemSize().height()
width = self.l.getItemSize().width()
res = [ None ]
Expand Down
2 changes: 1 addition & 1 deletion autotimer/src/plugin.py
Expand Up @@ -38,7 +38,7 @@
autotimer = AutoTimer()
autopoller = None

AUTOTIMER_VERSION = "4.6.2"
AUTOTIMER_VERSION = "4.6.3"

try:
from Plugins.SystemPlugins.MPHelp import registerHelp, XMLHelpReader
Expand Down

1 comment on commit 2b1211b

@QuarkFermion
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work to revert to the more user-friendly and expected search behavior! Thank you.
Additional [S] and [B] markers are not necessary and lead to overloaded UI and confusing for the user.
They occupy a lot of space, especially with the two spaces. The space in the skin widget is limited.
Suggestion: Remove the additional [B] and [S] marker.

Please sign in to comment.