Req Implement 'watched status' flag for .strm files
#1
So I wasn't sure on where it made most sense to post this (either here or in the general support forum), so apologies if this is not the best place. It's not 100% clear if this is a lack of feature, or simply a longstanding bug.

I heavily use .strm files with how I use Kodi, and have found that the "watched status" flag is not compatible with how .strm files are set up. The checkmark you see in the Kodi GUI when you watch something never toggles on with .strm files. It's a shame because .strm's are able to work like local library files in almost every other sense (support for metadata, cover art, summaries). There exists a three year old bug report on this matter, which can be found here: http://trac.kodi.tv/ticket/12763#no2 . At one point this feature/bug was set to be implemented in 13.0 over three years ago, but then got pushed to 'Future/Pending' limbo, where it has stayed for the past year and half.

But in reading the comments, it seems more like a limitation with how .strm files are treated more like playlists.

So my request is this: please allow for .strm files to be automatically flagged as 'watched' after watching the .strm is complete.

I would love to see some traction on a very overdue feature/bug.
Reply
#2
(2015-06-18, 19:21)Magic815 Wrote: So I wasn't sure on where it made most sense to post this (either here or in the general support forum), so apologies if this is not the best place. It's not 100% clear if this is a lack of feature, or simply a longstanding bug.

I heavily use .strm files with how I use Kodi, and have found that the "watched status" flag is not compatible with how .strm files are set up. The checkmark you see in the Kodi GUI when you watch something never toggles on with .strm files. It's a shame because .strm's are able to work like local library files in almost every other sense (support for metadata, cover art, summaries). There exists a three year old bug report on this matter, which can be found here: http://trac.kodi.tv/ticket/12763#no2 . It's a shame because at one point this feature/bug was set to be implemented in 13.0 over three years ago, but then got pushed to 'Future/Pending' limbo, where it has stayed for the past year and half.

But in reading the comments, it seems more like a limitation with how .strm files are treated more like playlists.

So my request is this: please allow for .strm files to be compatible with the watched status flag so that the GUI will properly show the checkmark when a .strm file is watched.

I would love to see some traction on a very overdue feature/bug.

Strms are playlists...

If you scrape the strms into kodi's library then watch flagging works as it should...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
(2015-06-18, 19:27)Lunatixz Wrote: Strms are playlists...

If you scrape the strms into kodi's library then watch flagging works as it should...

I guess I'm confused on the description of .strm files in the wiki. I don't see where it calls them playlists. http://kodi.wiki/view/Internet_video_and_audio_streams

Regardless, one of the major features of .strm files per that wiki entry is to simply allow various audio and video streams to exist within Kodi as if they are part of my Kodi local library. And that's exactly the case I'm using them in.

Can you clarify what you mean by scrape the .strm's into the library? In my usage, I believe I'm already doing that, but maybe I'm mistaken. I'm using a subscription list addon that interacts with the Pulsar addon. The subscription list addon properly creates .strm links within my local media folders, so it's all working as it should there. They're all getting properly scraped as if they are in my local library, as well. The issue is that if I watch one video source that has a local file it will flag as 'watched,' but then if I do the same thing for a file that is really just a .strm link, it will not flag as 'watched' when I finish watching it.

And per that Trac notice in my first post, I'm not alone in seeing this behavior. It has been reported countless times over the past three years. It definitely exists, and it's definitely a problem.

Does that clarify the situation?
Reply
#4
(2015-06-18, 19:44)Magic815 Wrote:
(2015-06-18, 19:27)Lunatixz Wrote: Strms are playlists...

If you scrape the strms into kodi's library then watch flagging works as it should...

I guess I'm confused on the description of .strm files in the wiki. I don't see where it calls them playlists. http://kodi.wiki/view/Internet_video_and_audio_streams

Regardless, one of the major features of .strm files per that wiki entry is to simply allow various audio and video streams to exist within Kodi as if they are part of my Kodi local library. And that's exactly the case I'm using them in.

Can you clarify what you mean by scrape the .strm's into the library? In my usage, I believe I'm already doing that, but maybe I'm mistaken. I'm using a subscription list addon that interacts with the Pulsar addon. The subscription list addon properly creates .strm links within my local media folders, so it's all working as it should there. They're all getting properly scraped as if they are in my local library, as well. The issue is that if I watch one video source that has a local file it will flag as 'watched,' but then if I do the same thing for a file that is really just a .strm link, it will not flag as 'watched' when I finish watching it.

