Mark as Watched - MyVideos60.db and Files Table - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: Mark as Watched - MyVideos60.db and Files Table (/showthread.php?tid=130225)
Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-04-29 05:19
I'm hoping that a knowledgeable dev can help me out here. I have been trying my best to support the XBMCFlicks add-on community since Fekker (the dev) has been MIA. There was never a fully posted add-on for Eden, but he did leave a link back in January for a version that works pretty well for most intents and purposes.
The issue however is that the "togglewatched" and check marks for watched episodes don't seem to be properly working. I have done some research and poking around and to the best of my knowledge the watched flag for an episode is triggered by placing and entry into the MyVideos60.db file into the Files table. The files table has the following format:
So, if i watched a video called mymovie.avi there would be an entry added something along the following:
Pressing the "W" key in XBMC would also toggle that playCount between 0 and 1. If the playCount > 0 then the mark as watched checkbox is placed on that video.
The way that the XBMCFlicks plugin works is by creating .html files for every enumerated episode retrieved from a user's Netflix queue. It places these in the userdata\addon_data\plugin.video.xbmcflicks\links directory.
The behavior in both Dharma and Eden appears to be the same in how and where these link files get created. Also, it appears that when watching a movie (or pressing "W") the proper entry is placed into the MyVideos60.db. It would look like the following for a file called 81327919.html:
If a movie is watched, it seems that the checkbox gets placed next to the movie, but only as long as that window is open. If the window is closed (or XBMC restarted) the checkbox goes away. It is as if the entry is not being read out of the database.
I assume this problem is being caused by one of two things:
1) XBMC is not honoring the "html" extension for reading files out of the table.
2) The XBMCFlicks add-on is not properly reading the files out of the table.
I am hoping someone can point me in the right direction of what needs to happen here from a coding perspective. If it is a problem with the plugin I hope to be able to track it down...but I can see no direct references in the python as to how this information is enumerated out of the database...it seems as if this is normally something that XBMC takes care of and not the add-on.
Does anyone know if Eden introduced any behavioral changes here that might shed some light?
thanks very much
RE: Mark as Watched - MyVideos60.db and Files Table - jmarshall - 2012-04-29 06:34
I believe you'll find the problem is:
3) The bit that loads the watched details (GUIWindowVideoNav::LoadVideoInfo) doesn't retrieve the info for these items, as the items at that point are plugin:// URLs that *may* not correspond to the ones you're seeing in the listing?
Check the path table so that you know the full path for the files, then check what the XBMCflicks add-on is sending back with it's listing and compare the two.
RE: Mark as Watched - MyVideos60.db and Files Table - Bstrdsmkr - 2012-04-29 06:37
XBMC tracks the watched information based on the played url, not the file, which is causing your problem. There is currently no work around for file-based addons. Addons that use web urls directly can use script.module.metahandlers to "fake" it by keeping track of activity and setting the appropriate flags when the associated list items are displayed
RE: Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-04-29 18:27
Thanks for the responses guys...I have looked at the paths table in the database and it does fill-in some more of the process.
There is an entry in paths table as follows:
This gets created both in Dharma and Eden and appears to look the same.
And since the files table seems to reference this idPath above it would seem to me to be linking all the correct DB tables together.
So now I'm a little stuck on the statement "check what the XBMCflicks add-on is sending back with it's listing and compare the two."
If i didn't mention...I'm just a bit of a hacker trying to help out while the developer is MIA...I'm not sure what methods or calls would be used by an add-on to query the database in this fashion. Something has obviously changed in the way this is queried between Dharma and Eden, since it all worked fine in Dharma. I'm not sure at what point XBMC does the work vs what gets passed to the add-on. Can you provide maybe some details on the type of data structures I should be looking for in the code that would help me track down what the add-on is sending/retrieving? If the files/path table in the database is all that is used for this, then I think we are sending the right info...but perhaps not pulling it back out properly?
UPDATE: I did a bit more digging and it seems to me the only possible place that this add-on is interacting with the gui is simply through the
xbmcplugin.addDirectoryItem method. For instance:
xbmcplugin.addDirectoryItem(handle=int(sys.argv),url=url, listitem=li, isFolder=isFolder)
I dumped out the url that is getting passed there and it looks like this:
So I guess this is what you are saying re the plugin://.
I'm still not sure how to piece this together...as it worked pre-Eden, I'm still hoping for an explanation of what is it that is changed from Dharma to Eden in this regard to maybe help me focus on what might need to be fixed.
RE: Mark as Watched - MyVideos60.db and Files Table - jmarshall - 2012-04-30 01:12
Exactly, so what needs to happen is XBMC needs to store the watched status for the plugin:// URL.
My guess is because XBMC is not actually playing the "file" it's not running through the normal resolve stages, which thus is making the original URL be stored rather than the new one. I'm not sure how the plugin is hooking up the watched state anyway, as XBMC won't be doing it as the file isn't being played with it.
RE: Mark as Watched - MyVideos60.db and Files Table - Bstrdsmkr - 2012-04-30 01:28
Sort of a stab in the dark, but the name of the video database did change from Dharma->Eden so see if maybe the name of the database file is hard coded somewhere. I think the file name for Pre-Eden was MyVideos58.db
RE: Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-04-30 03:43
(2012-04-30 01:28)Bstrdsmkr Wrote: Sort of a stab in the dark, but the name of the video database did change from Dharma->Eden so see if maybe the name of the database file is hard coded somewhere. I think the file name for Pre-Eden was MyVideos58.db
You are correct...the DB name did change from 34 to 60...but there is no hard-coding in the plugin, I checked for that already :/
(2012-04-30 01:12)jmarshall Wrote: Exactly, so what needs to happen is XBMC needs to store the watched status for the plugin:// URL.
Johnathan - Would you be so kind as to just hold my hand a bid more as to what exactly needs to be stored? To re-iterate, there is an entry in Path table that looks like the following:
and an entry in Files that looks like:
This format gets stored the same way in both Dharma and Eden - but it seems to only be read back out in Dharma. I don't know if the plugin isn't reading it, or the type of call the plugin is making is no longer valid. I cant find anything in the code which indicates a read from the database. No one has really been clear on what has changed in Eden and why this would be broken in the move to Eden.
thanks again (for my ignorance)!
RE: Mark as Watched - MyVideos60.db and Files Table - fekker - 2012-05-05 04:55
Good info, wish i could add more to the topic, bengalih has already covered most things.
To display the items, I add them using
RE: Mark as Watched - MyVideos60.db and Files Table - jmarshall - 2012-05-05 05:58
The watched status will be stored using the URL that is present in the listing given back by the plugin.
Are you setting content on the folder when you return the listing? If not, that might be the problem. By the looks you want to set content to movies.
RE: Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-05-19 02:16
As far as setting the content to movies - is that something that must be done in the code, or can it also be done via the GUI? Can you point me to the applicable resources?
I hate to keep asking this, but since we can't seem to get this resolved, I would like to understand exactly what changed here between Eden and Dharma. It seems for the most part that the feedback we are getting is not version specific. Since everything worked fine in Dharma, I would like to know what mechanisms here changed in Eden that would have broken this.
Thanks again for your help
RE: Mark as Watched - MyVideos60.db and Files Table - jmarshall - 2012-05-20 06:59
list.setContent("movies") from the plugin.
RE: Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-05-22 01:59
Thanks again for the response jmarshall.
I am unable to find any information at all about the list.setContent command.
I have verified that throughout the script the following command is used:
For example here is the routine to enumerate the user's netflix instant queue:
This def calls upon the getUserInstantQueue def which in turn calls upon def getMovieDataFromFeed which will eventually add each item to the plugin menu with commands similar to:
I can only assume the setContent method of the xbmcplugin is the same as the list.setcontent you provided? The addDirectoryItem method is the only place in the code that I can see any interface being done directly with the library.
Once again, please excuse my ignorance on the subject...this is a much desired feature that has ceased to function since the upgrade to Eden, and many of the users of this plugin are itching to get it working again.
Perhaps there is more to the setcontent that I don't yet understand (that would have changed since Dharma) and that this is still the reason. Or perhaps there is another aspect that is causing this.
Is there any other guidance you can offer?
RE: Mark as Watched - MyVideos60.db and Files Table - bengalih - 2012-05-27 19:47
Looking at some other plugins (like funny or die) I see a completely different set of syntax being used.
Whereas in XBMCFlicks the strPath looks like this:
and the strFilename looks like:
In other plugins they are more similar to:
Now I realize that these other plugins don't write out external file links like XBMCFlicks does (or at least I don't believe them to), but I can't find any documentation that discussed the proper methods of adding and what any of this means.
I know that a lot of this code is beyond me, but I find it hard to believe that a plugin which worked fine in this regard in dharma now has the functionality completely broken in Eden with absolutely no documentation to describe what changes occurred and how to properly code for them.
Perhaps I am missing some important info, but after hours of scouring the web using the most common to most obscure terms I am still left with virtually no information about how all of this fits together.
I am hoping someone can at least craft me what the proper entry in the database should be. If I can hand edit a db entry which will properly reflect in the GUI for a watched episode, then I can go back to the code and look to having it write it there properly - but at this point I can't find any info on the proper syntactical entries.
once again, thanks for any assitance....
RE: Mark as Watched - MyVideos60.db and Files Table - Bstrdsmkr - 2012-05-27 20:28
Quote:plugin://plugin.video.funny.or.die/?url=11565f67bc&mode=2&name=The+King+Kaiser+Show+from+jeffhinare used to launch plugins which find the content again (based) on the parameters sent to them and then play the content.
Since xbmcflix plays through a browser, I would imagine that it's just saving the webpage to a file, then opening that file in a browser when called. If that's the case, and the url for a particular piece of content never changes, you just need to look that file up in the database and set the playcount higher than 1