• 1
  • 119
  • 120
  • 121(current)
  • 122
  • 123
  • 197
[RELEASE] Texture Cache Maintenance utility
Have a "look" at one of the movies that has a problem using "texturecache.py jd movies <movie name>" - you should see the artwork listed for the respective artwork "types". Eg.:

Code:
$ ./texturecache.py jd movies avatar
[
  {
    "art": {
      "clearart": "image://nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-clearart.png/",
      "clearlogo": "image://nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-logo.png/",
      "fanart": "image://nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-fanart.jpg/",
      "poster": "image://nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-poster.jpg/"
    },
    "file": "nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip].m4v",
    "label": "Avatar",
    "movieid": 2126,
    "title": "Avatar"
  }
]

Now, I don't have any "banner" artwork but if I did then it would be listed above.

So from this you can see how the artwork is associated with movies. From here, artwork - including banners - are cached in the Texture Cache, which is another database (and folder) that is local to each client. Almost all artwork that is displayed to you in the Kodi GUI is coming from the Texture Cache.

You can search the texture cache for artwork using "texturecache.py s <url>", for example:
Code:
./texturecache.py s "nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-clearart.png"
014301|f/f6fd12f4.png|0562|1000|0002|2015-07-10 03:27:49|2015-07-10 04:27:48|nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-clearart.png
Matching row ids: 14301
confirms that the Avatar "clearart" image is present in the Texture Cache database (Textures13.db), and references a cached file named "f/f6fd12f4.png" - this file should be located in the .kodi/userdata/Thumbnails folder located on each Kodi client, and is the image you see in your Kodi GUI. If this cached file should ever go missing, that would explain odd texture cache behaviour.

"Odd texture cache behaviour" is most often caused by users that "share" a single Thumbnails folder between multiple Kodi clients using Path Substitution. Do not use Path Substitution to share Thumbnails folders - it's not intended for this purpose and will lead to apparently random issues when displaying artwork.

This script will ensure that the texture cache is synchronised with your media library ("texturecache.py c") and inform you of any uncached items that could not be cached (eg. original artwork is no longer available/accessible etc.) It can also detect and correct "integrity" issues within the Texture Cache, such as database entries where the associated cached artwork file no longer exists in the Thumbnails folder("texturecache.py Xd"), or deleted database entries where the cached artwork file remains present in the Thumbnails folder ("texturecache.py R").

