Jump to content


Photo

Not all changes in timers are saved immediately


  • Please log in to reply
18 replies to this topic

#1 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 5 December 2023 - 16:33

Hi,

 

I want to save automaticaly some files as the timers but I've seen if I have reactivated a timer, the hdd timers file is not modified. The modified timer is only kept in the memory unless I restart openpli. If I create a timer, the file is immediately stored on the hdd. What is the problem please? :)

 

I've searched on the forum if there were an information on this subject and I have found a previous subject I posted a few years ago. I have noticed old timers were not deleted automatically after the number of days indicated in the settings if the dreambox was switched off and switched on several days after the number of days indicated in the settings.

 

Example : I create a timer, I get the record and a few days later I switch off the dreambox. In the settings, I have chosen to delete old timers after 8 days. If I switch on the box 10 days later, openpli does not delete the old timers even if I wait a few days. Perhaps openpli counts only the number of days where the box is switched on.

 

This little problem is still present even if it's not dramatic ;) .


Edited by sjlouis, 5 December 2023 - 16:34.

Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #2 WanWizard

  • PLi® Core member
  • 70,396 posts

+1,807
Excellent

Posted 5 December 2023 - 16:36

In general nothing in Enigma is saved until you stop or restart Enigma. The same is true for the configuration and EPG data.

 

The design is stil from the time I/O was expensive and should be avoided where possible.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Not all changes in timers are saved immediately #3 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 5 December 2023 - 17:32

WanWizard, I think you were right a few years ago. I had noted this fact but I think this has been changed ;)  .

 

I did tests with settings (I added a script on the long yellow touch) and it was stored immediately. I added a timer in the timers file and it was immediately stored. I deleted it and it was immediately stored ;) .

 

I haven't done a lot of tests but I think it's better to store immediately to avoid losing data if the box crashes or if the user switch off  the box :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #4 WanWizard

  • PLi® Core member
  • 70,396 posts

+1,807
Excellent

Posted 5 December 2023 - 17:36

In some cases for specific reasons a direct save has been added. But this is definitely not generic.

 

I haven't done a lot of tests but I think it's better to store immediately to avoid losing data if the box crashes or if the user switch off  the box :) .

 

We are not in disagreement on this point.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Not all changes in timers are saved immediately #5 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 5 December 2023 - 17:41

As far I can see at all points where you change a timerEntry they are saved.... And that straightaway... So the should be something strange with you config


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #6 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 5 December 2023 - 18:01

Littlesat, I remember some changes were not stored immediately and WanWizard have the same memory ;) .

 

Can you test with timer activation and deactivation? It does it with 2 box. This modification is not stored on the hdd immediately. The other modifications are stored immediately.


Edited by sjlouis, 5 December 2023 - 18:04.

Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #7 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 5 December 2023 - 19:57

I checked the code and it is saved after every change so it would be helpful to understand more, Where are you doing the deactivation and reactivations? On what screen.

Edited by littlesat, 5 December 2023 - 19:58.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #8 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 6 December 2023 - 15:00

In the standard screen (I can choose the English language) :

Attached Files


Edited by sjlouis, 6 December 2023 - 15:01.

Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #9 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 6 December 2023 - 16:11

In the TimerEdit.py screen mayby when you 'safely' leave that screen we could consider to add...

 

self.session.nav.RecordTimer.saveTimer()

 

I think this is the easiest way to resolve it...

 

https://github.com/O...y#L404C1-L404C1

                def leave(self):
                                self.session.nav.RecordTimer.on_state_change.remove(self.onStateChange)
+                               self.session.nav.RecordTimer.saveTimer()
                                self.close()

Edited by littlesat, 6 December 2023 - 16:14.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #10 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 6 December 2023 - 19:42

I do want to believe you :P .

 

When I modify an hour or the location to save the file, when I press "OK", the modifications are stored on the HDD.

 

When I modify with yellow touch (activate or deactivate), when I press "OK", the modification in stored in the memory but not on the HDD.

 

If I quit with with "Exit", nothing is stored, which is correct.


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #11 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 6 December 2023 - 19:59

