script to copy movie folder.jpg to <folder>-poster.jpg
#1
All my movies were with folder.jpg files and is it since latest xbmc/kodi releases are looking for <folder>-poster.jpg I wrote a little script to run through and make copies where appropriate. Apologies if this can be done already in Ember - I couldn't work out it.

run by command prompt: python folder.jpg.renamer.py <main movie folder>

#!/usr/bin/python
# scans a given folder for all sub-folders
# if a folder.jpg in a sub-folder exists and <sub-folder>-poster.jpg doesn't exist
# then copy folder.jpg to <sub-folder>-poster.jpg

import sys
import os
import glob
import shutil

path = sys.argv[1] + "\\*\\folder.jpg"
print "scanning %s" % sys.argv[1]

folder_jpg_list = glob.glob(path)
for path_folder_jpg in folder_jpg_list:
# need to check if <sub-folder>-poster.jpg exists
components = path_folder_jpg.split("\\")
poster_jpg = path_folder_jpg.replace("folder.jpg", components[len(components)-2] + "-poster.jpg")
if os.path.isfile(poster_jpg) == False:
print "creating poster for %s" % components[len(components)-2]
shutil.copyfile(path_folder_jpg, poster_jpg)
Reply
#2
Bah, how do i get Ember to pick up on the new files?
Reply
#3
If you don't want use Kodi default filenames, you can set the custom filenames in Settings - Movies - Files and Sources - File Naming - Expert tab. After you have set the files use Tools - Reload all movies.

But the Kodi defaults are <filename>-imagetype.ext, also Kodi use stacked filesnames like "Avatar-poster.jpg" instead of "Avatar CD1-poster.jpg.

One way to change filenames from one system to another is adding non-default filenames to expert tab, use Tools - Relead all movies, then remove the expert filenames and enable only Kodi defaults. Now start a rewrite of all content with Tools - Rewrite movie content. Now Ember loads all already recognized content and save it with all enabled filenames. The inly thing you habe to do is manually cleaning the no longer wanted content.
Reply
#4
That worked a treat Dan.

Cheers
Reply

Logout Mark Read Team Forum Stats Members Help
script to copy movie folder.jpg to <folder>-poster.jpg0