Release WatchedList - service to automatically save/restore watched state
Thanks for the clarification. Then I would go for the following change in the database structure of my addon:
  1. create a new table, e.g. `tvshows_scrapers` with fields `id` (primary key), `tvshow_id` (referring to tvshows.idShow), `scraper_id` (referring to the value of uniqueid.xxxx, e.g. "10283", "110381"), `scraper_type` (referring to the fieldname of uniqueid.xxxx; e.g. "tmdb", "tvdb", "imdb", "unknown")
  2. Change addon class method sync_tvshows to get all uniqueid values for all tvshows and put them in the new table from above.
  3. The existing table `tvshows` now has an "idShow" which is just a primary key without reference to a scraper ID. The existing IDs do not have to be changed.
  4. The handling of watched episodes, e.g. in method get_episode_status, _wl_update_media has to be adapted for the new way of obtaining the tvshow ID.
  5. Upgrade mechanism for existing database files.
I think this should cover all cases, except when the TV show is rescraped and the new ID has no relation to the old ID (no two entries in "uniqueid").
Hopefully, most cases are rescraping which has a second ID making it possible to link the IDs (at least this is the case for my database). Metadata from external scrapers with "unknown" scraper type will continue to work.
Reply


Messages In This Thread
RE: WatchedList - service to automatically save/restore watched state - by schapplm - 2019-08-27, 08:41
Logout Mark Read Team Forum Stats Members Help
WatchedList - service to automatically save/restore watched state3