And per that Trac notice in my first post, I'm not alone in seeing this behavior. It has been reported countless times over the past three years. It definitely exists, and it's definitely a problem.

Does that clarify the situation?

Let me clarify Big Grin

Strms are playlists!

XBMC/Kodi can recognize it as media... but it's a playlist.

If the strm has been scraped and added to Kodi's library... then watched flagging works...

This is and has been the case for many years...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
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
Reply
#6
(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

Well now I'm confused. I initially brought this up to the dev of the addon, and I was pointed to that Trac bug report about how .strm files aren't being flagged as watched.

It's clear that in my usage there is an issue somewhere. It's definitely not flagging them in the GUI. I'm trying to triple check that I've properly scraped these files per Lunatixz mentioned, but other than that I don't know who else to ask about this besides bothering the addon devs again.
Reply
#7
(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.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#8
(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 experience the same "problem" as TS. It is not the issue of marking it as watched/unwatched through the GUI.. It's that it does not automatically get marked watch after watching the video.

There was some talk that the videos inside a strm gets the watched flag but not the actual playlist thus not working correctly in this case.
May I assist in any type of logs/screenshots, as I would love to get this working as well.
Reply
#9
(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
Reply
#10
I'm referring to marking a strm as watched manually (which works)... not automatically marking after play...

I do believe the duration is the problem, but not because there is no duration... Kodis library has a duration for "scraped" strms, just not the correct one... it uses the "static" runtime, which may be different than the "actual" runtime.

From memory, if you let the movie play to the end shouldn't it be marked as watched? Also if you edit the watched % to flag at 75% watched; that should correct for the time difference.

I use strms daily and have never noticed a problem marking watched status, then again... I've made the aforementioned changes to compensate for what I believe to be the issue with strms...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#11
@enen - thanks for the detailed info. I'll forward that back to the addon devs and see what they say.

@Lunatixz - apologies, as I should've been more clear in my first post. I've been referring to the feature request of allowing .strm files to be marked automatically as watched after playing them. So are you saying that you've found that by editing the % to flag at 75%, it allows the .strms to be automatically marked as watched? I'll try that out.
Reply
#12
@Lunatixz, yes marking as watched manually works I assumed the op was mentioning automatically mark as watched after playback is complete. I don't know a thing about how kodi handles them internally though. Nice to know.

@magic I've read your post in the addon thread. I haven't said the issue is in the way the addon is coded. The code I quoted in the post above is a hack to allow plugins to mark library items as watched. It's not something it should be making by default...
Imho this will always be a no go for implementation in kodi itself. You're redirecting a strm to a plugin that then redirects to a file. There's no way to obtain the correct information when scrapping the .strm to the library...
Reply
#13
(2015-06-19, 15:04)enen92 Wrote: @Lunatixz, yes marking as watched manually works I assumed the op was mentioning automatically mark as watched after playback is complete. I don't know a thing about how kodi handles them internally though. Nice to know.

@magic I've read your post in the addon thread. I haven't said the issue is in the way the addon is coded. The code I quoted in the post above is a hack to allow plugins to mark library items as watched. It's not something it should be making by default...
Imho this will always be a no go for implementation in kodi itself. You're redirecting a strm to a plugin that then redirects to a file. There's no way to obtain the correct information when scrapping the .strm to the library...

@enen - apologies for paraphrasing you incorrectly in the addon thread.

So I'm still confused - in this scenario, is there a potential fix that either the Pulsar dev, or the subscription list dev could implement to work in this desired behavior? Could something along the lines of the code you posted above be useful for one of those devs? Or is this just a complete lost cause all around?
Reply
#14
Does the db track the file as plugin:// or as a file.strm? The plugin can set the playcount after playback, but the playcount would get set for the content playing, so the plugin://url and not for the file.strm.
Reply
#15
this issue remains unsolved .. at least for me. Is there a workaround? the code above could this be used ? any guidance on where and how please ?
Reply

Logout Mark Read Team Forum Stats Members Help
Implement 'watched status' flag for .strm files0