Cycling Fanart on "Movies" homepage in Frodo
#1
Hi ronie,

I just upgraded a second htpc to Frodo. I started out with no thumbs and I am letting it pull the thumbs from sources as needed

However, one thing I noticed is that in Frodo, there is no longer a fanart folder under Thumbnails and the fanart thumbs are sort of mixed in with all the other thumbs in the numbered folders.

How are we supposed to get cycling fanart on the homepage? I tried selecting the Thumbnails folder to no avail

Thanks
Reply
#2
Check Post: #715 http://forum.xbmc.org/showthread.php?tid=83643&page=18

Quote:yes, things changed in xbmc and due to this, you have to select a custom folder containing your fanart images.
you can use the artwork organizer script to create such a folder.
Reply
#3
Thanks PatK

It kinda sucks that you have to copy them to a new location. I already have gigabytes of artwork. Last thing I need is more space taken up by duplicates

And I guess as one adds more items to the library they will have to run the artwork downloader again to update
Reply
#4
(2012-12-20, 00:54)aptalca Wrote: Thanks PatK

It kinda sucks that you have to copy them to a new location. I already have gigabytes of artwork. Last thing I need is more space taken up by duplicates

And I guess as one adds more items to the library they will have to run the artwork downloader again to update

A while ago I wrote a shell script that creates symbolic links that point to the fanart images stored in userdata/Thumbnails folder. The reason I wrote this is because I did not want to duplicate the storage space by having duplicate copies of the fanart images. Take a look at the script and see if it meets your needs.

A couple of things to note:
  1. The script accesses MyVideos stored in the mysql database.
  2. The script will make sure that the symbolic links only point to unique fanart entries. It ignores duplicate fanart entries.
  3. The script randomly picks fanart entries to use.
  4. The script is written in shell script.
createFanartLinks.sh:
Code:
#!/bin/bash

# How many linked images to create.
maxCount=75

# Setup for MySQL Access
MySQL=/usr/local/mysql/bin/mysql
MySQLUser=xbmc
MySQLPassword=xbmc
MySQLHost=10.0.1.200
MySQLOptions="-s -h ${MySQLHost} -u ${MySQLUser} -p${MySQLPassword}"

# Define where the image links will be stored.
userDataPath=~/Library/'Application Support'/XBMC/userdata
dataBasePath=${userDataPath}/Database
thumbnailsPath=${userDataPath}/Thumbnails
fanartPath=${thumbnailsPath}/Video/Fanart

# Get the name of the MyVideos and Textures DBs.
MyVideosDB=`${MySQL} ${MySQLOptions} -e "show databases" | grep MyVideos | tail -n 1`
TexturesDB=`find "${dataBasePath}" -name 'Textures*.db' -print | tail -n 1`
MySQLOptions="${MySQLOptions} -D ${MyVideosDB}"

# Define the command that will be used to access art table entries in MyVideos DB.
MyVideosDbCmd="select url from art where media_type='movie' and type='fanart'"

# How many entries are there in the MyVideos DB.
dbCount=`${MySQL} ${MySQLOptions} -e "${MyVideosDbCmd}" | wc -l`
count=0

# Remove all previous linked fanart images.
mkdir -p "${fanartPath}"
cd "${fanartPath}"
rm -f *.*

#
# Function to check if an image is unique.
#
isImageUnique()
{
   # The name of the image to compare.
   imageName="$1"

   # Check if the image is unique in the directory.
   ls | while read nextImageName
   do
       # Compare the image to the next entry in the directory.
       cmp "${imageName}" "${nextImageName}" 2>&1 >/dev/null

       # If the image already exists (cmp returns 0), then the image is not unique.
       if [[ $? -eq 0 ]]
       then
           # Indicate that the image is not unique and break out of the loop.
           exit 1
       fi
    done

    # Is the image unique?
    return $?
}

# Create the linked image entries.
while [ $count -lt ${maxCount} ]
do
    # Get a random number in the range of 0..dbCount - 1.
    dbIndex=$(( RANDOM % ( dbCount - 1 ) ))

    # Get a URL entry from the MyVideos DB at dbIndex.
    url=`${MySQL} ${MySQLOptions} -e "${MyVideosDbCmd} limit 1 offset ${dbIndex}"`

    # Get the cachedUrl entry that directly pertains to the the MyVideos url.
    cachedUrl=`sqlite3 "${TexturesDB}" "select cachedurl from texture where url='${url}';"`

    # Get the linked image name.
    linkname=`basename ${cachedUrl}`
    cachedUrl=../../${cachedUrl}

    # Does the linked image name already exists?
    if [ ! -e ${linkname} ]
    then
        # Does the image already exist in the directory?
        isImageUnique ${cachedUrl}

        if [[ $? -eq 0 ]]
        then
            # Create a linked image that points to the actual image.
            ln -fs ${cachedUrl} ${linkname}

            # Keep track of how entries have been created.
            count=$(( count + 1 ))
        fi
    fi
done
Kodi 17, Transparency Skin
PogoPlug v4 running Arm Linux 4.4.63 as MySQL (mariadb) server.
Mac OS 10.12.5
2015 27" iMac 3.3 GHz Quad, 16GB RAM, 1TB SSD
2015 13" Macbook Pro, 8GB RAM, 256GB SSD
AppleTV 4 TV OS 10
Reply

Logout Mark Read Team Forum Stats Members Help
Cycling Fanart on "Movies" homepage in Frodo0