Page 1 of 1

How does XBMC calculate the CRC for .cut files?

Posted: Wed Aug 02, 2017 12:01 pm
by Rocky5
Im trying to workout the path used to calculate the CRC but no matter what I type in or set it as it never gets the value XBMC does when it caches the thumbnail.

I'm wanting to make a script that will do all the thumbnail generating instead of waiting for XBMC to do it on entering a window.

Code: Select all

if os.path.isdir( CUTFile_Path ):
	if CountList == 1:	pDialog.create( "Generating Thumbnails" )
	for Folders in sorted( os.listdir( Emulator_Path ) ):
		EmuFolder = os.path.join( CUTFile_Path, Folders ) + "\\"
		if os.path.isdir( EmuFolder ):
			for CUT_Files in sorted( glob.glob( EmuFolder + "*.cut" ) ):
				TBN_Files = CUT_Files[:-3] + "tbn"
				ThumbCache = xbmc.getCacheThumbName( CUT_Files )
				dialog.ok(CUT_Files,EmuFolder,ThumbCache[0] + "\\" + ThumbCache )

Re: How does XBMC calculate the CRC for .cut files?

Posted: Wed Aug 02, 2017 7:17 pm
by skatulskijean
I hope this can help https://forum.kodi.tv/showthread.php?tid=136877
Regards Jan

Re: How does XBMC calculate the CRC for .cut files?

Posted: Wed Aug 02, 2017 8:12 pm
by Rocky5
skatulskijean wrote: Wed Aug 02, 2017 7:17 pm I hope this can help https://forum.kodi.tv/showthread.php?tid=136877
Regards Jan
Cheers but that doesn't help.

I know how to get the crc its just for some reason cut files dont seem to work :/ xbe files work fine.


Got it, if the files are inide the XBMC root directory it used the damn special protocol :evil:
special://xbmc/_cuts/genesis/3 ninjas kick back.cut
here is the working code

Code: Select all

if os.path.isdir( CUTFile_Path ):
	if CountList == 1:	pDialog.create( "Generating Thumbnails" )
	for Folders in sorted( os.listdir( Emulator_Path ) ):
		EmuFolder = os.path.join( CUTFile_Path, Folders ) + "\\"
		if os.path.isdir( EmuFolder ):
			for CUT_Files in sorted( glob.glob( EmuFolder + "*.cut" ) ):
				if CUTFile_Path.startswith(Root_Directory):
					CUT_Files = CUT_Files.replace( Root_Directory,"special://xbmc/" )
					CUT_Files = CUT_Files.replace( "\\","/" ).lower()
				TBN_Files = CUT_Files[:-3] + "tbn"
				ThumbCache = xbmc.getCacheThumbName( CUT_Files )
				pDialog.update( ( CountList * 100 ) / len( TBN_Files ),"Scanning Games",TBN_Files,ThumbCache )
				if os.path.isfile( TBN_Files ):
					shutil.copy2( TBN_Files, Temp_Profile_Directory + ThumbCache[0] + "\\" + ThumbCache )
				CountList = CountList + 1
				
if os.path.isdir( ThumbDirectory ): shutil.rmtree( ThumbDirectory )
os.rename( Temp_Profile_Directory[:-1], Temp_Profile_Directory[:-5] + "Programs" )
pDialog.close()
dialog.ok( "Thumbnail Cleaner","","Process Complete" )