Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature: programming Timers with full date, not only day of the week #34

Open
bttfba opened this issue Jul 24, 2023 · 4 comments
Open

Comments

@bttfba
Copy link

bttfba commented Jul 24, 2023

This is a suggestion for a new feature.
It would be extremely useful, in some cases, to be able to set a timers at a specific time of a specific day, which is out of the coming week. It means the ability to set a timer, for example, for August 15, 2023, at 12:00 PM (Today is July 24th)
Currently it is not possible to do so, since it is only possible to set timers in the coming week (in the next seven days).
Basically, instead of choosing among MON, TUE, WED, ... SUN, it should be possible to choose any day from a "monthly calendar" view, then the stating time and the duration, as usual.
I don't know how difficult is this and whether or not the system has the needed resources, but it could be very useful sometime.
Thanks for your attention
Ciao
Fabio

@Heckie75
Copy link
Owner

Hi @bttfba ,

the idea to schedule specific dates is good. But it is also related to some major changes. I think that changes related to the scheduler are more or less easy. The advantage is probably to re-think the user interaction. In addition KODI doesn't seem to have a datepicker dialog yet. Therefore it must be developed from scratch.

Some thoughts for this moment:

  1. change timer object (new fields)
  2. change storage of settings (new fields)
  3. Refactor scheduler / timer classes (probably only apply method)
  4. Update all unit tests (oh my god!)
  5. develop datepicker dialog
  6. Refactor settings, i.e.
    • remove day / days options
    • introduce date field
    • introduce date selection button (action) which opens datepicker
    • introduce options for repetitions, i.e. weekly and others?
  7. new settings version, add migration
  8. Change context menu "quick timer" for epg, set specific date instead of weekday
  9. Change context menu "add timer" in epg, pre-select date, provide datepicker and repetition options
  10. Change context menu "add timer" in general

The next version will be 3.8.0 (see https://github.com/Heckie75/kodi-addon-timers/tree/script.timers.3.8.0) This requirement would be something for a major release (4.0.0). I don't have much time but I keep this requirement in mind.

Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- change timer object (new fields)
- change storage of settings (new fields)
- Refactor settings, i.e. days options, introduce date field and button which opens date dialog
- new settings version, add migration
Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- Change context menu "add timer" in epg, pre-select date, provide datepicker and repetition options
- Change context menu "quick timer" for epg, set specific date instead of weekday
- Change context menu "add timer" in general
Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 15, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 16, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 16, 2024
… the week

- Added preselection of outdated timers in delete dialog
@Heckie75
Copy link
Owner

Heckie75 commented Aug 17, 2024

Hi @bttfba,

I have spent almost two days of my holiday to develop this feature ;-) It was very challenging and almost blew my mind but still was fun! You can find an early version of it here: https://github.com/Heckie75/kodi-addon-timers/tree/script.timers.4.0.0 (see latest zip file)

I have already used it the last 2 days and it looks pretty promising. Of course I am going to test it in a long term. Especially it is required to test timers that are scheduled a few weeks ahead without restarting Kodi. Unit tests might not able to cover this 'real-world-scenario'.

It is also required to test combination of timers that are scheduled by weekday, weekly timers and timers that are scheduled by date. Here especially situations where timers overlap and interrupt.

Known limitations

  1. Concurrency detection when programming from context menu, e.g. EPG , in combination with weekly timers and timers by weekday does not work if timer is more than 7 days ahead. I don't expect that I'm going to improve this since timers work of course. The only thing is that user won't be asked which timer is more important.

  2. Timers that have been missed, e.g. since Kodi was not running, are not cleaned up automatically. However, outdated timers are preselected in dialog for easy deletion. I don't expect that I'm going to implemented more than this since from my POV it is good enough and very transparent. [edit] has been implemented and can be configured in settings. Default is that outdated timers will be cleaned up

Open tasks

  1. Write more unit tests esp. for timers by date, multi-week-scenarios
  2. Some refactoring seem to be necessary. I'm not 100% happy with the code. It is much more complex than before
  3. Maybe convert implicitly timers that are scheduled by weekday to timers scheduled by date (DONE)

I'm looking forward to your feedback!

@bttfba
Copy link
Author

bttfba commented Aug 17, 2024 via email

Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- implicitly convert timers that are scheduled by weekday to timers scheduled by date
- some refactoring
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 17, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
@Heckie75
Copy link
Owner

Note

There are 2 issues related to Kodi v21, so that addon does not work for PVR at all and settings dialog is broken, see

Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- change timer object (new fields)
- change storage of settings (new fields)
- Refactor settings, i.e. days options, introduce date field and button which opens date dialog
- new settings version, add migration
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- Change context menu "add timer" in epg, pre-select date, provide datepicker and repetition options
- Change context menu "quick timer" for epg, set specific date instead of weekday
- Change context menu "add timer" in general
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- Refactor scheduler / timer classes (probably only apply method)
- Changed concurrency logics
- Written and updated unit tests
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- Added preselection of outdated timers in delete dialog
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- implicitly convert timers that are scheduled by weekday to timers scheduled by date
- some refactoring
Heckie75 added a commit that referenced this issue Aug 18, 2024
… the week

- cleanup outdated timers at startup of Kodi
- Bugfixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants