(2015-06-19, 04:16)Lunatixz Wrote: (2015-06-19, 00:14)enen92 Wrote: He's using plugin:// paths inside strms. They will not be marked as watched unless the plugin that is called makes it.
I don't know if using internet content they are marked as watched by Kodi, but if lunatixz says so I assume they are.
The feature request doesnt make sense for Kodi, youll be better suggesting this to the dev of the addon youre using
Now, I'm confused... strms with plugin:// paths can be marked as watched... as long as they are part of kodis library.
I should mention i'm using Mysql, maybe this wasn't implemented in sqlite?
I just tested before writing this post, and I can toggle watched stats for strms easily. Kodi's db picks up the playcount change.
I am positive it can't or at least it couldn't since I tried to do something similar long time ago. But decided to test.
Created a new folder and inside the folder created a file called "Birdman (2014).strm". Inside the stream, I added the path to a random youtube video, the first that appeared in youtube home page. In this case:
Quote:plugin://plugin.video.youtube?path=/root/video&action=play_video&videoid=1bE0Z8YeUGo
Added the folder as a source and file was scrapped into the library. Upon watching the video kodi is not toggling the playcount for this strm...which makes sense. Kodi redirects the playback to youtube plugin...the youtube plugin knows nothing about the fact it is being called from the library so, it doesn't mark any item in the library as watched. Also it makes sense cause since kodi is playing a strm file it knows nothing about the video it will play...no videoinfo, no duration, etc. A .strm file is not static...I can easily change its contents to point to any other video.
You're probably testing this with some plugin that does this onPlaybackstop probably using the jsonrpc. That being said, addon devs if they want to include any library functionalities should add that possibility in the addon code itself. Kodi is primarily focused on organizing a library of
local files...files it can access and retrieve information from. The fact you can scrape strm files to the library, is a plus, imho. Just not the main functionality.
You can also be playing a listitem well defined as movie or tvshow without any missing information and syncing this information with trakt. Trakt will of course mark the items as watched in the library if marked as watched in the website.
I think I still have here the code to mark items as watched in the library:
Code:
#Before executing the code below we need to know the movie original title (string variable originaltitle) and the year (string variable year). They can be obtained from the infolabels of the listitem. The code filters the database for items with the same original title and the same year, year-1 and year+1 to avoid errors identifying the media.
if xbmc.getCondVisibility('Library.HasContent(Movies)'):
print("Check if movie exists in library when marking as watched")
meta = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter":{"or": [{"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}, {"field": "year", "operator": "is", "value": "%s"}]}, "properties" : ["file"]}, "id": 1}' % (year, str(int(year)+1), str(int(year)-1)))
meta = unicode(meta, 'utf-8', errors='ignore')
meta = json.loads(meta)
meta = meta['result']['movies']
originaltitle = infolabels["originaltitle"]
cleaned_title= re.sub('[^-a-zA-Z0-9_.()\\\/ ]+', '', originaltitle)
meta = [i for i in meta if cleaned_title in i['file']][0]
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": {"movieid" : %s, "playcount" : 1 }, "id": 1 }' % str(meta['movieid']))
#Before executing the code below we need to know the tvshow originaltitle (var originaltitle), the episode and season (season and episode vars - both strings). They can be obtained from the infolabels of the listitem
if xbmc.getCondVisibility('Library.HasContent(TVShows)'):
print("Check if tvshow episode exists in library when marking as watched")
cleaned_title= re.sub('[^-a-zA-Z0-9_.()\\\/ ]+', '', originaltitle)
meta = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"filter":{"and": [{"field": "season", "operator": "is", "value": "%s"}, {"field": "episode", "operator": "is", "value": "%s"}]}, "properties": ["title", "plot", "votes", "rating", "writer", "firstaired", "playcount", "runtime", "director", "productioncode", "season", "episode", "originaltitle", "showtitle", "lastplayed", "fanart", "thumbnail", "file", "resume", "tvshowid", "dateadded", "uniqueid"]}, "id": 1}' % (season, episode))
meta = unicode(meta, 'utf-8', errors='ignore')
meta = json.loads(meta)
meta = meta['result']['episodes']
meta = [i for i in meta if cleaned_title in i['file']][0]
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.SetEpisodeDetails", "params": {"episodeid" : %s, "playcount" : 1 }, "id": 1 }' % str(meta['episodeid']))
Code is not mine so all credits should go to the developer of it.
Problem here is that the OP is using an external service to make the strm files and call pulsar. So the service he's using is basically a hack around pulsar to enable library support. I think pulsar is agnostic about any items in the library, as a result none will be marked as watched. The "mark as watched" code code be included in the service that creates the strm files but optimally should be part of pulsar itself.
Cheers