Code:
from xbmchash import getcrc
if __name__ == "__main__":
print "%s" % getcrc(FILE_PATH)
cynicaljoy
Junior Member Posts: 24 Joined: Feb 2011 Reputation: 0 |
2012-01-12 05:48
Post: #1
Something that could help myself and I'm sure others with their script development is to have a compiled python for the Hash. It would be cool if we could get a pyc that we could just use to do something like:
Code: from xbmchash import getcrc |
| find quote |
Dobyken
Fan Posts: 559 Joined: Apr 2010 Reputation: 5 Location: Florida Gulf Coast |
2012-01-14 17:23
Post: #2
cynicaljoy Wrote:Something that could help myself and I'm sure others with their script development is to have a compiled python for the Hash. It would be cool if we could get a pyc that we could just use to do something like: This is what I used. Just unzip the file below and play. Since it thinks its a number it strips any leading zeros which is fixed in the length calc below. http://s000.tinyupload.com/?file_id=3867...7384159135 # Change TV Show thumb newcrcname = strPath oldcrcname = RecordPath newcrc = getCrc(newcrcname) if len(newcrc) == 7: newcrc ="0%s"%newcrc oldcrc = getCrc(oldcrcname) if len(oldcrc) == 7: oldcrc = "0%s"%oldcrc if oldcrc !='' and newcrc !='': setHash(oldcrc,newcrc,oldcrcname) Mythbuntu doesn't need viruses - we have Sudo |
| find quote |
Martijn
Team-XBMC Joined: Jul 2011 Reputation: 114 Location: Dawn of time |
2012-01-14 19:31
Post: #3
May i suggest:
PHP Code: cachedthumb = xbmc.getCacheThumbName( filename ) It gives you the CRC name of the filename you put in. Used in: https://github.com/paddycarey/script.art...fileops.py (line 82 and down) Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules. For troubleshooting and bug reporting, make sure you read this first For your mediacenter artwork go to ![]()
(This post was last modified: 2012-01-14 19:35 by Martijn.)
|
| find quote |
Dobyken
Fan Posts: 559 Joined: Apr 2010 Reputation: 5 Location: Florida Gulf Coast |
2012-01-14 20:11
Post: #4
[quote=Martijn]May i suggest:
PHP Code: cachedthumb = xbmc.getCacheThumbName( filename ) It gives you the CRC name of the filename you put in. Can that be run outside of XBMC ? Is that run inside Python? I'm a VB type of guy so I hacked my way through it. Mythbuntu doesn't need viruses - we have Sudo |
| find quote |
Martijn
Team-XBMC Joined: Jul 2011 Reputation: 114 Location: Dawn of time |
2012-01-14 20:22
Post: #5
Dobyken Wrote:[quote=Martijn]May i suggest: Only inside XBMC using python script I think because you do 'import xbmc' Always read the XBMC online-manual, FAQ and search the forums before posting. Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules. For troubleshooting and bug reporting, make sure you read this first For your mediacenter artwork go to ![]() |
| find quote |
Dobyken
Fan Posts: 559 Joined: Apr 2010 Reputation: 5 Location: Florida Gulf Coast |
2012-01-14 21:01
Post: #6
Martijn Wrote:[quote=Dobyken] Thanks, That's what I thought. Software I did was outside XBMC and it took me hours of searching to find documentation on all the thumb cache calculations. I'm used to having activeX DLLs to work with that expose the functions. Mythbuntu doesn't need viruses - we have Sudo |
| find quote |