You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Modifying the timeshift code to prevent departures when broadcasting Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
في بداية الملف، أضف هذه الاستيرادات إذا لم تكن موجودة
from enigma import eServiceReference, iServiceInformation, eTimer
import time
class Timeshift:
def init(self, session):
self.session = session
self.service = None
self.record_service = None
self.timeshift_enabled = False
self.prevent_jump_on_dropout = False # خيار جديد لمنع الترحيل عند انقطاع البث
self.last_position = 0 # لتخزين الموقع الأخير عند انقطاع البث
self.check_timer = eTimer()
self.check_timer.callback.append(self.checkServiceStatus)
def activate(self):
service = self.session.nav.getCurrentService()
if service:
self.service = service
self.session.nav.recordService(self.session.nav.getCurrentlyPlayingServiceReference(), True)
self.timeshift_enabled = True
self.check_timer.start(100, True) # فحص الحالة كل 100 مللي ثانية
def deactivate(self):
if self.timeshift_enabled:
self.session.nav.recordService(self.session.nav.getCurrentlyPlayingServiceReference(), False)
self.timeshift_enabled = False
self.check_timer.stop()
self.service = None
self.last_position = 0
def setPreventJumpOnDropout(self, enable=True):
"""تفعيل/تعطيل منع الترحيل عند انقطاع البث"""
self.prevent_jump_on_dropout = enable
if not enable:
self.last_position = 0 # إعادة تعيين الموقع إذا تم تعطيل الميزة
def checkServiceStatus(self):
if self.timeshift_enabled and self.service:
info = self.service.info()
if info:
is_playing = info.getInfo(iServiceInformation.sIsVideo) != -1 or info.getInfo(iServiceInformation.sIsAudio) != -1
buffer_fill = info.getInfo(iServiceInformation.sBuffer) # تحقق من ملء الذاكرة المؤقتة
if is_playing and buffer_fill > 0:
seek = self.service.seek()
if seek:
self.last_position = seek.getPlayPosition() # تحديث الموقع الأخير
elif self.prevent_jump_on_dropout and self.last_position > 0:
# في حالة انقطاع البث، عُد إلى الموقع الأخير بدلاً من القفز
seek = self.service.seek()
if seek:
seek.seekTo(self.last_position)
print("[Timeshift] انقطاع البث، يتم الاحتفاظ بالموقع الأخير:", self.last_position)
else:
print("[Timeshift] انقطاع البث، القفز أو التوقف ممكن بناءً على الإعدادات.")
if self.timeshift_enabled:
self.check_timer.start(100, True) # استمر في الفحص
Additional context
Add any other context or screenshots about the feature request here.
Sorry for arabic comments
The text was updated successfully, but these errors were encountered:
Please provide the complete py file because this is only a part of whatever.
There is no "class Timeshift:" in ATV.
I'm also not able to find "setPreventJumpOnDropout".
Do you really have tested this based on the latest ATV code?
Is your feature request related to a problem? Please describe.
Modifying the timeshift code to prevent departures when broadcasting
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
في بداية الملف، أضف هذه الاستيرادات إذا لم تكن موجودة
from enigma import eServiceReference, iServiceInformation, eTimer
import time
class Timeshift:
def init(self, session):
self.session = session
self.service = None
self.record_service = None
self.timeshift_enabled = False
self.prevent_jump_on_dropout = False # خيار جديد لمنع الترحيل عند انقطاع البث
self.last_position = 0 # لتخزين الموقع الأخير عند انقطاع البث
self.check_timer = eTimer()
self.check_timer.callback.append(self.checkServiceStatus)
Additional context
Add any other context or screenshots about the feature request here.
Sorry for arabic comments
The text was updated successfully, but these errors were encountered: