Thumbnail Cleaner

  • Im XBMC sammeln sich über die Zeit wirklich ne Unmenge an Thumbnails an.
    Gut die Hälfte davon sind Datenleichen.
    Um dem entgegenzuwirken gibt es eine kleine Javaanwendung .... den Thumbnailcleaner:

    Für Linux gibt es da auch einen Weg:
    http://forum.xbmc.org/showthread.php…7380#pid1007380

    Ich habe es noch nicht getestet ... aber im schlimmsten Fall würden ein Paar Thumbs gelöscht, die sich das XBMC dann halt neu generiert.
    Halte ich persönlich für verschmerzbar.
    Wie das Script mit dds-Grafiken umgeht, habe ich auch noch nicht rausgefunden.

    Zitat

    Details:

    • This script will delete unused thumbnails, fanart and textures in the userdata\Thumbnails directory.
    • It can be run in simulation mode if you'd like to test it.
    • It uses data from XBMC's video/music/texture databases, as well as the JSON-RPC interface to get a list of all thumbs that are still used by the libraries. Any thumbs that are no longer used are deleted.
    • Any auto-xxxxxx thumbnails will be deleted since XBMC will automatically re-create them if they are needed.
    • Written in Java. Tested in a Windows environment.

    Disclaimer:
    If you are not running in simulation mode, I recommend backing up your Thumbnails directory, in case something goes wrong, you can easily revert.
    This has only been tested when XBMC's language is set to English.

    Google-Code

  • Ist durchgelaufen und hat verdammt viel gelöscht:

    Code
    90,69% of the textures on the filesystem can be cleaned. There are 18380 total texture files, and 16669 can be cleaned.

    Für Linux muss die ThumbCleanerConfig.xml entsprechend angepasst werden, da die dortigen Pfade alle Windowsbasierend sind.
    Als Beispiel hier aus meiner Config:

    Code
    <XBMCDatabase>	
    <SQLite enabled="true">
    <VideoDBPath>/home/xbmc/.xbmc/userdata/Database/MyVideos60.db</VideoDBPath><!--Cannot be a UNC path. If the .db file is not local, map a drive to it-->
    <MusicDBPath>/home/xbmc/.xbmc/userdata/Database/MyMusic18.db</MusicDBPath><!--Cannot be a UNC path. If the .db file is not local, map a drive to it-->				
    </SQLite>

    Und das muss man dann entsprechend bei alle Pfadangaben ändern.
    Linuxuser müssen dann meist noch den HTTP-Port ändern.

    Alles im allem ne Menge an Daten aufgeräumt/gelöscht. Auch alte dds sind mit entfernt worden.
    Feines Script.

    Ob wirklich noch alles 100% in Ordnung ist, kann ich noch nichts sagen.
    Aber ich habe noch kein Problem feststellen können.

  • Hey, ist ja ne richtig geile Sache, nur leider will das bei mir nicht so ganz.

    Folgende Fehlermeldung kommt (OS ist: Ubuntu 10.04 64bit und XBMC Dharma):

    acid@xbmc-nettop:~$ java -jar /home/xbmc/XBMCThumbCleaner-v1.1/dist/XBMC.MyLibrary.jar /home/xbmc/XBMCThumbCleaner-v1.1/
    04/19/2012 04:57:35 PM INFO Init... Single instance = true
    Cannot determine base directory, please make sure you program is located at C:\XBMC.MyLibrary
    java.lang.Exception: Cannot find base directory from "/home/xbmc/XBMCThumbCleaner-v1.1/dist/XBMC.MyLibrary.jar"
    at utilities.Config.getBaseDirectory(Config.java:1159)
    at utilities.Config.<init>(Config.java:132)
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:54)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)
    04/19/2012 04:57:35 PM NOTICE Init... Base program dir = C:\XBMC.MyLibrary
    04/19/2012 04:57:35 PM WARNING Init... Warning: could not create current [definition='1','0']log[/definition] file at: C:\XBMC.MyLibrary\XBMC.ThumbCleaner.[definition='1','0']log[/definition]
    java.io.FileNotFoundException: C:\XBMC.MyLibrary\XBMC.ThumbCleaner.[definition='1','0']log[/definition] (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
    at java.io.FileWriter.<init>(FileWriter.java:107)
    at utilities.Config.<init>(Config.java:149)
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:54)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)

    04/19/2012 04:57:35 PM WARNING Init... Warning: could not create historical [definition='1','0']log[/definition] file at: C:\XBMC.MyLibrary\logs\XBMC.ThumbCleaner.2012-04-19.[definition='1','0']log[/definition]
    java.io.FileNotFoundException: C:\XBMC.MyLibrary\logs\XBMC.ThumbCleaner.2012-04-19.[definition='1','0']log[/definition] (Permission denied)
    at java.io.FileOutputStream.openAppend(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
    at java.io.FileWriter.<init>(FileWriter.java:107)
    at utilities.Config.<init>(Config.java:163)
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:54)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)

    04/19/2012 04:57:35 PM ERROR Init... Config file does not exits at: "C:\XBMC.MyLibrary/ThumbCleanerConfig.xml". Cannot continue.
    04/19/2012 04:57:35 PM INFO Init... General exception: java.lang.Exception: Failed to initialize...
    java.lang.Exception: Failed to initialize...
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:63)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)

    acid@xbmc-nettop:~$

    Der erwartete Programmpfad wundert mich ein wenig, in der xml finde ich einen passenden Eintrag nicht, wo kann ich das abändern ?

    ThumbCleaner liegt bei mir in: /home/xbmc/XBMCThumbCleaner-v1.1

    Hier mal meine .xml:

    [expander] <!--For support, see here: http://forum.xbmc.org/showthread.php?t=96097 -->
    <root>

    <!--Logging Levels: This controls how verbose the logs will be.
    Available Levels: ERROR, WARNING, NOTICE, INFO, DEBUG
    expiredays - optional attribute, default=30, Logs older than this many days will be deleted. -->
    <LoggingLevel expiredays="14">INFO</LoggingLevel>

    <!--ThumbnailDir - This is the directory where XBMC store its thumbs. It is named "Thumbnails" under your userdata folder.
    The location of the userdata directory differs if you are running in portable mode.
    If you need help finding your userdata folder, check you platform's FAQ here: http://wiki.xbmc.org/index.php?titl…ked_Questions-->
    <ThumbnailDir>/home/xbmc/.xbmc/userdata/Thumbnails</ThumbnailDir>

    <!--Simulation settings -->
    <Simulation>true</Simulation><!--If true, no thumbnails/fanart will be deleted, so the program can be tested -->
    <SpotCheck max="150">/home/xbmc/backup/ThumbCleaner</SpotCheck><!--If simulation is true, images that are believed to be no longer needed will be copied here (randomly, up to the max), so you can check and make sure they really should be deleted -->

    <!--
    Database config. Either MySQL or SQLLite can be used. One of these must be enabled for this program to work.
    Set enabled = true for the one you would like to use. If you don't know which to use, then use SQLLite as that is the XBMC default.
    -->
    <XBMCDatabase>
    <SQLite enabled="true">
    <VideoDBPath>/home/xbmc/.xbmc/userdata/Database/MyVideos60.db</VideoDBPath><!--Cannot be a UNC path. If the .db file is not local, map a drive to it-->
    <MusicDBPath>/home/xbmc/.xbmc/userdata/Database/MyMusic18.db</MusicDBPath><!--Cannot be a UNC path. If the .db file is not local, map a drive to it-->
    </SQLite>
    <MySQL enabled="true">
    <host>localhost</host><!--Name or IP address-->
    <VideoSchema>xbmc_video</VideoSchema>
    <MusicSchema>xbmc_music</MusicSchema>
    <username>xbmc</username>
    <password>xbmc</password>
    <port>3306</port>
    <CharacterSet>latin1</CharacterSet><!--latin1 is default, and recommended. See here for details: http://forum.xbmc.org/showthread.php…tin1#post576974 -->
    </MySQL>
    </XBMCDatabase>

    <!--
    JSONRPC - JSON-RPC API connectivity is required for this program to work. It is built into XBMC's Dharma release.
    XBMCName - The Name or IP Address of the XBMC instance to connect to. XBMC must be running in order for the JSON-RPC API to work.
    method - The method used to connect to JSON-RPC, either Raw or Curl
    Raw -Uses Raw TCP/IP "telnet" type of an interface.
    -Recommended method.
    -Uses TCP port 9090 (not configurable).
    -Faster than Curl.
    -Requires going to XBMC's Settings, Network, Services, and checking "Allow Programs on this/others systems to control XBMC"
    Curl -Uses Curl to communicate with XBMC's Webserver (currenlty only Windows is supported for Curl)
    -Much slower than Raw method, but is available if you experience trouble with the Raw method.
    -Requires going to Settings, Network, Services, and checking "Allow control of XBMC via HTTP" and setting the Port/Username/Password you desire.
    <port> - The XBMC Webserver port
    <username> - The XBMC Webserver username, default none
    <password> - The XBMC Webserver password, default none
    -->
    <JSONRPC>
    <XBMCName>localhost</XBMCName><!--Either name or ip, address of the XBMC instance that is having it's thumbs cleaned up. (XBMC must be running here). -->
    <method>Raw</method> <!--Either Raw or Curl -->

    <!--These options are only used if Curl is specified as the method-->
    <port>80</port>
    <username></username>
    <password></password>
    </JSONRPC>

    <!--
    XBMCTextures - Texture cleanup configuration
    Textures are the images in the Thumbnails\[0-f] folders. They are stored in a SQLite Database named Textures.db.
    Specify the path to the SQLite textures database, and specify the thresholds to use to determine which textures should be cleaned.
    -->
    <XBMCTextures>
    <TextureDBPath>/home/xbmc/.xbmc/userdata/Database/Textures.db</TextureDBPath><!--Cannot be a UNC path. If the .db file is not local, map a drive to it-->

    <!--Configure the thresholds for deleting textures. If you don't know what to use, the defaults of 21 days or 2 uses should be OK -->
    <LastUsedThresholdDays>21.0</LastUsedThresholdDays><!-- Clean textures that have NOT been used by XBMC in the past X many days. Set to 0.0 to disable. -->
    <AndOr>OR</AndOr><!-- If "and", then the texture will be deleted only if it exceeds both thresholds.
    If "or", then the texture will be deleted if it exeeds either threshold -->
    <UseCountThreshold>2</UseCountThreshold><!-- Clean textures that have been used LESS THAN this many times. Set to 0 to disable -->
    </XBMCTextures>

    <!--
    ConfirmPathExist
    This can be used to find even more images that should be deleted. This will delete images if their corresponding media file no longer exists.
    XBMC can be bad at cleaning out old file entries from the database, this setting will circumvent that problem by checking if the file actually exists.
    You should only set this to true if:
    You regularily use the clean function on XBMC's library.
    You are running this program on Windows, and on the same computer than XBMC is on (so the filepaths match XBMC's paths).
    -->
    <ConfirmPathsExist>false</ConfirmPathsExist>
    </root>[/expander]

    Dell Inspiron 1564 Notebook - Ubuntu MATE 16.04 - ATOM NAS 20TB Lubuntu 16.04

    ASRock ION 330-BD - LibreELEC - Kodi Krypton | Ubuntufiziert since 2009

  • hm, das funktioniert leider auch nicht.

    Er verlangt das Programm immer auf C:\

    [expander]acid@xbmc-nettop:~$ java -jar /home/xbmc/XBMCThumbCleaner-v1.1/dist/XBMC.MyLibrary.jar /home/xbmc/XBMCThumbCleaner-v1.1/
    04/20/2012 11:55:10 AM INFO Init... Single instance = true
    Cannot determine base directory, please make sure you program is located at C:\XBMC.MyLibrary
    java.lang.Exception: Cannot find base directory from "/home/xbmc/XBMCThumbCleaner-v1.1/dist/XBMC.MyLibrary.jar"
    at utilities.Config.getBaseDirectory(Config.java:1159)
    at utilities.Config.<init>(Config.java:132)
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:54)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)
    04/20/2012 11:55:10 AM NOTICE Init... Base program dir = C:\XBMC.MyLibrary
    04/20/2012 11:55:10 AM WARNING Init... Warning: could not create current [definition='1','0']log[/definition] file at: C:\XBMC.MyLibrary\XBMC.ThumbCleaner.[definition='1','0']log[/definition]
    java.io.FileNotFoundException: C:\XBMC.MyLibrary\XBMC.ThumbCleaner.[definition='1','0']log[/definition] (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
    at java.io.FileWriter.<init>(FileWriter.java:107)
    at utilities.Config.<init>(Config.java:149)
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:54)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)

    04/20/2012 11:55:10 AM ERROR Init... Config file does not exits at: "C:\XBMC.MyLibrary/ThumbCleanerConfig.xml". Cannot continue.
    04/20/2012 11:55:10 AM INFO Init... General exception: java.lang.Exception: Failed to initialize...
    java.lang.Exception: Failed to initialize...
    at mylibrary.ThumbCleaner.<init>(ThumbCleaner.java:63)
    at mylibrary.ThumbCleaner.main(ThumbCleaner.java:18)

    acid@xbmc-nettop:~$[/expander]

    Dell Inspiron 1564 Notebook - Ubuntu MATE 16.04 - ATOM NAS 20TB Lubuntu 16.04

    ASRock ION 330-BD - LibreELEC - Kodi Krypton | Ubuntufiziert since 2009

  • so sieht meine aus:

    [expander]

    [/expander]

  • Die ersten Zeilen bei der Ausgabe:

  • hm, du verwendest v1.2, ich 1.1. Vermute das es daran liegt.

    Leider gibt es 1.2 nicht mehr für Dharma.

    Dell Inspiron 1564 Notebook - Ubuntu MATE 16.04 - ATOM NAS 20TB Lubuntu 16.04

    ASRock ION 330-BD - LibreELEC - Kodi Krypton | Ubuntufiziert since 2009

  • Hallo Liebe Gemeinde .....

    ich habe das Tool nun auch mal getestet mit Win7 mit NAS & MYSQL ... muss sagen bin ueberrascht wieviel Leichen er findet.
    hatte erst alles neu gemacht inc. Datenbank ... und er hat Muell gefunden .. aber im allem, ein geniales Tool.
    Kann ich jedem empfehlen.

    hier mal mein Log

    http://pastebin.com/uyWnMci3


    Habe es auch nur simuliert, stelle es aber nun richtig ei, dass er auch loescht
    Einige Meldungen sind wie zb.


    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra Generating CRC hashs from Movies
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra 399 valid CRC hashs have now been found
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra Generating CRC hashs from Movie paths/folders
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra 1995 valid CRC hashs have now been found
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra Generating CRC hashs from TV Episodes
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra 1995 valid CRC hashs have now been found
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra Generating CRC hashs from TV Shows and Seasons
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra 1995 valid CRC hashs have now been found
    04/27/2012 04:47:52 AM INFO MySQL:VideoLibra Generating CRC hashs from Actors

    Vielleicht kann mir jemand sagen was es bedeuted.
    Im grossen und ganzen Total files SIMLUATED deleted = 3248 images totaling 269 MB fuer ein frisches System :) hahahahha

    EDIT: 04/27/2012 04:47:59 AM INFO JSON-RPC:Video No music videos were found in XBMC's library. ( Habe 4 Alben warum findet er die nicht ?? )

    Gruss

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!