[XBOX] Auto Thumb Renamer
#1
This is just a silly little thing, but what the heck, someone might find it useful so I'm posting it.

A while back arnova was working on some special "patched builds" which, among other things, included an automatic video thumbnail generator for the Xbox builds (something other ports have had for a long time now).

Unfortunately he decided to scrap that feature, and thumbs those builds created can't be used with the main Xbox trunk because of the naming convention (they have the term "auto-" prefixed to their filenames).

Of course, I'm not about to give up my freshly gained thumbs in a hurry, but neither did I want to manually rename ~3000 files... Hence this script. Wink

Simply put, you take any video thumbs generated with the old "patched" builds, shove them in the UserData of the build you actually want to use, and run this from your scripts folder. Auto-genned thumbs will have their names fixed, or if this would cause a naming conflict, they'll simply be removed.

AutoThumbRenamer.py

Code:
import os, xbmcgui

paths = '0123456789abcdef'

for i in range(0, 16):
    os.chdir("t:\\Thumbnails\\Video\\"+paths[i])
    
    for filename in os.listdir(os.getcwd()):
        if filename[0:5] == 'auto-':
            if os.path.exists(os.getcwd()+"\\"+filename[5:17]):
                os.remove(os.getcwd()+"\\"+filename)
            else:
                os.rename(os.getcwd()+"\\"+filename,os.getcwd()+"\\"+filename[5:17])

xbmcgui.Dialog().ok('Auto Thumb Renamer','All video thumbnails have been processed.')
XBMC Manual - BlackBolt - SVN Guide - Skin SVN - Wide Icon SVN - ROM Shortcut Generator
You're just jealous 'cause the voices only talk to me :P
Reply

Logout Mark Read Team Forum Stats Members Help
[XBOX] Auto Thumb Renamer0