[Request] Compiled Python Hash

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
cynicaljoy Offline
Junior Member
Posts: 24
Joined: Feb 2011
Reputation: 0
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

if __name__ == "__main__":
   print "%s" % getcrc(FILE_PATH)
find quote
Dobyken Offline
Fan
Posts: 559
Joined: Apr 2010
Reputation: 5
Location: Florida Gulf Coast
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:

Code:
from xbmchash import getcrc

if __name__ == "__main__":
   print "%s" % getcrc(FILE_PATH)

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 Online
Team-XBMC
Posts: 7,697
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #3
May i suggest:
PHP Code:
cachedthumb xbmc.getCacheThumbNamefilename 

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
[Image: fanarttv.png]
(This post was last modified: 2012-01-14 19:35 by Martijn.)
find quote
Dobyken Offline
Fan
Posts: 559
Joined: Apr 2010
Reputation: 5
Location: Florida Gulf Coast
Post: #4
[quote=Martijn]May i suggest:
PHP Code:
cachedthumb xbmc.getCacheThumbNamefilename 

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 Online
Team-XBMC
Posts: 7,697
Joined: Jul 2011
Reputation: 114
Location: Dawn of time
Post: #5
Dobyken Wrote:[quote=Martijn]May i suggest:
PHP Code:
cachedthumb xbmc.getCacheThumbNamefilename 

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.

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
[Image: fanarttv.png]
find quote
Dobyken Offline
Fan
Posts: 559
Joined: Apr 2010
Reputation: 5
Location: Florida Gulf Coast
Post: #6
Martijn Wrote:[quote=Dobyken]

Only inside XBMC using python script I think because you do 'import xbmc'

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