Mark Folder plugin for Plex / add to database

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #1
I am a recent Apple convertie who got over from PC just recently, 1 year about. In windows I used a selfmade script (vbscript) to tag folders of which episodes I have been watching and it also sent the foldername to a database so I could keep track even if I deleted the episode from the disk. What the script did by a contextmenubutton was to change the icon of the folder by putting in a desktop.ini file in the folder telling it to display another icon (in this case a cross). Then it did a http-request to a site with the foldername as parameter for store in an Accessdatabase. I now wonder if I could make the same thing work but with a plugin for XBMC?

Basicaly what I want to do is a plugin that...

1. Lists folders within given SMB-shares
2. Check subfolders for desktop.ini file
a. if the file is there show a cross
b. if the folder is not there show a normal foldericon
3. Then there needs to be a shortcut/button/option to tag the folder after successfull watching

Tagging the folder should do the following

1. Create a desktop.ini file in the folder
2. Submit the foldername via HTTP-request


Is the above possible with XBMC's Plugin API or would I possibly need to make a webservice to serve as backend?

[Image: kryss.jpg]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,570
Joined: Oct 2003
Reputation: 138
Post: #2
Potentially this is possible I think, yes. First off you need to list the shares. Not sure the best way to go about this with smb - it may be easier to mount the drives using the OS so as far as python goes they're local.

Then it's just a basic matter of checking for the desktop.ini and setting the thumbnail appropriately.

Finally, adding a context menu item is doable for a plugin and you can create the file and send off your http request.

Note that you're on the forums for XBMC. Plex is a fork that has nothing to do with us other than that they use our code. Note that Plex has ditched our plugin API (or at least it's unsupported) so if you want to use that you'll have to ask over there.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #3
Yah, but i guess since there were no answers on plex forum and the fact that they're support for scripts are a bit limited I will instead go about using XBMC on both my MAC and my HTPC (windows 8). It's very nice to hear that this is indeed possible, I have no experience with python but then again it's a simple language so it should be doable...Thanks for your response you gave me hope and clear insight...I'll post it here when it's finished if someone else needs it or it could work as an example Wink
find quote
lloydsmart Offline
Member+
Posts: 306
Joined: Sep 2009
Reputation: 0
Location: UK
Post: #4
Windows 8? Do you work for Microsoft or something then? ;-)
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #5
Sure enough, referring to your nick, your smart enough to draw your own accurate conclusion Wink
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #6
I have been reading up and doing some testing tonight....New to python doesn't seem to pose any eminent harm at this time. Although I realised I have two ways to do this....Easy and hard....where as hard is beautiful.

1. (easy). Create a script that lists all folder from a webservice and gets all the info, icons and path to videofile. Then all there is left is to list foldercontents like any other script and add a B-button action to send the http-response and let the PHP-script there create the desktop.ini and tag the folder.

2. (hard). Do all the coding in python and skip the webservice alltogether except for submition of Watched Episode to database.


However I do wonder how to list XBMC array of current Sources and dump them in a container where as one can browser folders just like "Video" on the homescreen menu. Are there any examplescripts of this?

Gone through the whole vicki but found nothing of relevance...some hint / help would be appreciated.
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #7
Ok I got as far as listing all folders, making those with desktop.ini red and finally made it possible to play with filtering everything out but videofiles from the SMB-browser. Then I added two actions for A and B to play and mark.

However I do wonder how to get current list of SMB shares from the ones I add under Videos?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,570
Joined: Oct 2003
Reputation: 138
Post: #8
One option is to try and grab them via the jsonrpc interface perhaps? Nasty alternatives are loading sources.xml and parsing that yourself, though ofcourse that could break at any time should we decide to change the layout.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #9
Actualy this JSON-RPC can come in handy for other projects but as of now I really do consider using the least reliable version, ie parsing sources.xml. But I am quite confident that future versions of XBMC will brake scripts in some way so no matter what it is one has to update when that time comes. Thanks for the tip!
find quote
xayide Offline
Senior Member
Posts: 126
Joined: May 2010
Reputation: 0
Post: #10
I got another idea, maybe one could you http getshares from XBMC http api to get a list of shares then it will be a bit of coding to get multipath to work but I am eager to do that to...Wink

What ´do you guys think of that? Possible solution?
find quote
Post Reply