djp952 / pvr.hdhomerundvr

Unofficial Kodi HDHomeRun DVR PVR Client
https://github.com/djp952/pvr.hdhomerundvr/wiki
Other
58 stars 9 forks source link

Some HTTP requests are executed multiple times #33

Closed djp952 closed 5 years ago

djp952 commented 5 years ago

The way that some HTTP requests are being satisfied via a SQLite custom function is causing them to be executed multiple times. This is due to SQLite re-evaluating the result when that column is listed as part of a WHERE clause. The prime examples are the device and lineup discoveries, but there are other instances like when adding a recording rule the episode query is executed multiple times.

I haven't found a good solution for this yet, SQLite seems really set on re-evaluating the result of a column sourced from a deterministic custom function.

Listing this as a bug since I can't fix it at the moment. It's not the end of the world, but it wastes time and bandwidth for no good reason.

djp952 commented 5 years ago

The only information I could find on SQLite-users is an old thread regarding the same problem. Doesn't seem to be a very common or high-priority concern:

https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg89884.html

djp952 commented 5 years ago

Fixed in version 1.3.2 by giving up and using temp tables. There are only three places that this affected - HTTP-based device discovery, tuner lineup discovery, and episode discovery after adding a new recording rule. All seem to work fine after switching over to using the temp table(s)