Usually when you close enigma2 normally everything should be stored. But when you pull the plug then indeed there is a chance it is not stored. The suggestion I just gave is save it when you leave the timeredit screen. In the timerentry screen this is already done.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #12 Dimitrij

  • PLi® Core member
  • 10,299 posts

+347
Excellent

Posted 7 December 2023 - 06:22

	def toggleDisabledState(self):
		cur = self["timerlist"].getCurrent()
		timer_changed = True
		if cur:
			t = cur
			if t.external:
				self.fallbackTimer.toggleTimer(t, self.refill)
			else:
				stateRunning = t.state in (1, 2)
				if t.disabled and t.repeated and stateRunning and not t.justplay:
					return
				if t.disabled:
					print("[TimerEditList] try to ENABLE timer")
					t.enable()
					timersanitycheck = TimerSanityCheck(self.session.nav.RecordTimer.timer_list, cur)
					if not timersanitycheck.check():
						t.disable()
						print("[TimerEditList] sanity check failed")
						simulTimerList = timersanitycheck.getSimulTimerList()
						if simulTimerList is not None:
							self.session.openWithCallback(self.finishedEdit, TimerSanityConflict, simulTimerList)
							timer_changed = False
					else:
						print("[TimerEditList] sanity check passed")
						if timersanitycheck.doubleCheck():
							t.disable()
				else:
					if stateRunning:
						if t.isRunning() and t.repeated:
							list = (
								(_("Stop current event but not coming events"), "stoponlycurrent"),
								(_("Stop current event and disable coming events"), "stopall"),
								(_("Don't stop current event but disable coming events"), "stoponlycoming")
							)
							self.session.openWithCallback(boundFunction(self.runningEventCallback, t), ChoiceBox, title=_("A repeating event is currently recording. What would you like to do?"), list=list)
							timer_changed = False
					else:
						t.disable()
				if timer_changed:
					self.session.nav.RecordTimer.timeChanged(t)
+					self.session.nav.RecordTimer.saveTimer()
			self.refill()

	def runningEventCallback(self, t, result):
		if result is not None and t.isRunning():
			findNextRunningEvent = True
			if result[1] == "stoponlycurrent" or result[1] == "stopall":
				findNextRunningEvent = False
				t.enable()
				t.processRepeated(findRunningEvent=False)
				self.session.nav.RecordTimer.doActivate(t)
			if result[1] == "stoponlycoming" or result[1] == "stopall":
				findNextRunningEvent = True
				t.disable()
			self.session.nav.RecordTimer.timeChanged(t)
+			self.session.nav.RecordTimer.saveTimer()
			t.findRunningEvent = findNextRunningEvent
			self.refill()

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Not all changes in timers are saved immediately #13 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 7 December 2023 - 07:01

Yes exactly something like that. Please create a merge request.

Edited by littlesat, 7 December 2023 - 07:02.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #14 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 8 December 2023 - 16:52

Littlesat, I've changed language to English and the first screen timers name is "Timer overview". Is this one you name timeredit ?

 

And the second where me can modify a timer, his name is Timer entry. In this one, the modifications are immediately saved.

 

Effectively, it would be well the modifications in the first screen were saved :D  .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #15 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 8 December 2023 - 19:25

I’m waiting for a merge request from dimitrij as his code suggestion most likely will resolve it.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #16 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 9 December 2023 - 15:28

OK, thank you Dimitrij and littlesat :D  .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2


Re: Not all changes in timers are saved immediately #17 Dimitrij

  • PLi® Core member
  • 10,299 posts

+347
Excellent

Posted 10 December 2023 - 12:17

 


GigaBlue UHD Quad 4K /Lunix3-4K/Duo 4K


Re: Not all changes in timers are saved immediately #18 littlesat

  • PLi® Core member
  • 57,120 posts

+698
Excellent

Posted 10 December 2023 - 14:05

Merged..

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Not all changes in timers are saved immediately #19 sjlouis

  • Senior Member
  • 1,573 posts

+3
Neutral

Posted 10 December 2023 - 14:07

OK, thank you :) .


Vu+ Ultimo 4K - OpenPli 8.3

Xtrend ET9200 - OpenPli 6.2



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users