Skip to content

Commit

Permalink
1.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dream-alpha committed Jul 8, 2024
1 parent 7e0ce5c commit ba6f48a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 31 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.6.6
Version: 1.6.9
Architecture: all
Depends: enigma2-plugin-skincomponents-extmultilistselection
9 changes: 6 additions & 3 deletions po/TVMagazineCockpit.pot
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2024-06-23 19:27+0200\n"
"PO-Revision-Date: 2024-06-23 19:27+0200\n"
"POT-Creation-Date: 2024-07-04 18:09+0200\n"
"PO-Revision-Date: 2024-07-04 18:10+0200\n"
"Last-Translator: dream-alpha\n"
"Language-Team: \n"
"Language: de_DE\n"
Expand Down Expand Up @@ -188,7 +188,10 @@ msgstr ""
msgid "Browse TV Magazine"
msgstr ""

msgid "Search TV Magazine ..."
msgid "TVMagazineCockpit Infos"
msgstr ""

msgid "Show TVMagazine Event Infos..."
msgstr ""

msgid "TVMagazineCockpit Search"
Expand Down
11 changes: 7 additions & 4 deletions po/de.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2024-06-23 19:27+0200\n"
"PO-Revision-Date: 2024-06-23 19:27+0200\n"
"POT-Creation-Date: 2024-07-04 18:09+0200\n"
"PO-Revision-Date: 2024-07-04 18:10+0200\n"
"Last-Translator: dream-alpha\n"
"Language-Team: \n"
"Language: de_DE\n"
Expand Down Expand Up @@ -192,8 +192,11 @@ msgstr "Kanäle"
msgid "Browse TV Magazine"
msgstr "TV Magazin duchblättern"

msgid "Search TV Magazine ..."
msgstr "TV Magazin Suche ..."
msgid "TVMagazineCockpit Infos"
msgstr "TV Magazin Suche"

msgid "Show TVMagazine Event Infos..."
msgstr "TV Magazine SendungsInfos"

