Release NFO Updater: Update video .NFO files based on XBMC playcount
#1
Hello,

This Video Add-on updates movie, tvshow and episode .NFO files based on XBMC database playcount values.

Download link: https://docs.google.com/uc?export=downlo...mw4NFhucEU

Purpose
XBMC can read local NFO files during a scan (and set the un/watched status if 'importwatchedstate=true' in advancedsettings.xml) but only writes them during a 'Library Export'.
Matching NFOs with XBMC is useful for: external media managers; should the XBMC library need to be refreshed.

NFO Updater Installation & notes
nfo_updater.zip contents: plugin.video.nfo_updater containing nfo_updater.py, addon.xml and changelog.txt. MD5: f26bdf0e1014211b96da3a4f10984832
See XBMC's install from Zip feature: http://wiki.xbmc.org/index.php?title=HOW...a_zip_file

Critical dependency
Milhouse's excellent 'Texture Cache Maintenance Utility' http://forum.xbmc.org/showthread.php?tid=158373
texturecache.py is used to output lists of Movies and TVshows; it may be installed via:
wget https://raw.githubusercontent.com/Milhou...recache.py -O texturecache.py
chmod +x ./texturecache.py

Process
Runs texturecache.py with JSON options to output XBMC's video library to Movies_dump.txt & Tvshows_dump.txt
From those, determine video playcount and NFO filename from <path/video.ext>
Updates NFO file's playcount and watched fields as required
Creates log files of changes made: Movies_NFOs-updated.txt; Tvshows_NFOs-updated.txt

Script may be run from within XBMC or via the command-line: .xbmc/addons/plugin.video.nfo_updater/nfo_updater.py
Within XBMC, displays a progress bar - though only to give a 'rough idea':
Not sure how to track texturecache.py progress, so simply sets bar to 50% whilst waiting.
Fills & re-fills the bar during NFO processing (easier than working out exact % completion!)

Feedback / advice welcome (this is my first XBMC / python script).

Cheers,
Pete

Developed in XBMC Frodo & Gotham; python 2.7.3; media stored on (mounted) NFS shares using UTF-8 filesystem (required for non-ASCII chars in video / filenames)

To do:
Create XBMC settings interface to allow selection of:
Process Movies & / or TVshows: currently, it does both (Movies first)
Process all videos (playcount>=0, the default) or only watched ones (playcount>0); determined by 'processAllNFOs' variable
(Possibly) Determine playcount & NFO paths directly, removing dependence on texturecache.py
Reply

Logout Mark Read Team Forum Stats Members Help
NFO Updater: Update video .NFO files based on XBMC playcount0