Kodi

From Alessandro's Wiki
Jump to navigation Jump to search

Kodi (formerly XBMC) is a free and open-source media player software application developed by the XBMC Foundation" (from Wikipedia)

https://kodi.tv/

Library

Library management is the reason why i started using Kodi in the first place.

The tricky part is, the names of the files you want to add to Kodi, need to be in the correct form:

  • Movies:
Movie Title (YEAR)/Movie Title (YEAR).extension
Movie Title (YEAR).extension
  • TV Shows
TV Show Title (YEAR)/
                   Season NUMBER/
                                Episode Title.extension 
                         or     TV Show Title (YEAR) Episode Title.extension 

more from Kodi's wiki : https://kodi.wiki/view/Naming_video_files


Renaming Files (fast)

  • example filename to "standardize":
TV Show 2006 2x13 Episode Title XviD [MM]blabla.avi
  • command to rename all .avi files in current directory
rename -v 's/^(.*) 2006 [0-9]x([0-9][0-9])(.*)$/$1 S03E$3$4/' *.avi
  • more examples
  • 2ACX12-Episode Title.rm
rename 's/2ACX([0-9][0-9]) - (\w+)/TV Show S02E$1 $2/' *.rm -v 
  • TV Show - 4ACX29 - Episode Title -.avi
rename 's/TV Show - 4ACX([0-9][0-9]) - (\w+)/TV Show S04E$1 $2/' *.avi -vn
  • S1EP02.avi
rename 's/(.*)/TV Show $1/' *.avi
  • TV Show [3x01] Episode Title.avi
rename -v 's/(.*) \[([0-9])x([0-9][0-9])\] (.*)\.avi/$1 S0$2E$3 $4\.avi/' *.avi


Database

  • database location
/home/osmc/.kodi/userdata/Database/
  • or
/home/xbian/.kodi/userdata/Database/
  • database files
MyVideosxxx.db.
  • sqlite
advancedsettings.xml

Manually edit

  • Offline
  1. shutdown kodi
  2. mount microSD on a linux computer (or any reading ext4 filesystems)
  3. open the file with sqlite
  4. execute needed queries, see examples
  • the following query changes the source of a title from local path to NFS
update 'path' set 
 strPath = replace(strPath, '/media/vol1/Videos/', 'nfs://192.168.0.1/nfs/Public/Shared Videos/')
where
 strPath like '/media/vol1/Videos/%';
Result: query executed successfully. Took 1ms, 19 rows affected


Debug

Log:

tail -f  /home/xbian/.kodi/temp/kodi.log

default password

  • xbian distribution
user:xbian
pass:raspberry
  • OSMC distribution
user:osmc
pass:osmc