msgid "TVMagazineCockpit Search"
msgstr "TV Magazin Suche"
Expand Down
36 changes: 20 additions & 16 deletions src/ProgramColumns.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(self, session, channel_dict):
self["actions"] = ActionMap(
["TVC_Actions", "NumberActions"],
{
"0": self.reload,
"ok": self.key_ok,
"cancel": self.close,
"info": self.key_ok,
Expand All @@ -80,9 +81,10 @@ def __init__(self, session, channel_dict):

self.tvs_data_mgr = TVSpielfilmData(self.showChannel)
self.events = {}
self.list_columns = [[], [], [], [], [], []]
self.list_indices = [-1, -1, -1, -1, -1, -1]
self.cols = 6
self.list_columns = [[]] * self.cols
self.list_prime = [[]] * self.cols
self.list_indices = [-1] * self.cols
self.listindex = 0
self.page_index = 0
self.pages = 0
Expand Down Expand Up @@ -166,24 +168,22 @@ def createListEntry(event):
channel_id = channel["id"]
self.events = events
tmp_list = []
prime_time = 20 * 60 + 15
prime_diff = 24 * 60
prime_event = None
prime_time = self.getPointInTime("20:15")
prime_diff = prime_time
self.list_prime[i] = None
now_time = self.point_in_time
now_diff = now_time
now_index = 0
for event_index, event in enumerate(events[self.day][channel_id]):
tmp = createListEntry(event)
event_HM = tmp[0].split(":")
event_time = int(event_HM[0]) * 60 + int(event_HM[1])
event_time = int(event[EVENT_IDX_TIME_START])
event_diff = abs(prime_time - event_time)
# logger.debug("event_time: %s, event_diff: %s, prime_diff: %s", event_time, event_diff, prime_diff)
if event_diff < prime_diff:
prime_diff = event_diff
prime_event = event
self.list_prime[i] = event
# logger.debug("new prime diff: %s", prime_diff)

event_time = int(event[EVENT_IDX_TIME_START])
event_diff = abs(now_time - event_time)
# logger.debug("event_time: %s, event_diff: %s, now_diff: %s", event_time, event_diff, now_diff)
if event_diff < now_diff:
Expand All @@ -192,13 +192,13 @@ def createListEntry(event):
# logger.debug("new now diff: %s, index: %s", now_diff, now_index)
tmp_list.append(tmp)

if prime_event:
self.showPrimeEvent(prime_event, i, channel)
if self.list_prime[i]:
self.showPrimeEvent(self.list_prime[i], i, channel)

# create sublist
self.list_columns[i] = tmp_list
self.list_indices[i] = now_index
sub_list = tmp_list[now_index - 1:now_index + 4]

sub_list = self.list_columns[i][self.list_indices[i] - 1:self.list_indices[i] + 4]
j = len(sub_list)
while j < 5:
sub_list.append(["", "", "", "", 0])
Expand Down Expand Up @@ -253,7 +253,7 @@ def left(self):
if self.page_index < 0:
self.page_index = self.pages - 1
max_listindex = len(self.channel_list) % self.cols - 1
if self.listindex > max_listindex > 0:
if max_listindex >= 0:
self.listindex = max_listindex
self.showPage()
self["list%s" % self.listindex].setSelectionEnable(True)
Expand Down Expand Up @@ -384,14 +384,18 @@ def key_blue(self):

def reload(self):
logger.info("self.channel_list: %s", self.channel_list)
self["list%s" % self.listindex].setSelectionEnable(False)
self.pages = int(ceil(float(len(self.channel_list)) / self.cols))
self.listindex = 0
self.page_index = 0
self.mytimecount = max(min(len(self.timelist) - 1, self.mytimecount), 0)
self["searchdate"].text = self.timelist[self.mytimecount][0]
self.day = self.timelist[self.mytimecount][1]
self.list_columns = [[], [], [], [], [], []]
self.list_indices = [-1, -1, -1, -1, -1, -1]
self.list_columns = [[]] * self.cols
self.list_prime = [[]] * self.cols
self.list_indices = [-1] * self.cols
self.point_in_time = self.getPointInTime("20:15")
self["list%s" % self.listindex].setSelectionEnable(True)
self.showPage()

def __onClose__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

PLUGIN = "TVMagazineCockpit"
ID = "TVC"
VERSION = "1.6.6"
VERSION = "1.6.9"
COPYRIGHT = "2018-2024 by dream-alpha"
LICENSE = "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version."
8 changes: 4 additions & 4 deletions src/keymap.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<keymap>
<map context="TVC_Actions">
<key flags="mr" id="KEY_OK" mapto="ok"/>
<key flags="mr" id="KEY_EXIT" mapto="cancel"/>
<key flags="m" id="KEY_0" mapto="0"/>
<key flags="m" id="KEY_OK" mapto="ok"/>
<key flags="m" id="KEY_EXIT" mapto="cancel"/>
<key flags="m" id="KEY_RED" mapto="red"/>
<key flags="m" id="KEY_GREEN" mapto="green"/>
<key flags="m" id="KEY_YELLOW" mapto="yellow"/>
Expand All @@ -10,8 +11,7 @@
<key flags="mr" id="KEY_DOWN" mapto="down"/>
<key flags="mr" id="KEY_LEFT" mapto="left"/>
<key flags="mr" id="KEY_RIGHT" mapto="right"/>
<key flags="mr" id="KEY_MENU" mapto="menu"/>
<key flags="l" id="KEY_MENU" mapto="menulong"/>
<key flags="m" id="KEY_MENU" mapto="menu"/>
<key flags="mr" id="KEY_NEXT" mapto="next"/>
<key flags="mr" id="KEY_PREVIOUS" mapto="back"/>
<key flags="m" id="KEY_INFO" mapto="info"/>
Expand Down
Binary file modified src/locale/de/LC_MESSAGES/TVMagazineCockpit.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def Plugins(**__kwargs):
fnc=main
),
PluginDescriptor(
name="TVMagazineCockpit Search",
description=_("Search TV Magazine ..."),
name=_("TVMagazineCockpit Infos"),
description=_("Show TVMagazine Event Infos..."),
where=[
PluginDescriptor.WHERE_EPG_SELECTION_SINGLE_BLUE,
PluginDescriptor.WHERE_EVENTINFO,
Expand Down

0 comments on commit ba6f48a

Please sign in to comment.