Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dream-alpha committed Nov 10, 2024
1 parent be8b0a8 commit 0a3b6b4
Show file tree
Hide file tree
Showing 7 changed files with 493 additions and 539 deletions.
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Description: TVMagazineCockpit
Maintainer: dream-alpha
Package: enigma2-plugin-extensions-tvmagazinecockpit
Version: 1.10.5
Version: 2.0.0
Architecture: all
Depends: enigma2-plugin-skincomponents-extmultilistselection
109 changes: 56 additions & 53 deletions src/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,32 @@
# <http://www.gnu.org/licenses/>.


from Components.config import config
from Components.UsageConfig import preferredTimerPath
from RecordTimer import RecordTimerEntry
from Screens.TimerEdit import TimerSanityConflict
from Screens.TimerEntry import TimerEntry
from Screens.ChoiceBox import ChoiceBox
from enigma import eServiceReference
from ServiceReference import ServiceReference
from Components.config import config
from .__init__ import _
from .Debug import logger
from .ConfigScreen import ConfigScreen
from .ChannelManagement import ChannelManagement
from .ConfigInit import bouquet_choices
from .About import about
from .Version import PLUGIN
from .ZapUtils import Zap_Service
from .Constants import EVENT_IDX_TIME_START, EVENT_IDX_TIME_END, EVENT_IDX_TITLE, EVENT_IDX_GENRE
from .PluginUtils import getPlugin, WHERE_MEDIATHEK_SEARCH, WHERE_TMDB_MOVIELIST
from .ServiceUtils import getService


class Menu():
def __init__(self):
logger.info("...")
self.mediathek_plugin = getPlugin(WHERE_MEDIATHEK_SEARCH)
self.tmdb_plugin = getPlugin(WHERE_TMDB_MOVIELIST)

def openMenu(self, service, event):
logger.info("service: %s", service)
logger.info("event: %s", event)
self.service = service
self.event = event
def openMenu(self, bouquet, channel_list, channel_dict):
logger.info("...")
self.bouquet = bouquet
self.channel_list = channel_list
self.channel_dict = channel_dict
alist = [
("%s" % _("Zap"), "zap"),
("%s" % _("Add Timer"), "timer"),
("%s" % _("Bouquet Selection"), "bouquetselection"),
("%s" % _("Bouquet Setup"), "channel"),
("%s" % _("Settings"), "settings"),
("%s" % _("About"), "about"),
]
if self.mediathek_plugin:
alist.append(("%s" % self.mediathek_plugin.description, "mediathek_search"))
if self.tmdb_plugin:
alist.append(("%s" % self.tmdb_plugin.description, "tmdb_search"))

