Kodi Community Forum

Full Version: [RELEASE] Video Fanart Splitter Script - Movie and TV Show FanArt Seperation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
primetime34 Wrote:Maybe I'm just being really dense...but I don't understand what this does and why someone would use it? I see a lot of people excited, but I just don't understand. BTW, I am running Aeon MQ2. Thanks for any help you can give me in understanding through my own denseness. Big Grin

some skins use your cached fanart folder to create a slideshow somewhere in the skin (home screen for instance).
also users can use that folder as a custom backgrounds folder.

the problem is, xbmc caches your tv shows and movies fanart in the same folder, so skins can't create a slideshow containing only your movie fanart.

this script will split tv shows and movies fanart into separate folders.
Delete
delete
ronie Wrote:some skins use your cached fanart folder to create a slideshow somewhere in the skin (home screen for instance).
also users can use that folder as a custom backgrounds folder.

the problem is, xbmc caches your tv shows and movies fanart in the same folder, so skins can't create a slideshow containing only your movie fanart.

this script will split tv shows and movies fanart into separate folders.

Gotcha....thank you so much. Big Grin
deleted
Hello, I've gotten the script to work and now have random fan art for both movies and tv shows. I appreciate all the help from previous posts, especially the one from ronie about the case-sensitive paths in default.py.

I am using the default folder of /userdata/addon_data/script.video-fanart-splitter/Movies. However, there are 250 files in the /Movies folder while the script tells me 280 movies have been processed. I also show 10 files in the /TV folder while the script tells me 11 TV shows have been processed.

Granted, I have 10 movies that do not have fan art but I'm still missing 20 movies and 1 TV show. At first I thought there may be a limit of 250 movies which I could understand from a speed/size limitation. But I can't imagine a limit of 10 TV shows.

Anyone have any ideas what could cause this on Ubuntu 11.04 and Dharma?
@skaymakca: the script is missing some code:

PHP Code:
xbmc.executehttpapi"SetResponseFormat()" )
xbmc.executehttpapi"SetResponseFormat(OpenRecord,%s)" % ( "<record>", ) )
xbmc.executehttpapi"SetResponseFormat(CloseRecord,%s)" % ( "</record>", ) ) 

as a result the script will fail if no other script has already set the response format.
Delete.
Can't seem to see any fanart in the resulting "Movies" and "TV" folder.

Here is my settings:
http://pastebin.com/LZ2NaxXU

And Here is my log from when I click the script:
http://pastebin.com/RMdAeCrM

Any help or suggestions would be appreciated.
lithiumc Wrote:Can't seem to see any fanart in the resulting "Movies" and "TV" folder.

Here is my settings:
http://pastebin.com/LZ2NaxXU

And Here is my log from when I click the script:
http://pastebin.com/RMdAeCrM

Any help or suggestions would be appreciated.

have you tried making the changes i mentioned on the last two pages?
Tried the Caps fix - no joy. It has to be something simple for me to get this to work. I had it working before, have no idea what I did to accomplish that. I'm running nightlies and T! SVN. Any help is really appreciated. Thanks Huh
Guess this is a dead horse? Sad
bobrap Wrote:Guess this is a dead horse? Sad

i've made some modifications to the script and it should work fine on nightlies:
http://transparency-xbmc.googlecode.com/...v0.2.5.zip

let me know if there's any issues. :-)
I managed to get this working by both fixing the thumbnail path and setting the response format. I've attached a patch against 0.2.0 (just missed the posting of ronie's update). Is there a git repository somewhere?

I don't see the ability to attach files, so here's the diff:

Code:
diff --git a/default.py b/default.py
index 916a52c..b4be6fb 100644
--- a/default.py
+++ b/default.py
@@ -51,9 +51,9 @@ if Output_Folder == "addon":
    if not os.path.isdir(xbmc.translatePath( "special://profile/addon_data/" )): os.mkdir(xbmc.translatePath( "special://profile/addon_data/" ))
    if not os.path.isdir(addon_work_folder): os.mkdir(addon_work_folder)    
