2023-08-12, 01:51
(2023-08-12, 00:14)jepsizofye Wrote: i getting that, my alternatives turn into a massive side project just to avoid 2 small lines of code because theyre frowned on
i think the decision will be either it works this way, i can make it manual from settings or do away with it and allow people to add their own sources - im weighing them
Writing directly to the database can be a bit more work depending upon how flexible you want this to be. For instance I detect the version of Kodi and maintain a map to the underlying database file name. Then there is the MySQL support or not, which adds another layer of complexity for direct writes. I don't support MySQL with Mezzmo because there is no use case which would make sense but with KSCleaner I was asked to support both SQLite and MySQL.
Lastly, there is a question not just of database adds but also changes and deletions. I've seen folks with path tables of 2,000+ entries <sigh> . With my approach using Mezzmo to get the various addon files, scrape them and publish / sync them to Kodi, my path table has 4 entries in the video database (the parent and one for each media type: movies, tvshows and music videos) and gets cleaned / refreshed daily.
It gets down to how flexible you want your addon to be with various use cases. Given that you don't care about being in the Kodi repo you have a lot of flexibility on how you do this. You are welcome to any of my direct writing code.
Thanks,
Jeff