Feedback on first script -- check for unscraped video files - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Feedback on first script -- check for unscraped video files (/showthread.php?tid=95881) |
Feedback on first script -- check for unscraped video files - ktownhero - 2011-03-04 Hi there, I wrote my first script as a learning experience for Python and so far it's been a GREAT tool for learning. Right now it is just designed to be run from a command line or from the interpreter because the results simply get printed on screen. This script is for XBMC users. It essentially provides the tools to compare the video files that you have in a particular folder with what is stored in the XBMC database, and lets you know if anything is missing. It identifies unscraped files. Right now, it works as advertised but I am not sure if it will work with a network path i.e., Samba. Will os.walk(//samba/path) work? I also don't have anything built in to identify and/or correct errors. I would greatly appreciate any feedback and/or testing that people could provide. It is in a very basic form, only uses two quick GUI elements to allow the user to select first the directory they want to check, and secondly the location of their XBMC database. My future goals with this app are as follows: -Make a singular GUI interface that looks something like this: [BOX TO PICK DIRECTORY ] [BOX TO IDENTIFY XBMC VIDEO DATABASE] [] .avi [] .mkv ...etc (checkboxes to select video types to look for) -Output results to a file -Identify the OS that you are on and have a default database location -Eventually turn it into an XBMC addon that will allow you to manually scrape the missing files Code: """Provides functions for comparing the XBMC video database against the - anarchintosh - 2011-03-04 nice, well written. i assume you have a backaground in coding? note, for sqlite you have to do this weird thing: PHP Code: try: - ktownhero - 2011-03-04 anarchintosh Wrote:nice, well written. i assume you have a backaground in coding? Thanks for the response. I sort of have a background in coding, meaning that I got pretty good with Basic and Pascal back in the day but I never really advanced beyond that. I tried learning C and Java a few times, but got lazy. At 31, I've now found my motivation! I will add that change to the import section, thank you. Right now I am just running it outside of XBMC, can something like this be ran directly through XBMC? I was assuming it would not. - giftie - 2011-03-04 There is no reason that it would not run in xbmc(just needing a little code changes, like the one above - sqlite3) You would also be able to drop the code for requesting database path, as it is fairly simple to get that from XBMC. - ktownhero - 2011-03-04 giftie Wrote:There is no reason that it would not run in xbmc(just needing a little code changes, like the one above - sqlite3) Very cool, thanks for letting me know. I assume that to get it to run properly in XBMC I'll have to ditch Tkinter and port it to the XBMC GUI packages? By the way, I did finally test this over a network path and os.walk() works fine. I'm going to set this up to output to a txt file, which will technically make it a basic release. I'd like to then port it to XBMC. Could you offer a hint on what you mean that it is easy to get the db_path from inside XBMC? I'm assuming there must be something in the xbmc python module that gives you this data? I would love to remove this step and simplify the app for the user. - jmarshall - 2011-03-05 os.walk() will only walk a network path if it sees the network path as local. It won't (for instance) walk a smb:// share path inside XBMC, as that's XBMC's internal protocol. And you can query the database over the json-rpc interface rather than directly via sqlite. Cheers, Jonathan - cuccuizzo - 2011-03-05 Just to let you know that someone already implemented this as a plugin. You may be interested... Missing Movie Plugin - ktownhero - 2011-03-05 cuccuizzo Wrote:Just to let you know that someone already implemented this as a plugin. You may be interested... Thanks for posting that, I wasn't aware at all. That will be useful sourcecode to learn from. This is more of a personal project than anything, just to learn python and learn the ins and outs of xbmc. |