Skip to content

Commit

Permalink
10.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dream-alpha committed Sep 7, 2024
1 parent 6e93503 commit 0951be9
Show file tree
Hide file tree
Showing 24 changed files with 355 additions and 43 deletions.
4 changes: 2 additions & 2 deletions CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Description: TimeshiftCockpit
Maintainer: dream-alpha
Package: enigma2-plugin-extensions-timeshiftcockpit
Version: 10.2.2
Version: 10.3.1
Architecture: all
Depends: enigma2-plugin-skincomponents-cockpit, enigma2-plugin-systemplugins-powercockpit, enigma2-plugin-systemplugins-covercockpit
Depends: enigma2-plugin-skincomponents-cockpit, enigma2-plugin-systemplugins-powercockpit, enigma2-plugin-systemplugins-covercockpit, enigma2-plugin-systemplugins-jobcockpit
38 changes: 31 additions & 7 deletions po/TimeshiftCockpit.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Common\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-30 17:42+0200\n"
"POT-Creation-Date: 2024-09-07 13:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: dream-alpha\n"
"Language-Team: \n"
Expand All @@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 3.4.4\n"
"X-Generator: Poedit 3.5\n"
"X-Loco-Source-Locale: en-US\n"
"X-Loco-Project-Id: 47158\n"
"X-Loco-Api-Version: 1.0.19 20180501-1\n"
Expand Down Expand Up @@ -40,10 +40,16 @@ msgstr ""
msgid "Previous event"
msgstr ""

msgid "Show Events"
msgid "Show events"
msgstr ""

msgid "Record Timeshift Event"
msgid "Record timeshift Event"
msgstr ""

msgid "Show active timeshifts"
msgstr ""

msgid "Manage timeshift recordings"
msgstr ""

msgid "Open service list"
Expand Down Expand Up @@ -136,6 +142,27 @@ msgstr ""
msgid "Timeshift recording"
msgstr ""

msgid "Exit"
msgstr ""

msgid "Timeshifts Overview"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "type"
msgstr ""

msgid "fixed"
msgstr ""

msgid "variable"
msgstr ""

msgid "recordings"
msgstr ""

msgid "Setup"
msgstr ""

Expand All @@ -151,9 +178,6 @@ msgstr ""
msgid "Skip backward"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Save"
msgstr ""

Expand Down
38 changes: 31 additions & 7 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Common\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-30 17:42+0200\n"
"POT-Creation-Date: 2024-09-07 13:32+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: dream-alpha\n"
"Language-Team: \n"
Expand All @@ -11,7 +11,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 3.4.4\n"
"X-Generator: Poedit 3.5\n"
"X-Loco-Source-Locale: en-US\n"
"X-Loco-Project-Id: 47158\n"
"X-Loco-Api-Version: 1.0.19 20180501-1\n"
Expand Down Expand Up @@ -40,12 +40,18 @@ msgstr "Nächste Sendung"
msgid "Previous event"
msgstr "Vorherige Sendung"

msgid "Show Events"
msgid "Show events"
msgstr "Sendungsauswahl"

msgid "Record Timeshift Event"
msgid "Record timeshift Event"
msgstr "Aufnahme einer Timeshift Sendung"

msgid "Show active timeshifts"
msgstr "Aktive Timeshift Kanäle anzeigen"

msgid "Manage timeshift recordings"
msgstr "Timeshift Aufnahmen verwalten"

msgid "Open service list"
msgstr "Öffne Senderliste"

Expand Down Expand Up @@ -136,6 +142,27 @@ msgstr "TS Aufnahme"
msgid "Timeshift recording"
msgstr "Timeshift Aufnahme"

msgid "Exit"
msgstr "Beenden"

msgid "Timeshifts Overview"
msgstr "Timeshifts Überblick"

msgid "Cancel"
msgstr "Abbruch"

msgid "type"
msgstr "Typ"

msgid "fixed"
msgstr "fest"

msgid "variable"
msgstr "variabel"

msgid "recordings"
msgstr "Aufnahmen"

msgid "Setup"
msgstr "Einstellungen"

Expand All @@ -151,9 +178,6 @@ msgstr "Springe vorwärts"
msgid "Skip backward"
msgstr "Springe zurück"

