(2023-08-09, 17:29)-Dis Wrote: (2023-08-03, 22:55)jepsizofye Wrote: Public development terminated due to lack of user interest.
Damn I was really interested in this plugin
I tried to do something similar to my Discovery+ add-on but it got really complex to deal with updating new episodes of tvshow to Kodi library.
this bridges functionality of a video addon which does not implement it, if you wanted to implement into your existing addon there are only a few requirements
the need for "medialibraryscanpath" in addon.xml
xml:
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>video</provides>
<medialibraryscanpath content="tvshows">/tvshows</medialibraryscanpath>
<medialibraryscanpath content="movies">/movies</medialibraryscanpath>
</extension>
the detection of path being accessed from your python code
only need to check sys.argv[0] for /tvshows or /movies and act accordingly, in my instance i split sys.argv[0] and check [-1], for an existing path - this would likely be similar to
default.py
python:
import sys
path = sys.argv[0].replace('plugin://','').split('/') # replace plugin:// in order to avoid extra params from the protocol being generated
if path[1]=='movies':
listMovies()
elif path[1]=='tvshows':
listShows(path)
def listShows(path):
if path[-1]=='tvshows':
#present parent listing
else:
#present listing of show in path[-1]
def listMovies():
#present parent movies listing
the sources component is telling Kodi your path's content type, scraper and scraper settings
i didn't find anything officially callable so i am inserting paths directly into the database
SQL:
INSERT INTO path (strPath, strContent, strScraper, strHash, scanRecursive, useFolderNames, strSettings, noUpdate, exclude) VALUES ("plugin://plugin.video.integrate/movies/", "movies", "metadata.themoviedb.org.python", 0, 0, 0, "", 0, 0)
INSERT INTO path (strPath, strContent, strScraper, strHash, scanRecursive, useFolderNames, strSettings, noUpdate, exclude) VALUES ("plugin://plugin.video.integrate/tvshows/", "tvshows", "metadata.tvshows.themoviedb.org.python", 0, 1, 0, "", 0, 0)
on initial imports i am using json rpc to call an update, only seems to work on the root parent paths not the individual sub folders for shows
javascript:
{"jsonrpc": "2.0", "method": "VideoLibrary.Scan","params":{"directory": "plugin://plugin.video.integrate/tvshows"}, "id": 1}
the listings are generic xbmcplugin.ListItem and getVideoInfoTag
episode listings need getVideoInfoTag.setSeason(int) and getVideoInfoTag.setEpisode(int) to be picked up
subsequent library updates happen normally outside the addon, kodi/tmdb updates everything from there