elif Output_Folder == "thumbnails":
-    addon_work_folder = xbmc.translatePath("special://home/userdata/thumbnails/Custom/")
-    if not os.path.isdir(xbmc.translatePath("special://home/userdata/thumbnails/")): os.mkdir(xbmc.translatePath("special://home/userdata/thumbnails/"))
-    if not os.path.isdir(xbmc.translatePath("special://home/userdata/thumbnails/Custom/")): os.mkdir(xbmc.translatePath("special://home/userdata/thumbnails/Custom/"))
+    addon_work_folder = xbmc.translatePath("special://home/userdata/Thumbnails/Custom/")
+    if not os.path.isdir(xbmc.translatePath("special://home/userdata/Thumbnails/")): os.mkdir(xbmc.translatePath("special://home/userdata/Thumbnails/"))
+    if not os.path.isdir(xbmc.translatePath("special://home/userdata/Thumbnails/Custom/")): os.mkdir(xbmc.translatePath("special://home/userdata/Thumbnails/Custom/"))
elif Output_Folder == "custom":
    addon_work_folder = __settings__.getSetting("custom_dir")
    
@@ -64,6 +64,10 @@ os.mkdir(os.path.join(addon_work_folder, "TV"))
os.mkdir(os.path.join(addon_work_folder, "Movies"))

    
+xbmc.executehttpapi( "SetResponseFormat()" )
+xbmc.executehttpapi( "SetResponseFormat(OpenRecord,%s)" % ( "<record>", ) )
+xbmc.executehttpapi( "SetResponseFormat(CloseRecord,%s)" % ( "</record>", ) )
+
MoviesSource = urllib.urlopen("http://" + host_name + ":" + port_num + "/xbmcCmds/xbmcHttp?command=queryvideodatabase%28select%20strPath,%20strFileName%20from%20movieview%29")
temp = MoviesSource.readline()
MoviesRaw = MoviesSource.readline()[8:][:-10].split("</record><record>")
@@ -78,8 +82,8 @@ for cur_raw in MoviesRaw:
    each = getCrc(cur_raw.split("</field><field>")[0][7:] + cur_raw.split("</field><field>")[1][:-8])
    
    try:
-        if os.path.isfile(xbmc.translatePath("special://home/userdata/thumbnails/Video/Fanart/" + each + ".tbn")):
-                shutil.copyfile(xbmc.translatePath("special://home/userdata/thumbnails/Video/Fanart/" + each + ".tbn"), xbmc.translatePath(addon_work_folder + "/Movies/" + each + ".tbn"))
+        if os.path.isfile(xbmc.translatePath("special://home/userdata/Thumbnails/Video/Fanart/" + each + ".tbn")):
+                shutil.copyfile(xbmc.translatePath("special://home/userdata/Thumbnails/Video/Fanart/" + each + ".tbn"), xbmc.translatePath(addon_work_folder + "/Movies/" + each + ".tbn"))
    except IndexError:
        pass
            
@@ -91,8 +95,8 @@ for cur_path in TVPaths:
    each = getCrc(cur_path)
    
    try:
-        if os.path.isfile(xbmc.translatePath("special://home/userdata/thumbnails/Video/Fanart/" + each + ".tbn")):
-            shutil.copyfile(xbmc.translatePath("special://home/userdata/thumbnails/Video/Fanart/" + each + ".tbn"), xbmc.translatePath(addon_work_folder + "/TV/" + each + ".tbn"))
+        if os.path.isfile(xbmc.translatePath("special://home/userdata/Thumbnails/Video/Fanart/" + each + ".tbn")):
+            shutil.copyfile(xbmc.translatePath("special://home/userdata/Thumbnails/Video/Fanart/" + each + ".tbn"), xbmc.translatePath(addon_work_folder + "/TV/" + each + ".tbn"))
    except IndexError:
        pass
        
@@ -106,4 +110,5 @@ if display_mode == "progress":
    
if display_mode == "summary": xbmc.executebuiltin('Notification(Processed:,' + str(len(MoviesRaw)) + ' Movies & ' + str(len(TVPaths)) + ' TV shows)')
    
-print "Video Fanart Splitter Finished"
\ No newline at end of file
+print "Video Fanart Splitter Finished"
+
Worked like a champ. Thanks again, Ronie! Wink
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14