msgid "Cancel"
msgstr "Abbruch"

msgid "Save"
msgstr "Speichern"

Expand Down
14 changes: 12 additions & 2 deletions src/CockpitPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
from .Version import ID
from .EventChoiceBox import EventChoiceBox
from .DelayTimer import DelayTimer
from .TimeshiftUtils import manageTimeshiftRecordings
from .TimeshiftsInfo import TimeshiftsInfo


class CockpitPlayerSummary(Screen):
Expand Down Expand Up @@ -96,8 +98,10 @@ def __init__(self, session, service, config_plugins_plugin, timeshift_start_time
"INFO": (self.showMovieInfo, _("Movie info")),
"NEXT": (self.nextEvent, _("Next event")),
"PREVIOUS": (self.previousEvent, _("Previous event")),
"MENU": (self.selectEventPlayback, _("Show Events")),
"RECORD": (self.selectEventRecording, _("Record Timeshift Event")),
"MENU": (self.selectEventPlayback, _("Show events")),
"RECORD": (self.selectEventRecording, _("Record timeshift Event")),
"BLUE": (self.blueKey, _("Show active timeshifts")),
"YELLOW": (self.yellowKey, _("Manage timeshift recordings")),
"HELP": (self.noOp, "")
}

Expand All @@ -122,6 +126,12 @@ def __init__(self, session, service, config_plugins_plugin, timeshift_start_time
def noOp(self):
return

def blueKey(self):
self.session.open(TimeshiftsInfo, self.infobar_instance)

def yellowKey(self):
manageTimeshiftRecordings(self.session, ID)

def powerDown(self):
self.close("power_down")

Expand Down
31 changes: 17 additions & 14 deletions src/InfoBar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
from Screens.MessageBox import MessageBox
from Components.config import config
from Components.ServiceEventTracker import ServiceEventTracker
from Components.Task import job_manager
from Plugins.SystemPlugins.JobCockpit.JobSupervisor import JobSupervisor
from Tools import Notifications
from enigma import eTimer, eServiceReference, iPlayableService
from .Debug import logger
from .Timeshift import Timeshift
from .RecordState import RecordState
from .DelayTimer import DelayTimer
from .Recording import Recording
from .Version import ID
from .JobUtils import getPendingJobs
from .__init__ import _
from .Version import ID


instance = None
Expand All @@ -46,6 +47,7 @@ def __init__(self, session):
InfoBarOrg.instance = self
global instance
instance = self
self.job_manager = JobSupervisor.getInstance().registerJobManager(ID)
self.on_timeshift_recording_change = []
Recording.__init__(self, session)
config.misc.epgcache_outdated_timespan.value = 10
Expand Down Expand Up @@ -119,7 +121,7 @@ def addTimeshift(self, service_str=None):
if service_str is not None:
logger.debug("max_timeshifts: %s", self.max_timeshifts)
if service_str not in self.timeshifts and len(self.timeshifts) < self.max_timeshifts:
self.timeshifts[service_str] = Timeshift(self.session, eServiceReference(service_str), instance)
self.timeshifts[service_str] = Timeshift(self.session, eServiceReference(service_str), instance, self.job_manager)
if self.timeshifts[service_str].startTimeshift() is None:
self.timeshifts.pop(service_str, None)
else:
Expand Down Expand Up @@ -161,26 +163,27 @@ def isTimeshifting(self):
return is_timeshifting

def isTimeshiftRecording(self, path_or_ref=""):
logger.info("...")
is_timeshift_recording = False
jobs = job_manager.getPendingJobs()
jobs = getPendingJobs(ID)
for job in jobs:
if job.id == ID:
if path_or_ref:
if path_or_ref in [job.target_path, job.service_str]:
is_timeshift_recording = True
break
else:
if path_or_ref:
if path_or_ref in [job.target_path, job.service_str]:
is_timeshift_recording = True
break
else:
is_timeshift_recording = True
break
logger.debug("is_timeshift_recording: %s", is_timeshift_recording)
return is_timeshift_recording

def getTimeshiftRecordings(self):
def getTimeshiftRecordings(self, service_str=""):
logger.info("...")
recordings_list = []
jobs = job_manager.getPendingJobs()
jobs = getPendingJobs(ID)
for job in jobs:
if job.id == ID:
if service_str:
if job.service_str == service_str:
recordings_list.append(job.target_path)
else:
recordings_list.append(job.target_path)
return recordings_list
26 changes: 26 additions & 0 deletions src/JobUtils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/python
# coding=utf-8
#
# Copyright (C) 2018-2024 by dream-alpha
#
# In case of reuse of this source code please do not remove this copyright.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For more information on the GNU General Public License see:
# <http://www.gnu.org/licenses/>.


from Plugins.SystemPlugins.JobCockpit.JobSupervisor import JobSupervisor


def getPendingJobs(plugin_id="", as_tuples=False):
return JobSupervisor.getInstance().getPendingJobs(plugin_id, as_tuples)
1 change: 1 addition & 0 deletions src/PluginUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
WHERE_MEDIATHEK_SEARCH = -96
WHERE_TVMAGAZINE_SEARCH = -95
WHERE_COVER_DOWNLOAD = -94
WHERE_JOBCOCKPIT = -93


def getPlugin(where):
Expand Down
13 changes: 12 additions & 1 deletion src/ServiceUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@


import os
from enigma import eServiceReference
from enigma import eServiceReference, loadPNG
from Components.config import config
from .Debug import logger


SID_DVB = eServiceReference.idDVB # eServiceFactoryDVB::id enum{id = 0x0001};
Expand Down Expand Up @@ -62,3 +64,12 @@ def getService(path, name=""):
service.setData(1, DEFAULT_AUDIO_PID)
service.setName(name)
return service


def getPicon(service_reference):
pos = service_reference.rfind(':')
if pos != -1:
service_reference = service_reference[:pos].rstrip(':').replace(':', '_')
picon_path = os.path.join(config.usage.configselection_piconspath.value, service_reference + '.png')
logger.debug("picon_path: %s", picon_path)
return loadPNG(picon_path)
18 changes: 12 additions & 6 deletions src/TSRecordingJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@


from Components.config import config
from Components.Task import Job, job_manager
from Components.Task import Job
from .Debug import logger
from .TSRecordingTask import TSRecordingTask
from .TimeshiftUtils import calcFilename
from .Version import ID
from .__init__ import _


class TSRecordingJob():

def __init__(self, infobar_instance):
def __init__(self, infobar_instance, job_manager):
self.service_str = ""
self.infobar_instance = infobar_instance
self.job_manager = job_manager

def onTimeshiftRecordingChange(self):
for function in self.infobar_instance.on_timeshift_recording_change:
Expand All @@ -46,12 +47,17 @@ def startTSRecording(self, service_ref, event_data):
def addJob(self, service_ref, path, timeshift_start_time, event_data):
logger.info("path: %s, event_data: %s", path, event_data)
job = Job("%s - %s" % (_("TS recording"), event_data[2]))
job.id = ID
job.target_path = calcFilename(event_data[0], service_ref, event_data[2], config.plugins.timeshiftcockpit.videodir.value)
job.service_str = service_ref.toString()
job.service_str = self.service_str = service_ref.toString()
job.terminateJob = self.terminateJob
job.keep_completed_jobs = True
TSRecordingTask(job, self.infobar_instance, service_ref, path, job.target_path, timeshift_start_time, event_data, self.addJobCallback)
job_manager.AddJob(job)
self.job_manager.AddJob(job)

def addJobCallback(self, error):
logger.info("error: %s", error)
self.onTimeshiftRecordingChange()

def terminateJob(self):
logger.info("service_str: %s", self.service_str)
self.infobar_instance.stopTSRecording(self.service_str)
4 changes: 2 additions & 2 deletions src/Timeshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@

class Timeshift(Playback, TSRecordingJob):

def __init__(self, session, service_ref, infobar_instance):
def __init__(self, session, service_ref, infobar_instance, job_manager):
logger.info("service_ref: %s", service_ref.toString())
Playback.__init__(self, session, infobar_instance, service_ref)
TSRecordingJob.__init__(self, infobar_instance)
TSRecordingJob.__init__(self, infobar_instance, job_manager)
self.events_info = []
self.service_ref = service_ref
self.record_service = None
Expand Down
Loading

0 comments on commit 0951be9

Please sign in to comment.