Good questions...
- How could I save hundreds of lines? The part that writes the user bouquet file is only 20 lines. This plugin doesn't touch lamedb.
-> ABM etc. do parse the complete userbouquet and lamedb etc first... all of this code can be removed.
- How can Fastscan and Cablescan be considered plugins. They include c++ enigma code and can't be moved from one distro to another.
-> In C++ they add services to lamedb and the bouquets without 'poking' in files. They directly add the services/bouquets within e2. The same method can be used in python. It might be of course we need to swig additional functions... but as far I can see 'all is there'
- How can this plugin create a race condition? It just writes to its own user bouquet file, and with the plugin open what other process is it going to be racing against?
You can have two processes... one rights in the files and do a reload, while E2 is e.g. scanning in the background and make updates internally. When ABM is done it does reload the setting and then you may overwrite some changes.
- What is the difference between creating bouquet files on the STB and creating them with a settings editor and FTPing them to the STB? Both require a reload. Why would you consider creating them on the STB "poking around" and creating them on DBE not so. If there were a race condition it would exist for both.
Yes with a setting editor that writes via FTP (or something else) to /etc/enigma2 you actually have the same kind of issue. The settings editor does 'poke' around. And when you do e.g. at the same time a scan you can get a mess...
- OpenWebInterface is also a plugin that "pokes around" in settings files and does reloads. Is that not OK either?
-> Also the incorrect way to do it...
- What about RemoteChannelsStreamConvertor, or PLi's built in channels importer. Would you also consider that "poking around" in bouquets?
-> Also the incorrect way to do it...
- What functions does enigma use to create bouquet files that are available to Python plugins?
-> All functions required are available here https://github.com/O.../lib/dvb/db.cpp or better to review here https://github.com/O...op/lib/dvb/db.h
- How does the code duplicate any bouquet parsers? It does not read any bouquets.
For example here bouquets and lamedb are parsed... Actually all these code is already done and available in the source I mentioned above... So actually you duplicate code in python which is already available in c++... sorry that I did not go in further detail and just took this as example.
https://github.com/o...uquetsreader.py
- Is my code really unreadable, slow, and unstructured?
Yes.. actually you duplicate code.... and poke around... while you can directly add/remove services and bouquets in E2 and once adapted you can save all settings instead of doing a reload...
P.S. I understand that to make this better requires more time to investigate... but I'm convinced the end result will be less code (I think only for ABM > 300 lines removed) as you somehow can directly write found services into e2 without doing something like it is done now...
1. Force a save setting
2. Parse the settings
3. Adapt the settings for what is found with ABM
4. Reload the settings...
With my suggestions you can do...
3. Adapt the settings for what is found with ABM
4. Save the settings (just to keep them when e2 crashes or the box is hardly plugged out)
I hope it is somehow clear now...
Then additionally there is a separate .so to parse the streams... when something general could be added in E2 that can be used by plugins etc... with nice functions to access them then the .so is not required anymore... Might also be nice...
Edited by littlesat, 21 May 2019 - 15:16.