So, when your banners disappear, start checking the basics by querying the media library and texture cache. Is the banner artwork type still correctly associated with the movie (and if not, you'll need to identify the process that is buggering things up). Is the banner artwork present in the cache (if not, why not - check the cache integrity with "Xd" and "R"). If it's not in the cache, is the original artwork still accessible?

If the banner remains associated, is available in the cache (and there are no "integrity" issues) yet the correct artwork is not being displayed (and you're not using Path Substitution for Thumbnails - or worse - Textures13.db) then it's almost certainly a skin issue (or possibly a core Kodi bug).

The best way to confirm if it's a skin issue is to test with stock Confluence - if the problem isn't seen in stock Confluence then it's nailed on to be a third-party skin issue.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
(2016-01-18, 07:25)Milhouse Wrote: Have a "look" at one of the movies that has a problem using "texturecache.py jd movies <movie name>" - you should see the artwork listed for the respective artwork "types". Eg.:

!!_W O W_!! Milhouse... thank you for taking the time to write such a remarkable tutorial ! Nod

(and, thanks for not shouting N00B-EEE Rofl)

As luck would have it, I manually repaired the final film banner just about the same time I got notified of this huge reply... HA-HA, what are the chances of that.

Nevertheless, I will study your advice and tinker away over the next few days.

Thank you for explaining kodi's internal architecture for image handling, it gives me better understanding of where to look when trouble arises.

OK... off to Github, and do a little python-ing Wink

Cheers
::  LibreELEC 9.2.6 RELEASE - Generic x86_64  ::  Intel 847 NUC  ::  KVR1333D3S9/4G  ::  Kingston SMS200S3/30G mSATA  ::  MS 1044 MCE keyboard  ::  GP-IR02BK remote  ::  Xonfluence  ::  10.9TiB on FreeNAS v11.3-U5 (RAID-Z2)  ::
Reply
(2016-01-18, 07:54)gjwAudio Wrote: Thank you for explaining kodi's internal architecture for image handling, it gives me better understanding of where to look when trouble arises.

No problem. Although it's a command-line tool which can be a bit scary, I like to think of this as essentially teaching a man to fish - once you more-or-less know how artwork is managed within Kodi, and have the tools to investigate (and even resolve problems) then artwork display issues are much easier to deal with by yourself.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
Milhouse, I am playing with your script and will no doubt break something very soon because I am a total noob at this stuff.

I am trying to update my imdb ratings. I have put in the command and getting an error back. I am really pushing the limit of what I understand here.

Code:
~/.config # python texturecache.py @imdb.fields.movies | ~/.config/texturecache.py set
Traceback (most recent call last):
  File "/storage/.config/texturecache.py", line 8432, in <module>
    main(sys.argv[1:])
  File "/storage/.config/texturecache.py", line 8344, in main
    setDetails_batch(dryRun=dryRun)
  File "/storage/.config/texturecache.py", line 6104, in setDetails_batch
    jdata = json.loads("".join(data))
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/__init__.py", line 338, in loads
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/decoder.py", line 366, in decode
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
ValueError: No JSON object could be decoded

Can you indicate where I am going wrong with this?
Reply
(2016-01-18, 15:43)lstar337 Wrote: Milhouse, I am playing with your script and will no doubt break something very soon because I am a total noob at this stuff.

I am trying to update my imdb ratings. I have put in the command and getting an error back. I am really pushing the limit of what I understand here.

Code:
~/.config # python texturecache.py @imdb.fields.movies | ~/.config/texturecache.py set
Traceback (most recent call last):
  File "/storage/.config/texturecache.py", line 8432, in <module>
    main(sys.argv[1:])
  File "/storage/.config/texturecache.py", line 8344, in main
    setDetails_batch(dryRun=dryRun)
  File "/storage/.config/texturecache.py", line 6104, in setDetails_batch
    jdata = json.loads("".join(data))
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/__init__.py", line 338, in loads
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/decoder.py", line 366, in decode
  File "/home/kodi/OpenELEC.tv/build.OpenELEC-WeTek_Core.arm-6.95.6/Python-2.7.10/.install_pkg/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
ValueError: No JSON object could be decoded

Can you indicate where I am going wrong with this?

Hey,

What do you get by running:
Code:
python texturecache.py @imdb.fields.movies
?
Image Image
Reply
(2016-01-18, 17:08)redglory Wrote: Hey,

What do you get by running:
Code:
python texturecache.py @imdb.fields.movies
?
Thanks for your reply.

I get this:

Code:
Version: 2.2.7

Usage: texturecache.py [s, S] <string> |
                       [x, X, f, F] [sql-filter] |
                       Xd |
                       d <id[id id]>] |
                       c [class [filter]] |
                       nc [class [filter]] |
                       lc [class] |
                       lnc [class] |
                       C class filter |
                       [j, J, jd, Jd, jr, Jr] class [filter] |
                       qa class [filter] |
                       qax class [filter] |
                       [p, P] |
                       [r, R] |
                       imdb movies [filter] |
                       purge hashed|unhashed|all pattern [pattern [pattern]] |
                       purgetest hashed|unhashed|all pattern [pattern [pattern]] |
                       fixurls |
                       remove mediatype libraryid |
                       watched class backup <filename> [filter] |
                       watched class restore <filename> [filter] |
                       duplicates |
                       set |
                       testset |
                       set class libraryid key1 value 1 [key2 value2...] |
                       missing class src-label [src-label]* |
                       ascan [path] |
                       vscan [path] |
                       aclean |
                       vclean |
                       sources [media] |
                       sources media [label] |
                       directory path |
                       rdirectory path |
                       readfile infile [outfile | -] |
                       notify title message [displaytime [image]] |
                       status [idleTime] |
                       monitor |
                       power <state> |
                       exec [params] |
                       execw [params] |
                       wake |
                       rbphdmi [seconds] |
                       stats [class]* |
                       input action* [parameter] |
                       screenshot |
                       volume [mute|unmute|#] |
                       stress-test view-type numitems [pause] [repeat] [cooldown] |
                       setsetting name value |
                       getsetting name |
                       getsettings [pattern] |
                       debugon |
                       debugoff |
                       play item [playerid] |
                       playw item [playerid] |
                       stop [playerid] |
                       pause [playerid] |
                       config |
                       version |
                       update |
                       fupdate
                       [@property=value ...]

  s          Search URL column for partial movie or TV show title. Case-insensitive.
  S          Same as "s" (search) but will validate cachedurl file exists, displaying only those that fail validation
  x          Extract details, using optional SQL filter
  X          Same as "x" (extract) but will validate cachedurl file exists, displaying only those that fail validation
  Xd         Same as "x" (extract) but will DELETE those rows for which no cachedurl file exists
  f          Same as x, but includes file summary (file count, accumulated file size)
  F          Same as f, but doesn't include database rows
  d          Delete rows with matching ids, along with associated cached images
  c          Re-cache missing artwork. Class can be movies, tags, sets, tvshows, artists, albums or songs.
  C          Re-cache artwork even when it exists. Class can be movies, tags, sets, tvshows, artists, albums or songs. Class and filter both mandatory unless allow.recacheall=yes.
  nc         Same as c, but don't actually cache anything (ie. see what is missing). Class can be movies, tags, sets, tvshows, artists, albums or songs.
  lc         Like c, but only for content added since the modification date of the file specficied in property lastrunfile
  lnc        Like nc, but only for content added since the modification date of the file specficied in property lastrunfile
  j          Query library by class (movies, tags, sets, tvshows, artists, albums or songs) with optional filter, return JSON results.
  J          Same as "j", but includes extra JSON audio/video fields as defined in properties file.
  jd, Jd     Functionality equivalent to j/J, but all URLs are decoded
  jr, Jr     Functionality equivalent to j/J, but all URLs are decoded and non-ASCII characters output (ie. "raw")
  qa         Run QA check on movies, tags and tvshows, identifying media with missing artwork or plots
  qax        Same as qa, but remove and rescan those media items with missing details.
             Configure with qa.zero.*, qa.blank.* and qa.art.* properties. Prefix field with ? to render warning only.
  p          Display files present in texture cache that don't exist in the media library
  P          Prune (automatically remove) cached items that don't exist in the media library
  r          Reverse search to identify "orphaned" Thumbnail files that are not present in the texture cache database
  R          Same as "r" (reverse search) but automatically deletes "orphaned" Thumbnail files
  imdb       Update IMDb fields (default: ratings and votes) on movies - pipe output into set to apply changes to media library. Specify alternate fields with @imdb.fields
  purge      Remove cached artwork with URLs containing specified patterns, with or without hash
  purgetest  Dry-run version of purge
  fixurls    Output new URLs for movies, sets and TV shows that have URLs containing both forward and backward slashes. Output suitable as stdin for set option
  remove     Remove a library item - specify type (movie, tvshow, episode or musicvideo) and libraryid
  watched    Backup or restore movies and tvshows watched status and restore points, to/from the specified text file
  duplicates List movies with multiple versions as determined by imdb number
  set        Set values on objects (movie, tvshow, episode, musicvideo, album, artist, song) eg. "set movie 312 art.fanart 'http://assets.fanart.tv/fanart/movies/19908/hdmovielogo/zombieland-5145e97ed73a4.png'"
  testset    Dry run version of set
  missing    Locate media files missing from the specified media library, matched against one or more source labels, eg. missing movies "My Movies"
  ascan      Scan entire audio library, or specific path
  vscan      Scan entire video library, or specific path
  aclean     Clean audio library
  vclean     Clean video library
  sources    List all sources, or sources for specific media type (video, music, pictures, files, programs) or label (eg. "My Movies")
  directory  Retrieve list of files in a specific directory (see sources)
  rdirectory Recursive version of directory
  readfile   Read contents of a remote file, writing output to stdout ("-", but not suitable for binary data) or the named file (suitable for binary data)
  notify     Send notification to Kodi GUI. Requires title and message arguments, with optional displaytime in milliseconds (default 5000) and image/icon location
  status     Display state of client - ScreenSaverActive, SystemIdle (default 600 seconds), active Player state etc.
  monitor    Display client event notifications as they occur
  power      Control power state of client, where state is one of suspend, hibernate, shutdown, reboot and exit
  wake       Wake (over LAN) the client corresponding to the MAC address specified by property network.mac
  exec       Execute specified addon, with optional parameters
  execw      Execute specified addon, with optional parameters and wait (although often wait has no effect)
  rbphdmi    Manage HDMI power saving on a Raspberry Pi by monitoring Screensaver notifications. Default power-off delay is 900 seconds after screensaver has started.
  stats      Output media library stats
  input      Send keyboard/remote control input to client, where action is back, left, right, up, down, executeaction, sendtext etc.
  volume     Set volume level 0-100, mute or unmute, or display current mute state and volume level
stress-test Stress GUI by walking over library items. View type: thumbnail, horizontal, vertical. Default pause 0.25, repeat 1, cooldown (in seconds) 0.
  screenshot Take a screen grab of the current display
  setsetting Set the value of the named setting, eg. 'setsetting locale.language English'
  getsetting Get the current value of the named setting, eg. 'getsetting locale.language'
getsettings View details of all settings, or those where pattern is contained within id, eg. 'getsettings debug' to view details of all debug-related settings
  debugon    Enable debugging
  debugoff   Disable debugging
  play       Play the specified item (on the specified player: null, default, #)
  playw      Play the specified item (on the specified player: null, default, #), and wait until playback ends
  stop       Stop playback of the specified player, or all currently active players
  pause      Toggle pause/playback of the specified player, or all currently active players

  config     Show current configuration
  version    Show current version and check for new version
  update     Update to new version (if available)

Valid media classes: addons, pvr.tv, pvr.radio, artists, albums, songs, movies, sets, tags, tvshows
Valid meta classes:  audio (artists + albums + songs) and video (movies + sets + tvshows) and all (audio + video + addons + pvr.tv + pvr.radio)
Meta classes can be used in place of media classes for: c/C/nc/lc/lnc/j/J/jd/Jd/qa/qax options.

SQL Filter fields:
  id, cachedurl, height, width, usecount, lastusetime, lasthashcheck, url
Which I believe is just a list of the standard instruction set. :/
Reply
(2016-01-18, 17:36)lstar337 Wrote:
(2016-01-18, 17:08)redglory Wrote: Hey,

What do you get by running:
Code:
python texturecache.py @imdb.fields.movies
?
Thanks for your reply.

I get this:

Code:
Version: 2.2.7

Usage: texturecache.py [s, S] <string> |
                       [x, X, f, F] [sql-filter] |
                       Xd |
                       d <id[id id]>] |
                       c [class [filter]] |
                       nc [class [filter]] |
                       lc [class] |
                       lnc [class] |
                       C class filter |
                       [j, J, jd, Jd, jr, Jr] class [filter] |
                       qa class [filter] |
                       qax class [filter] |
                       [p, P] |
                       [r, R] |
                       imdb movies [filter] |
                       purge hashed|unhashed|all pattern [pattern [pattern]] |
                       purgetest hashed|unhashed|all pattern [pattern [pattern]] |
                       fixurls |
                       remove mediatype libraryid |
                       watched class backup <filename> [filter] |
                       watched class restore <filename> [filter] |
                       duplicates |
                       set |
                       testset |
                       set class libraryid key1 value 1 [key2 value2...] |
                       missing class src-label [src-label]* |
                       ascan [path] |
                       vscan [path] |
                       aclean |
                       vclean |
                       sources [media] |
                       sources media [label] |
                       directory path |
                       rdirectory path |
                       readfile infile [outfile | -] |
                       notify title message [displaytime [image]] |
                       status [idleTime] |
                       monitor |
                       power <state> |
                       exec [params] |
                       execw [params] |
                       wake |
                       rbphdmi [seconds] |
                       stats [class]* |
                       input action* [parameter] |
                       screenshot |
                       volume [mute|unmute|#] |
                       stress-test view-type numitems [pause] [repeat] [cooldown] |
                       setsetting name value |
                       getsetting name |
                       getsettings [pattern] |
                       debugon |
                       debugoff |
                       play item [playerid] |
                       playw item [playerid] |
                       stop [playerid] |
                       pause [playerid] |
                       config |
                       version |
                       update |
                       fupdate
                       [@property=value ...]

  s          Search URL column for partial movie or TV show title. Case-insensitive.
  S          Same as "s" (search) but will validate cachedurl file exists, displaying only those that fail validation
  x          Extract details, using optional SQL filter
  X          Same as "x" (extract) but will validate cachedurl file exists, displaying only those that fail validation
  Xd         Same as "x" (extract) but will DELETE those rows for which no cachedurl file exists
  f          Same as x, but includes file summary (file count, accumulated file size)
  F          Same as f, but doesn't include database rows
  d          Delete rows with matching ids, along with associated cached images
  c          Re-cache missing artwork. Class can be movies, tags, sets, tvshows, artists, albums or songs.
  C          Re-cache artwork even when it exists. Class can be movies, tags, sets, tvshows, artists, albums or songs. Class and filter both mandatory unless allow.recacheall=yes.
  nc         Same as c, but don't actually cache anything (ie. see what is missing). Class can be movies, tags, sets, tvshows, artists, albums or songs.
  lc         Like c, but only for content added since the modification date of the file specficied in property lastrunfile
  lnc        Like nc, but only for content added since the modification date of the file specficied in property lastrunfile
  j          Query library by class (movies, tags, sets, tvshows, artists, albums or songs) with optional filter, return JSON results.
  J          Same as "j", but includes extra JSON audio/video fields as defined in properties file.
  jd, Jd     Functionality equivalent to j/J, but all URLs are decoded
  jr, Jr     Functionality equivalent to j/J, but all URLs are decoded and non-ASCII characters output (ie. "raw")
  qa         Run QA check on movies, tags and tvshows, identifying media with missing artwork or plots
  qax        Same as qa, but remove and rescan those media items with missing details.
             Configure with qa.zero.*, qa.blank.* and qa.art.* properties. Prefix field with ? to render warning only.
  p          Display files present in texture cache that don't exist in the media library
  P          Prune (automatically remove) cached items that don't exist in the media library
  r          Reverse search to identify "orphaned" Thumbnail files that are not present in the texture cache database
  R          Same as "r" (reverse search) but automatically deletes "orphaned" Thumbnail files
  imdb       Update IMDb fields (default: ratings and votes) on movies - pipe output into set to apply changes to media library. Specify alternate fields with @imdb.fields
  purge      Remove cached artwork with URLs containing specified patterns, with or without hash
  purgetest  Dry-run version of purge
  fixurls    Output new URLs for movies, sets and TV shows that have URLs containing both forward and backward slashes. Output suitable as stdin for set option
  remove     Remove a library item - specify type (movie, tvshow, episode or musicvideo) and libraryid
  watched    Backup or restore movies and tvshows watched status and restore points, to/from the specified text file
  duplicates List movies with multiple versions as determined by imdb number
  set        Set values on objects (movie, tvshow, episode, musicvideo, album, artist, song) eg. "set movie 312 art.fanart 'http://assets.fanart.tv/fanart/movies/19908/hdmovielogo/zombieland-5145e97ed73a4.png'"
  testset    Dry run version of set
  missing    Locate media files missing from the specified media library, matched against one or more source labels, eg. missing movies "My Movies"
  ascan      Scan entire audio library, or specific path
  vscan      Scan entire video library, or specific path
  aclean     Clean audio library
  vclean     Clean video library
  sources    List all sources, or sources for specific media type (video, music, pictures, files, programs) or label (eg. "My Movies")
  directory  Retrieve list of files in a specific directory (see sources)
  rdirectory Recursive version of directory
  readfile   Read contents of a remote file, writing output to stdout ("-", but not suitable for binary data) or the named file (suitable for binary data)
  notify     Send notification to Kodi GUI. Requires title and message arguments, with optional displaytime in milliseconds (default 5000) and image/icon location
  status     Display state of client - ScreenSaverActive, SystemIdle (default 600 seconds), active Player state etc.
  monitor    Display client event notifications as they occur
  power      Control power state of client, where state is one of suspend, hibernate, shutdown, reboot and exit
  wake       Wake (over LAN) the client corresponding to the MAC address specified by property network.mac
  exec       Execute specified addon, with optional parameters
  execw      Execute specified addon, with optional parameters and wait (although often wait has no effect)
  rbphdmi    Manage HDMI power saving on a Raspberry Pi by monitoring Screensaver notifications. Default power-off delay is 900 seconds after screensaver has started.
  stats      Output media library stats
  input      Send keyboard/remote control input to client, where action is back, left, right, up, down, executeaction, sendtext etc.
  volume     Set volume level 0-100, mute or unmute, or display current mute state and volume level
stress-test Stress GUI by walking over library items. View type: thumbnail, horizontal, vertical. Default pause 0.25, repeat 1, cooldown (in seconds) 0.
  screenshot Take a screen grab of the current display
  setsetting Set the value of the named setting, eg. 'setsetting locale.language English'
  getsetting Get the current value of the named setting, eg. 'getsetting locale.language'
getsettings View details of all settings, or those where pattern is contained within id, eg. 'getsettings debug' to view details of all debug-related settings
  debugon    Enable debugging
  debugoff   Disable debugging
  play       Play the specified item (on the specified player: null, default, #)
  playw      Play the specified item (on the specified player: null, default, #), and wait until playback ends
  stop       Stop playback of the specified player, or all currently active players
  pause      Toggle pause/playback of the specified player, or all currently active players

  config     Show current configuration
  version    Show current version and check for new version
  update     Update to new version (if available)

Valid media classes: addons, pvr.tv, pvr.radio, artists, albums, songs, movies, sets, tags, tvshows
Valid meta classes:  audio (artists + albums + songs) and video (movies + sets + tvshows) and all (audio + video + addons + pvr.tv + pvr.radio)
Meta classes can be used in place of media classes for: c/C/nc/lc/lnc/j/J/jd/Jd/qa/qax options.

SQL Filter fields:
  id, cachedurl, height, width, usecount, lastusetime, lasthashcheck, url
Which I believe is just a list of the standard instruction set. :/

You are using imdb script in a wrong way...

It should be:
Code:
python texturecache.py imdb movies [filter]
Image Image
Reply
Looks like I need to add "imdb tvshows" to the usage message.

@lstar337 - you need to call texturecache.py with the correct imdb options, you'll get the usage information when the script doesn't understand what you are trying to do.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
Hi Milhouse... Bangin' my Head on Banners here tonight Tongue

My guinea pig for this exercise is a movie ("Enron - The Smartest Guys in the Room (2005) [DVDRip].mkv").

Tonight I renamed the movie file, to add the DVDRip flag (the home-made banner initially displaying properly). Next I tried to play it from the MOVIES list, and the system gave the expected "no file found" error. Standard procedure.

I said yes to remove it from the library, and immediately re-scanned my MOVIES collection. When it came back, the movie played OK, but a text label showed instead of the banner.

So I checked with this:
Code:
./texturecache.py jd movies enron
[
  {
    "art": {
      "fanart": "image://http://image.tmdb.org/t/p/original/jkpTcreM7YOUF4RaDTgTAy9aMJZ.jpg/",
      "poster": "image://http://image.tmdb.org/t/p/original/d1oHF7nFAxC6X5ZNRn1SCSTJYDW.jpg/"
    },
    "file": "smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005) [DVDRip].mkv",
    "label": "Enron: The Smartest Guys in the Room",
    "movieid": 2209,
    "title": "Enron: The Smartest Guys in the Room"
  }
]
...and no banner file was identified.

Next I manually added it using the "Choose art" dialog, and text was replaced with the image. The script saw it too... (Wink)
Code:
./texturecache.py jd movies enron
[
  {
    "art": {
      "banner": "image://smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-banner.jpg/",
      "fanart": "image://http://image.tmdb.org/t/p/original/jkpTcreM7YOUF4RaDTgTAy9aMJZ.jpg/",
      "poster": "image://http://image.tmdb.org/t/p/original/d1oHF7nFAxC6X5ZNRn1SCSTJYDW.jpg/"
    },
    "file": "smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005) [DVDRip].mkv",
    "label": "Enron: The Smartest Guys in the Room",
    "movieid": 2209,
    "title": "Enron: The Smartest Guys in the Room"
  }
]
However, checking the database, I get this...
Code:
./texturecache.py s "smb://FREENAS/media/Movies/Enron - The Smartes
t Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-banner.jp
g/"
Matching row ids:
...and no rows have a matching entry.

I can't seem to get the script to cache the specific image into the database & Thumbnail folder... can this even be done ?

Gonna give it (and my sore head) a rest and press on when the sun is up !

Thanks for playing Wink
::  LibreELEC 9.2.6 RELEASE - Generic x86_64  ::  Intel 847 NUC  ::  KVR1333D3S9/4G  ::  Kingston SMS200S3/30G mSATA  ::  MS 1044 MCE keyboard  ::  GP-IR02BK remote  ::  Xonfluence  ::  10.9TiB on FreeNAS v11.3-U5 (RAID-Z2)  ::
Reply
@redglory & @Milhouse, thanks for your help. I got it all running and updated all my imdb ratings.

I would like to run this to add in missing certifications if possible, but I don't see a field for that in your list so I assume it's not possible.

Can this be used to fill in missing certifications?
Reply
I am trying to update ratings for TVShows, is it usual to get results like this:
Code:
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E03
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E04
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E05
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E06
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E07
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E08
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E09
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E10
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E12
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E11
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E13
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E01
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E02
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E03
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E04
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E05
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E06
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E07
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E08
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E09
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E10
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E11
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E12
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E13
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E14
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E15
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E16
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E17
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E18
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E19
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S02E20
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E01
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E02
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E03
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E05
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E04
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E06
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E07
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E08
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E09
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E10
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E11
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E13
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E12
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E15
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E14
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E16
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E17
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E18
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E19
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S03E20
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E01
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E02
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E03
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E04
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E05
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E06
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E07
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E08
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E09
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E10
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E11
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E12
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E13
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E14
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E15
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E16
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E17
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E18
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S04E19
?

I have looked it up on imdb and most of those episodes do have ratings, so I don't know why it would fail. :/
Reply
(2016-01-19, 11:39)gjwAudio Wrote: ...and no rows have a matching entry.
Try just searching for enron - this will give more results, but just work out which one is the banner (if the banner is found at all):
Code:
./texturecache.py s enron

If the banner isn't listed, then it means it's not in the cache - it will only be added to the cache when you try to display the banner. To confirm it's not in the cache, run:
Code:
./texturecache.py nc movies enron
which should list the banner as being "not in the cache".

To add it to the cache, run:
Code:
./texturecache.py c movies enron

If it says it couldn't download any artwork then that means Kodi couldn't access the artwork.

Once all the artwork is cached, repeat your search of the cache and you should find the banner is listed (as long as it was able to download it).

(2016-01-19, 11:39)gjwAudio Wrote: I can't seem to get the script to cache the specific image into the database & Thumbnail folder... can this even be done ?

Code:
./texturecache.py c movies

will cache all movie artwork that is defined in your media library.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
(2016-01-19, 12:24)lstar337 Wrote: @redglory & @Milhouse, thanks for your help. I got it all running and updated all my imdb ratings.

I would like to run this to add in missing certifications if possible, but I don't see a field for that in your list so I assume it's not possible.

Can this be used to fill in missing certifications?

Not really. There are certificate ratings on omdbapi.com, eg.:
Code:
{"Title":"Avatar","Year":"2009","Rated":"PG-13","Released":"18 Dec 2009","Runtime":"162 min","Genre":"Action, Adventure, Fantasy","Director":"James Cameron","Writer":"James Cameron","Actors":"Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang","Plot":"A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.","Language":"English, Spanish","Country":"USA, UK","Awards":"Won 3 Oscars. Another 76 wins & 114 nominations.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw@@._V1_SX300.jpg","Metascore":"83","imdbRating":"7.9","imdbVotes":"840,438","imdbID":"tt0499549","Type":"movie","Response":"True"}

but as the certifications you want are probably region specific (and OMDB only provides US certifications) I haven't bothered adding support as it's more trouble than it's worth.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
(2016-01-19, 13:26)lstar337 Wrote: I am trying to update ratings for TVShows, is it usual to get results like this:

Code:
Could not obtain OMDb details for [episode] Battlestar Galactica (2003) S01E04
...

I have looked it up on imdb and most of those episodes do have ratings, so I don't know why it would fail. :/

The 2003 Battlestar Galactica is a mini-series, with only 2 episodes. The TV series began airing in 2004. They're not the same thing.

Code:
{"Title":"Battlestar Galactica","Year":"2004–2009","Rated":"TV-14","Released":"14 Jan 2005","Runtime":"44 min","Genre":"Action, Adventure, Drama","Director":"N/A","Writer":"Glen A. Larson, Ronald D. Moore","Actors":"Edward James Olmos, Mary McDonnell, Jamie Bamber, James Callis","Plot":"When an old enemy, the Cylons, resurface and obliterate the 12 colonies, the crew of the aged Galactica protect a small civilian fleet - the last of humanity - as they journey toward the fabled 13th colony of Earth.","Language":"English","Country":"USA","Awards":"Won 3 Primetime Emmys. Another 32 wins & 76 nominations.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTc1NTg1MDk3NF5BMl5BanBnXkFtZTYwNDYyMjI3._V1_SX300.jpg","Metascore":"N/A","imdbRating":"8.8","imdbVotes":"114,192","imdbID":"tt0407362","Type":"series","Response":"True"}

If you need to change the year for your Battlestar Galactica TV series (as it's wrong) the easiest solution is to remap it when querying for imdb updates - add:
Code:
imdb.translate.tvyears = ^Battlestar Galactica=2004
to texturecache.cfg. This will then mean your "Battlestar Galactica" is queried with an air date of 2004 (the TV series) and not 2003 (the 2-episode mini series).

If that doesn't solve it, add "@logfile=tc.log" to your command line and send me a link to the the log file once you've uploaded it to somewhere like pastebin.com or xbmclogs.com.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
Thank you again Milhouse for answering my questions Blush

Today when I fired up kodi, the banner for Enron was immediately visible. Running the first query you suggested returns this:

Code:
./texturecache.py s enron
046932|4/4fc0aae1.png|0310|0800|0013|2016-01-19 07:00:03|                   |http://assets.fanart.tv/fanart/movies/13020/hdmovielogo/enron-the-smartest-guys-in-the-room-55e69d38a4ffc.png
049366|f/f023a233.jpg|0185|1000|0007|2016-01-20 01:42:11|2016-01-19 03:52:18|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-banner.jpg
049645|0/001124d0.jpg|0720|0480|0001|2016-01-19 07:00:04|2016-01-19 02:00:04|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/.actors/Peter_Coyote.jpg
049646|a/a08a011a.jpg|0600|0450|0001|2016-01-19 07:00:04|2016-01-19 02:00:04|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/.actors/Dick_Cheney.jpg
050344|4/447879fd.jpg|0067|0360|0002|2016-01-19 09:02:14|2016-01-19 03:52:15|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-banner.jpg/transform?size=thumb
050345|5/5597e990.png|0140|0360|0002|2016-01-19 09:02:14|2016-01-19 03:52:15|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-clearlogo.png/transform?size=thumb
050346|b/b8a1aa64.jpg|0360|0240|0002|2016-01-19 09:02:14|2016-01-19 03:52:15|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-poster.jpg/transform?size=thumb
050347|f/fca841d4.jpg|0203|0360|0001|2016-01-19 08:52:15|2016-01-19 03:52:15|smb://FREENAS/media/Movies/Enron - The Smartest Guys in the Room (2005)/Enron - The Smartest Guys in the Room (2005)-fanart.jpg/transform?size=thumb
Matching row ids: 46932 49366 49645 49646 50344 50345 50346 50347

Hmmmm... all present and accounted for.

SideQuestion: What do I add to the CFG file to have any ExtraThumbs or ExtraFanArt listed ?

(2016-01-20, 03:24)Milhouse Wrote: To add it to the cache, run:
Code:
./texturecache.py c movies enron

If it says it couldn't download any artwork then that means Kodi couldn't access the artwork.

OK, my understanding is fuzzy here - if the image only exists in the media folder with the movie (ie: no online source because it was manually created by me), does the script grab it from the folder -OR- is the caching/re-caching operation limited to internet-downloadable items only ?

(2016-01-20, 03:24)Milhouse Wrote:
Code:
./texturecache.py c movies

will cache all movie artwork that is defined in your media library.

Ahhhh... do you mean "all files named in the Textures database" -OR- "all the local files found within the media folders" ?

Last night I ran the "./texturecache.py c movies" command, and it did not seem to put my homemade banner into the cache. I then used the context menu to "Choose art' and select the banner... Is this the operation that finally wrote it into the database ? As you can tell, I'm struggling with what does - or does not - trigger the update.

FromAnotherAngle: I take it that if an image is NOT found in the Thumbnails folder, kodi CANNOT put it on the screen.

Many times I've had to repeat the "Choose art" steps for these homemade images, because something has knocked them out. I've made it a frequent practice to clean the library and export everything to local files.

Is it possible my homemade art is not being recorded in the local NFOs, and at some time in the future a re-scrape wipes it out from the database & Thumbnails folder ? (grasping at straws here Confused )

Thanks for insight & corrections.
::  LibreELEC 9.2.6 RELEASE - Generic x86_64  ::  Intel 847 NUC  ::  KVR1333D3S9/4G  ::  Kingston SMS200S3/30G mSATA  ::  MS 1044 MCE keyboard  ::  GP-IR02BK remote  ::  Xonfluence  ::  10.9TiB on FreeNAS v11.3-U5 (RAID-Z2)  ::
Reply
  • 1
  • 119
  • 120
  • 121(current)
  • 122
  • 123
  • 197

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17