self.session.openWithCallback(
self.openMenuCallback,
Expand All @@ -69,34 +59,47 @@ def openMenu(self, service, event):
def openMenuCallback(self, answer=None):
logger.info("...")
if answer:
action = answer[1]
if action == "zap":
Zap_Service(self.service)
self.close()
elif action == "timer":
serviceref = ServiceReference(eServiceReference(self.service))
begin = int(self.event[EVENT_IDX_TIME_START]) - config.recording.margin_before.value * 60
end = int(self.event[EVENT_IDX_TIME_END]) + config.recording.margin_after.value * 60
eventdata = (begin, end, self.event[EVENT_IDX_TITLE], self.event[EVENT_IDX_GENRE], None)
newEntry = RecordTimerEntry(serviceref, checkOldTimers=True, dirname=preferredTimerPath(), *eventdata)
self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
elif action == "mediathek_search":
self.mediathek_plugin(self.session, self.event[EVENT_IDX_TITLE])
elif action == "tmdb_search":
service = getService("", self.event[EVENT_IDX_TITLE])
self.tmdb_plugin(self.session, service)
screen = answer[1]
if screen == "channel":
self.session.openWithCallback(
self.openChannelManagementCallback,
ChannelManagement,
self.bouquet,
self.channel_list,
self.channel_dict,
)
elif screen == "settings":
self.session.openWithCallback(
self.openConfigScreenCallback,
ConfigScreen,
config.plugins.tvmagazinecockpit
)
elif screen == "bouquetselection":
alist = [(value[1], value[0]) for value in bouquet_choices]
self.session.openWithCallback(
self.openBouquetSelectionCallback,
ChoiceBox,
title="Bouquet Selection",
list=alist,
windowTitle=_("Bouquet Selection"),
allow_cancel=True,
titlebartext=_("Input")
)
elif screen == "about":
about(self.session)

def finishedAdd(self, answer):
def openConfigScreenCallback(self, _result=None):
logger.info("...")
if answer[0]:
entry = answer[1]
simulTimerList = self.session.nav.RecordTimer.record(entry)
if simulTimerList is not None:
for x in simulTimerList:
if x.setAutoincreaseEnd(entry):
self.session.nav.RecordTimer.timeChanged(x)
simulTimerList = self.session.nav.RecordTimer.record(entry)
if simulTimerList is not None:
self.session.openWithCallback(self.finishedAdd, TimerSanityConflict, simulTimerList)
else:
logger.debug("Timeredit aborted")
self.reload()

def openChannelManagementCallback(self, channel_list):
logger.info("...")
self.channel_list = channel_list
self.reload()

def openBouquetSelectionCallback(self, bouquet):
logger.info("bouquet: %s", bouquet)
if bouquet:
config.plugins.tvmagazinecockpit.bouquet.value = bouquet[1]
config.plugins.tvmagazinecockpit.bouquet.save()
self.close("programcolumns")
109 changes: 53 additions & 56 deletions src/More.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,42 @@
# <http://www.gnu.org/licenses/>.


from Screens.ChoiceBox import ChoiceBox
from Components.config import config
from Components.UsageConfig import preferredTimerPath
from RecordTimer import RecordTimerEntry
from Screens.TimerEdit import TimerSanityConflict
from Screens.TimerEntry import TimerEntry
from Screens.ChoiceBox import ChoiceBox
from enigma import eServiceReference
from ServiceReference import ServiceReference
from .__init__ import _
from .Debug import logger
from .ConfigScreen import ConfigScreen
from .ChannelManagement import ChannelManagement
from .ConfigInit import bouquet_choices
from .About import about
from .Version import PLUGIN
from .ZapUtils import Zap_Service
from .Constants import EVENT_IDX_TIME_START, EVENT_IDX_TIME_END, EVENT_IDX_TITLE, EVENT_IDX_GENRE
from .PluginUtils import getPlugin, WHERE_MEDIATHEK_SEARCH, WHERE_TMDB_MOVIELIST
from .ServiceUtils import getService


class More():
def __init__(self):
logger.info("...")
self.mediathek_plugin = getPlugin(WHERE_MEDIATHEK_SEARCH)
self.tmdb_plugin = getPlugin(WHERE_TMDB_MOVIELIST)

def openMore(self, bouquet, channel_list, channel_dict):
logger.info("...")
self.bouquet = bouquet
self.channel_list = channel_list
self.channel_dict = channel_dict
def openMore(self, service, event):
logger.info("service: %s", service)
logger.info("event: %s", event)
self.service = service
self.event = event
alist = [
("%s" % _("Bouquet Selection"), "bouquetselection"),
("%s" % _("Bouquet Setup"), "channel"),
("%s" % _("Settings"), "settings"),
("%s" % _("About"), "about"),
("%s" % _("Zap"), "zap"),
("%s" % _("Add Timer"), "timer"),
]
if self.mediathek_plugin:
alist.append(("%s" % self.mediathek_plugin.description, "mediathek_search"))
if self.tmdb_plugin:
alist.append(("%s" % self.tmdb_plugin.description, "tmdb_search"))

self.session.openWithCallback(
self.openMoreCallback,
Expand All @@ -59,47 +69,34 @@ def openMore(self, bouquet, channel_list, channel_dict):
def openMoreCallback(self, answer=None):
logger.info("...")
if answer:
screen = answer[1]
if screen == "channel":
self.session.openWithCallback(
self.openChannelManagementCallback,
ChannelManagement,
self.bouquet,
self.channel_list,
self.channel_dict,
)
elif screen == "settings":
self.session.openWithCallback(
self.openConfigScreenCallback,
ConfigScreen,
config.plugins.tvmagazinecockpit
)
elif screen == "bouquetselection":
alist = [(value[1], value[0]) for value in bouquet_choices]
self.session.openWithCallback(
self.openBouquetSelectionCallback,
ChoiceBox,
title="Bouquet Selection",
list=alist,
windowTitle=_("Bouquet Selection"),
allow_cancel=True,
titlebartext=_("Input")
)
elif screen == "about":
about(self.session)
action = answer[1]
if action == "zap":
Zap_Service(self.service)
self.close()
elif action == "timer":
serviceref = ServiceReference(eServiceReference(self.service))
begin = int(self.event[EVENT_IDX_TIME_START]) - config.recording.margin_before.value * 60
end = int(self.event[EVENT_IDX_TIME_END]) + config.recording.margin_after.value * 60
eventdata = (begin, end, self.event[EVENT_IDX_TITLE], self.event[EVENT_IDX_GENRE], None)
newEntry = RecordTimerEntry(serviceref, checkOldTimers=True, dirname=preferredTimerPath(), *eventdata)
self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
elif action == "mediathek_search":
self.mediathek_plugin(self.session, self.event[EVENT_IDX_TITLE])
elif action == "tmdb_search":
service = getService("", self.event[EVENT_IDX_TITLE])
self.tmdb_plugin(self.session, service)

def openConfigScreenCallback(self, _result=None):
def finishedAdd(self, answer):
logger.info("...")
self.reload()

def openChannelManagementCallback(self, channel_list):
logger.info("...")
self.channel_list = channel_list
self.reload()

def openBouquetSelectionCallback(self, bouquet):
logger.info("bouquet: %s", bouquet)
if bouquet:
config.plugins.tvmagazinecockpit.bouquet.value = bouquet[1]
config.plugins.tvmagazinecockpit.bouquet.save()
self.close("programcolumns")
if answer[0]:
entry = answer[1]
simulTimerList = self.session.nav.RecordTimer.record(entry)
if simulTimerList is not None:
for x in simulTimerList:
if x.setAutoincreaseEnd(entry):
self.session.nav.RecordTimer.timeChanged(x)
simulTimerList = self.session.nav.RecordTimer.record(entry)
if simulTimerList is not None:
self.session.openWithCallback(self.finishedAdd, TimerSanityConflict, simulTimerList)
else:
logger.debug("Timeredit aborted")
Loading

0 comments on commit 0a3b6b4

Please sign in to comment.