<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Schapplm</id>
	<title>Official Kodi Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://kodi.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Schapplm"/>
	<link rel="alternate" type="text/html" href="https://kodi.wiki/view/Special:Contributions/Schapplm"/>
	<updated>2026-06-17T13:54:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=223849</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=223849"/>
		<updated>2021-02-14T07:41:11Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Alternatives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.2.7&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched state of movies and TV-series episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
        Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
        Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
        Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=https://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=https://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/leia/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Log file|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in Kodi or edit this value manually in the &amp;quot;%appdata%\Kodi\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-address of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
This Kodi Addon creates a SQLite database file called watchedlist.db by default. I recommend using the mySQL database instead, but both methods work well (see addon settings above).&lt;br /&gt;
&lt;br /&gt;
To view the database you can use the Windows Tool [https://sourceforge.net/projects/sqlitebrowser/files/latest/download SQLite Database Browser] or the Linux Tool [https://sourceforge.net/projects/sqliteman/ sqliteman]. The file is by default located in %APPDATA%\Kodi\userdata\addon_data\service.watchedlist\watchedlist.db in Windows or ~/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db in Linux.&lt;br /&gt;
&lt;br /&gt;
This first figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database (here opened with SQLite DB Browser) has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in Kodi, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The Kodi Database is queried and updated with JSON-RPC. It should not matter whether you use Kodi mysql or Kodi local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Addon]]&lt;br /&gt;
::* [https://github.com/watchedsyncforkodi/service.watchedsync watchedsync (in development)]&lt;br /&gt;
::* [https://forum.kodi.tv/showthread.php?tid=128542 Follw-It Addon] (Last update April 2012, probably not working any more) &lt;br /&gt;
* Addon that exports the watched-state to the nfo files of the movies&lt;br /&gt;
::* [https://www.kodinerds.net/index.php/Thread/36207-Release-NFO-Watchedstate-Updater/|NFO Watchedstate Updater]&lt;br /&gt;
* separate script to scan Kodi library (probably not executable from within Kodi and not working any more)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (not working any more) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* [[Advancedsettings.xml]] Section: Video Library&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Matrix add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:Dropbox&amp;diff=204972</id>
		<title>Add-on:Dropbox</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:Dropbox&amp;diff=204972"/>
		<updated>2020-04-25T10:36:29Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Method A */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=dropbox&lt;br /&gt;
|provider-name=micah&lt;br /&gt;
|ID=script.module.dropbox&lt;br /&gt;
|latest-version=2.2.0&lt;br /&gt;
|extension point=xbmc.python.module&lt;br /&gt;
|provides=&lt;br /&gt;
|Summary=Provide Dropbox Python API support&lt;br /&gt;
|Description=Provide Dropbox Python API support&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=Apache2&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=http://python-requests.org&lt;br /&gt;
|Email=micahgalizia AT gmail.com&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=}}&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This addon does not have to be installed: It is a prerequisite for other addons and will be installed automatically when installing these other addons.&lt;br /&gt;
&lt;br /&gt;
= About the Addon = &lt;br /&gt;
&lt;br /&gt;
This addon provides access to the dropbox API to other addons. Addons registered as Dropbox Apps have a separate folder in the dropbox file structure and can access files only in this folder.&lt;br /&gt;
This addon does not provide access to the files in the general dropbox file system.&lt;br /&gt;
The addon is triggered by opening a settings field in an addon using the Dropbox API.&lt;br /&gt;
&lt;br /&gt;
= Useage = &lt;br /&gt;
&lt;br /&gt;
* By opening the settings field &amp;quot;dropbox authorization code&amp;quot; from another addon, a link is displayed&lt;br /&gt;
&lt;br /&gt;
== Method A ==&lt;br /&gt;
&lt;br /&gt;
* open the link by using a QR code reader app on your smartphone ( in a browser on your smartphone)&lt;br /&gt;
* enter your dropbox credentials and confirm&lt;br /&gt;
* copy the authorization code&lt;br /&gt;
* click next on your Kodi device&lt;br /&gt;
* use a remote control smartphone app (like YATSE) to paste the authorization code into the dialog&lt;br /&gt;
* click next in the Kodi dialog&lt;br /&gt;
&lt;br /&gt;
Disclaimer: This only works until Kodi Leia (v. 18), not Matrix (v. 19).&lt;br /&gt;
&lt;br /&gt;
== Method B ==&lt;br /&gt;
&lt;br /&gt;
* open the link manually in a browser&lt;br /&gt;
* type the authorization code with your keyboard in the Kodi dialog (Kodi does not support copy-paste, since it is designed for no-input-devices)&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on libraries/modules]]&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Matrix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=132116</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=132116"/>
		<updated>2017-12-30T10:11:24Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Alternatives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.2.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched state of movies and TV-series episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Debug log/Easy|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in Kodi or edit this value manually in the &amp;quot;%appdata%\Kodi\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
This Kodi Addon creates a SQLite database file called watchedlist.db by default. I recommend using the mySQL database instead, but both methods work well (see addon settings above).&lt;br /&gt;
&lt;br /&gt;
To view the database you can use the Windows Tool [https://sourceforge.net/projects/sqlitebrowser/files/latest/download SQLite Database Browser] or the Linux Tool [https://sourceforge.net/projects/sqliteman/ sqliteman]. The file is by default located in %APPDATA%\Kodi\userdata\addon_data\service.watchedlist\watchedlist.db in Windows or ~/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db in Linux.&lt;br /&gt;
&lt;br /&gt;
This first figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database (here opened with SQLite DB Browser) has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in Kodi, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The Kodi Database is queried and updated with JSON-RPC. It should not matter whether you use Kodi mysql or Kodi local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Addon]]&lt;br /&gt;
::* [https://forum.kodi.tv/showthread.php?tid=128542 Follw-It Addon] (Last update April 2012, probably not working any more) &lt;br /&gt;
* Addon that exports the watched-state to the nfo files of the movies&lt;br /&gt;
::* [https://www.kodinerds.net/index.php/Thread/36207-Release-NFO-Watchedstate-Updater/|NFO Watchedstate Updater]&lt;br /&gt;
* separate script to scan Kodi library (probably not executable from within Kodi and not working any more)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (not working any more) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* [[AdvancedSettings.xml]] Section: Video Library&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:Dropbox_API&amp;diff=131264</id>
		<title>Add-on:Dropbox API</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:Dropbox_API&amp;diff=131264"/>
		<updated>2017-11-26T16:55:18Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: reference to other page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=Dropbox API&lt;br /&gt;
|provider-name=micah&lt;br /&gt;
|ID=script.module.dropbox&lt;br /&gt;
|latest-version=2.2.2&lt;br /&gt;
|extension point=xbmc.python.library&lt;br /&gt;
|provides= &lt;br /&gt;
|Summary=Provide Dropbox Python API support&lt;br /&gt;
|Description=Provide Dropbox Python API support&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=Apache2&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=http://python-requests.org&lt;br /&gt;
|Email=micahgalizia AT gmail.com&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=}}&lt;br /&gt;
&lt;br /&gt;
This wiki page is duplicate. See [[Add-on:Dropbox]] for the description and manual of the dropbox API in script.module.dropbox.&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-on libraries/modules]]&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=130045</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=130045"/>
		<updated>2017-07-01T06:54:22Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* SQLite Database file */ file location&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Debug log/Easy|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in Kodi or edit this value manually in the &amp;quot;%appdata%\Kodi\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
This Kodi Addon creates a SQLite database file called watchedlist.db by default. I recommend using the mySQL database instead, but both methods work well (see addon settings above).&lt;br /&gt;
&lt;br /&gt;
To view the database you can use the Windows Tool [https://sourceforge.net/projects/sqlitebrowser/files/latest/download SQLite Database Browser] or the Linux Tool [https://sourceforge.net/projects/sqliteman/ sqliteman]. The file is by default located in %APPDATA%\Kodi\userdata\addon_data\service.watchedlist\watchedlist.db in Windows or ~/.kodi/userdata/addon_data/service.watchedlist/watchedlist.db in Linux.&lt;br /&gt;
&lt;br /&gt;
This first figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database (here opened with SQLite DB Browser) has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in Kodi, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The Kodi Database is queried and updated with JSON-RPC. It should not matter whether you use Kodi mysql or Kodi local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Add-on]]&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan Kodi library (probably not executable from within Kodi)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* [[AdvancedSettings.xml]] Section: Video Library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=130044</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=130044"/>
		<updated>2017-07-01T06:50:09Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* SQLite Database file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Debug log/Easy|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in Kodi or edit this value manually in the &amp;quot;%appdata%\Kodi\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
This Kodi Addon creates a SQLite database file called watchedlist.db by default. I recommend using the mySQL database instead, but both methods work well (see addon settings above).&lt;br /&gt;
&lt;br /&gt;
To view the database you can use the Windows Tool [https://sourceforge.net/projects/sqlitebrowser/files/latest/download SQLite Database Browser] or the Linux Tool [https://sourceforge.net/projects/sqliteman/ sqliteman].&lt;br /&gt;
&lt;br /&gt;
This first figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database (here openened with SQLite DB Browser) has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in Kodi, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The Kodi Database is queried and updated with JSON-RPC. It should not matter whether you use Kodi mysql or Kodi local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Add-on]]&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan Kodi library (probably not executable from within Kodi)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* [[AdvancedSettings.xml]] Section: Video Library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129452</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129452"/>
		<updated>2017-04-28T15:11:18Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: xbmc -&amp;gt; kodi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Debug log/Easy|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in Kodi or edit this value manually in the &amp;quot;%appdata%\Kodi\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in Kodi, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The Kodi Database is queried and updated with JSON-RPC. It should not matter whether you use Kodi mysql or Kodi local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Add-on]]&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan Kodi library (probably not executable from within Kodi)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* [[AdvancedSettings.xml]] Section: Video Library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129451</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129451"/>
		<updated>2017-04-28T15:07:51Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: Updated settings to new version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with Kodi after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the WatchedList database every time the user changes a watched state (from unwatched to watched and vice versa). Marking something as &amp;quot;unwatched&amp;quot; is only possible with this setting.&lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible during the update (can take a few minutes, depending on verbosity and amount of changes and size of database), but it is possible to abort the whole process.&lt;br /&gt;
# Amount of User Information (&amp;quot;verbosity&amp;quot;): Determines, for which events a notification will be shown. This is independent from [[Debug log/Easy|debug logging]]. Options: &#039;&#039;all&#039;&#039; (notification for updates of every single movie and episode), &#039;&#039;only info&#039;&#039; (default, only notification for major steps of the update process, &#039;&#039;only warning&#039;&#039;, &#039;&#039;only error&#039;&#039;, &#039;&#039;none&#039;&#039; (show no notifications at all)&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. Set the number of backup files with this option. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. You can set this to infinite number of backups (option &#039;&#039;-1&#039;&#039;) to make sure, but this will fill your disk over the years.&lt;br /&gt;
# Dropbox synchronization: Saves your WatchedList database in your dropbox (should take max. 1MB space). If you enable this option, the [[Add-on:Dropbox|Dropbox authorization process]] will be started. If this option is activated with the same Dropbox account on several clients, it is possible to share the WatchedList database via the Dropbox.&lt;br /&gt;
# Dropbox Auth Code: This will has to be inserted after the Dropbox authorization process (see above).&lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The XBMC Database is queried and updated with JSON-RPC. It should not matter whether you use xbmc mysql or xbmc local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Add-on]]&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan xbmc library (probably not executable from within xbmc)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129450</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=129450"/>
		<updated>2017-04-28T14:29:12Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Alternatives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The XBMC Database is queried and updated with JSON-RPC. It should not matter whether you use xbmc mysql or xbmc local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* [[Add-on:Trakt|Trakt Add-on]]&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan xbmc library (probably not executable from within xbmc)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E&lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Leia add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=127039</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=127039"/>
		<updated>2017-01-22T21:01:30Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: http://forum.kodi.tv/showthread.php?tid=164652&amp;amp;pid=2506723#pid2506723&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.1.2&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the Kodi-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in Kodi.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=164652&lt;br /&gt;
|Website=http://kodi.wiki/view/Add-on:WatchedList&lt;br /&gt;
|Source=https://github.com/SchapplM/xbmc-addon-service-watchedlist&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/krypton/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
# Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
# Update watched state of movies &lt;br /&gt;
# Update watched state of episodes &lt;br /&gt;
# Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
# Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
# Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
# Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
# Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
# Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
# DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
# DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
# DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
# DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
# MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
# MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
# MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
# MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
# MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ====&lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `movie_watched` VALUES \((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `movie_watched` VALUES \((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO `episode_watched` VALUES \((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO `episode_watched` VALUES \((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* The exact character sequence regarding white-spaces or backticks can be different between versions of the SQLite tool and might need adaptation&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The XBMC Database is queried and updated with JSON-RPC. It should not matter whether you use xbmc mysql or xbmc local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan xbmc library (probably not executable from within xbmc)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.kodi.tv/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E &lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Add-ons with license tag]]&lt;br /&gt;
[[Category:Add-ons with source tag]]&lt;br /&gt;
[[Category:Add-ons with website tag]]&lt;br /&gt;
[[Category:All add-ons]]&lt;br /&gt;
[[Category:Program add-ons]]&lt;br /&gt;
[[Category:Krypton add-on repository]]&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:Dropbox&amp;diff=120180</id>
		<title>Add-on:Dropbox</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:Dropbox&amp;diff=120180"/>
		<updated>2016-04-10T17:54:49Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: manual how to use the addon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=dropbox&lt;br /&gt;
|provider-name=micah&lt;br /&gt;
|ID=script.module.dropbox&lt;br /&gt;
|latest-version=2.2.0&lt;br /&gt;
|extension point=xbmc.python.module&lt;br /&gt;
|provides=&lt;br /&gt;
|Summary=Provide Dropbox Python API support&lt;br /&gt;
|Description=Provide Dropbox Python API support&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=Apache2&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=http://python-requests.org&lt;br /&gt;
|Email=micahgalizia AT gmail.com&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Isengard add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This addon does not have to be installed: It is a prerequisite for other addons and will be installed automatically when installing these other addons.&lt;br /&gt;
&lt;br /&gt;
= About the Addon = &lt;br /&gt;
&lt;br /&gt;
This addon provides access to the dropbox API to other addons. Addons registered as Dropbox Apps have a separate folder in the dropbox file structure and can access files only in this folder.&lt;br /&gt;
This addon does not provide access to the files in the general dropbox file system.&lt;br /&gt;
The addon is triggered by opening a settings field in an addon using the Dropbox API.&lt;br /&gt;
&lt;br /&gt;
= Useage = &lt;br /&gt;
&lt;br /&gt;
* By opening the settings field &amp;quot;dropbox authorization code&amp;quot; from another addon, a link is displayed&lt;br /&gt;
&lt;br /&gt;
== Method A ==&lt;br /&gt;
&lt;br /&gt;
* open the link by using a QR code reader app on your smartphone ( in a browser on your smartphone)&lt;br /&gt;
* enter your dropbox credentials and confirm&lt;br /&gt;
* copy the authorization code&lt;br /&gt;
* click next on your Kodi device&lt;br /&gt;
* use a remote control smartphone app (like YATSE) to paste the authorization code into the dialog&lt;br /&gt;
* click next in the Kodi dialog&lt;br /&gt;
&lt;br /&gt;
== Method B ==&lt;br /&gt;
&lt;br /&gt;
* open the link manually in a browser&lt;br /&gt;
* type the authorization code with your keyboard in the Kodi dialog (Kodi does not support copy-paste, since it is designed for no-input-devices)&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:YouTube&amp;diff=106011</id>
		<title>Add-on:YouTube</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:YouTube&amp;diff=106011"/>
		<updated>2015-11-25T22:19:12Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: restored deleted information from &amp;quot;18:01, 8 April 2015‎&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=YouTube&lt;br /&gt;
|provider-name=bromix&lt;br /&gt;
|ID=plugin.video.youtube&lt;br /&gt;
|latest-version=5.1.10&lt;br /&gt;
|extension point=xbmc.python.pluginsource&lt;br /&gt;
|provides=video&lt;br /&gt;
|Summary=Plugin for YouTube&lt;br /&gt;
|Description=YouTube is a one of the biggest video-sharing websites of the world.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=GNU GENERAL PUBLIC LICENSE. Version 2, June 1991&lt;br /&gt;
|Forum=http://forum.kodi.tv/showthread.php?tid=200735&lt;br /&gt;
|Website=http://www.youtube.com&lt;br /&gt;
|Source=https://github.com/bromix/plugin.video.youtube&lt;br /&gt;
|Email=bromix at gmx dot net&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/jarvis/plugin.video.youtube/icon.png}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
=== Integration with strm files ===&lt;br /&gt;
Youtube streams can be integrated into the video library with [[Strm|strm files]]. &lt;br /&gt;
&lt;br /&gt;
The syntax for a youtube-URL like &amp;lt;nowiki&amp;gt;https://www.youtube.com/watch?v=$VIDEOID&amp;lt;/nowiki&amp;gt; or &amp;lt;nowiki&amp;gt;https://www.youtube.com/playlist?list=$PLAYLISTID&amp;lt;/nowiki&amp;gt; in a strm file is&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;plugin://plugin.video.youtube/?path=/root/video&amp;amp;action=play_video&amp;amp;videoid=$VIDEOID&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;plugin://plugin.video.youtube/?path=/root/video&amp;amp;action=play_all&amp;amp;playlist=$PLAYLISTID&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
=== Similar page names ===&lt;br /&gt;
{{#lst:YouTube|similar pages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Social media]]&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;br /&gt;
[[Category:Jarvis add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84614</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84614"/>
		<updated>2015-01-31T17:45:40Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added forum link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The XBMC Database is queried and updated with JSON-RPC. It should not matter whether you use xbmc mysql or xbmc local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations == &lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan xbmc library (probably not executable from within xbmc)&lt;br /&gt;
::* http://forum.xbmc.org/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.xbmc.org/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E &lt;br /&gt;
&lt;br /&gt;
== Feedback and Discussion ==&lt;br /&gt;
&lt;br /&gt;
In case of errors or questions, please post them [http://forum.kodi.tv/showthread.php?tid=164652 in the forum thread].&lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84613</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84613"/>
		<updated>2015-01-31T17:41:22Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added sections on limitations and alternatives&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
* open the old database file in SQLite database browser&lt;br /&gt;
* File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
* bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Save this new sql file&lt;br /&gt;
* execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
&lt;br /&gt;
The XBMC Database is queried and updated with JSON-RPC. It should not matter whether you use xbmc mysql or xbmc local database.&lt;br /&gt;
&lt;br /&gt;
== Limitations == &lt;br /&gt;
&lt;br /&gt;
The watched-status is only stored based on imdb/thetvdb number. Different Versions of a movie (DVD, BlueRay, Extended Edition, Directors Cut) are all considered equally watched.&lt;br /&gt;
&lt;br /&gt;
== Alternatives ==&lt;br /&gt;
&lt;br /&gt;
* Online List of watched movies&lt;br /&gt;
::* http://code.google.com/p/xbmc-follwit/ (Last update April 2012, probably not Frodo-compatible) &lt;br /&gt;
::* ...&lt;br /&gt;
* separate script to scan xbmc library (probably not executable from within xbmc)&lt;br /&gt;
::* http://forum.xbmc.org/showthread.php?tid=62874&amp;amp;pid=1280902#pid1280902 &lt;br /&gt;
* other similar addons&lt;br /&gt;
::* http://code.google.com/p/xbmc-watched-data/ (defect in Frodo?)&lt;br /&gt;
::* http://forum.xbmc.org/showthread.php?tid=129448&amp;amp;pid=1401643#pid1401643 (working in Frodo, a little bug, because comparison of names instead of unique numbers) &lt;br /&gt;
* Export watched flag in nfo file and Import it back again:&lt;br /&gt;
::* http://wiki.xbmc.org/index.php?title=Advancedsettings.xml#.3Cvideolibrary.3E &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84612</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84612"/>
		<updated>2015-01-31T17:36:23Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: corrected indentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, the possibility to use a mysql database was added. This has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
* simultaneous access possible &lt;br /&gt;
* mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
* no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database from SQLite db file to mysql:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
# File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
# bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
::* Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Save this new sql file&lt;br /&gt;
# execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84611</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84611"/>
		<updated>2015-01-31T17:32:52Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_db_folder.png|500px|File overview]]&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_structure.png|500px|Database overview]]&lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_movies.png|500px|Movie table overview]]&lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_sqlite_watched_episode.png|500px|Episode table overview]]&lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84610</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84610"/>
		<updated>2015-01-31T17:28:21Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_mysql_watched_movies.jpg|500px|phpmyAdmin View of WatchedList database]]&lt;br /&gt;
&lt;br /&gt;
For the description of the tables read below.&lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability. &lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84609</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84609"/>
		<updated>2015-01-31T17:26:33Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
* After Startup, the databases are searched for watched-information (Notification 1).&lt;br /&gt;
* Then newly watched movies and tv episodes are written to the addon database (Notification 2). &lt;br /&gt;
* After that, media that is not watched in the Kodi database and was previously marked as watched by the addon is again marked as watched in Kodi ( Notifications 3 and 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:service_watchedlist_doc_notification_start.png|Notification 1&lt;br /&gt;
File:service_watchedlist_doc_notification_remember.png|Notification 2&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_episode.png|Notification 3&lt;br /&gt;
File:service_watchedlist_doc_notification_setwatched_movie.png|CNotification 4&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
For the description of the tables read below. &lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability. &lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84608</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84608"/>
		<updated>2015-01-31T17:20:31Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_database.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
After Startup, the databases are searched for watched-information. &lt;br /&gt;
Then newly watched movies and tv episodes are written to the addon database (Remember): &lt;br /&gt;
After that, media that is not watched in the XBMC database and was previously marked as watched by the addon is again marked as watched in XBMC. &lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
For the description of the tables read below. &lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability. &lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84607</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84607"/>
		<updated>2015-01-31T17:19:43Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: added image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time.&lt;br /&gt;
&lt;br /&gt;
[[File:service_watchedlist_doc_settings_basic.jpg|500px|Basic Settings]]&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user. &lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
After Startup, the databases are searched for watched-information. &lt;br /&gt;
Then newly watched movies and tv episodes are written to the addon database (Remember): &lt;br /&gt;
After that, media that is not watched in the XBMC database and was previously marked as watched by the addon is again marked as watched in XBMC. &lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
For the description of the tables read below. &lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability. &lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_superrepo.jpg&amp;diff=84603</id>
		<title>File:Service watchedlist doc superrepo.jpg</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_superrepo.jpg&amp;diff=84603"/>
		<updated>2015-01-31T17:14:54Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_watched_movies.png&amp;diff=84602</id>
		<title>File:Service watchedlist doc sqlite watched movies.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_watched_movies.png&amp;diff=84602"/>
		<updated>2015-01-31T17:14:53Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_watched_episode.png&amp;diff=84601</id>
		<title>File:Service watchedlist doc sqlite watched episode.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_watched_episode.png&amp;diff=84601"/>
		<updated>2015-01-31T17:14:52Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_structure.png&amp;diff=84600</id>
		<title>File:Service watchedlist doc sqlite structure.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_sqlite_structure.png&amp;diff=84600"/>
		<updated>2015-01-31T17:14:51Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_settings_database.jpg&amp;diff=84599</id>
		<title>File:Service watchedlist doc settings database.jpg</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_settings_database.jpg&amp;diff=84599"/>
		<updated>2015-01-31T17:14:51Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_settings_basic.jpg&amp;diff=84598</id>
		<title>File:Service watchedlist doc settings basic.jpg</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_settings_basic.jpg&amp;diff=84598"/>
		<updated>2015-01-31T17:14:49Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_start.png&amp;diff=84597</id>
		<title>File:Service watchedlist doc notification start.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_start.png&amp;diff=84597"/>
		<updated>2015-01-31T17:14:48Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_setwatched_movie.png&amp;diff=84596</id>
		<title>File:Service watchedlist doc notification setwatched movie.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_setwatched_movie.png&amp;diff=84596"/>
		<updated>2015-01-31T17:14:47Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_setwatched_episode.png&amp;diff=84595</id>
		<title>File:Service watchedlist doc notification setwatched episode.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_setwatched_episode.png&amp;diff=84595"/>
		<updated>2015-01-31T17:14:47Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_remember.png&amp;diff=84594</id>
		<title>File:Service watchedlist doc notification remember.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_notification_remember.png&amp;diff=84594"/>
		<updated>2015-01-31T17:14:46Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_mysql_watched_movies.jpg&amp;diff=84593</id>
		<title>File:Service watchedlist doc mysql watched movies.jpg</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_mysql_watched_movies.jpg&amp;diff=84593"/>
		<updated>2015-01-31T17:14:45Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_db_folder.png&amp;diff=84592</id>
		<title>File:Service watchedlist doc db folder.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Service_watchedlist_doc_db_folder.png&amp;diff=84592"/>
		<updated>2015-01-31T17:14:44Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84590</id>
		<title>Add-on:WatchedList</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:WatchedList&amp;diff=84590"/>
		<updated>2015-01-31T17:12:07Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: Added Setup and Useage Instructions (without images)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=WatchedList&lt;br /&gt;
|provider-name=schapplm&lt;br /&gt;
|ID=service.watchedlist&lt;br /&gt;
|latest-version=1.0.3&lt;br /&gt;
|extension point=xbmc.python.script&lt;br /&gt;
|provides=executable&lt;br /&gt;
|Summary=Save watched Movies and TV Episodes independent from filenames&lt;br /&gt;
|Description=&lt;br /&gt;
		Export: Searches the XBMC-Database for watched files. Determine imdb-id and thetvdb-id to identify movies and TV-episodes. Then save the list to a new independent table.&lt;br /&gt;
		Import: Set the watched state for each video file in xbmc.&lt;br /&gt;
		Automatic background process without user interaction.&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.kodi.tv/addons/helix/service.watchedlist/icon.png}}&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Basic Settings ===&lt;br /&gt;
&lt;br /&gt;
#     Debug mode: Show more notifications, create more entries in kodi.log &lt;br /&gt;
#     Update watched state of movies &lt;br /&gt;
#     Update watched state of episodes &lt;br /&gt;
#     Autorun: starts with XBMC after a delay time of &#039;&#039;x&#039;&#039; minutes. &lt;br /&gt;
#     Startup delay (see above &#039;&#039;x&#039;&#039;). Set the delay time to not disturb directly at startup. &lt;br /&gt;
#     Autostart mode: &#039;one update&#039; only does one full update of the watchedlist and then quits. &#039;periodic&#039; executes this update in the interval given below. &#039;no update&#039; does no full update. You have the possibility to run WatchedList in background. &lt;br /&gt;
#     Update interval (active if set to &#039;periodic&#039; above)&lt;br /&gt;
#     Follow user ...: Run in background and update the watchedlist database every time the user changes a watched state &lt;br /&gt;
#     Progress dialog: Show a progress bar for every full update. No user interaction possible in this time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Database Settings ===&lt;br /&gt;
&lt;br /&gt;
# DB Method: Either use a SQLite db file or a mysql server for the database of this addon. I recommend a mysql database, since there were problems with the SQLite database file consistency since XBMC v13. The default setting is a local SQLite db file. This is suitable for backup of the local watched states in case of file movements or Kodi database cleaning.&lt;br /&gt;
#     DB File: Use a non-default database file (not in [...]/userdata/addon_data/service.watchedlist) &lt;br /&gt;
#     DB File: Path to the database-file. To add a network path for access from multiple clients you can browse the path in xbmc or edit this value manually in the &amp;quot;%appdata%\XBMC\userdata\addon_data\service.watchedlist\settings.xml&amp;quot;. &lt;br /&gt;
#     DB File: Filename of the database (SQLite .db file) &lt;br /&gt;
#     DB File: Create a zip backup copy (ca. 40 KB) of the database (ca 100 KB) each time before writing it. With this you can restore any state you want, e.g. when you mess with your kodi-database and too much media is marked as watched. On the contrary the directory will be filled with new files on every change to the WL-DB (no file Rotation, drive space). &lt;br /&gt;
#     MySQL: IP-adress of the Server. Make sure, there is a mysql server running. To start, use [MySQL/Setting_up_MySQL this] guide. &lt;br /&gt;
#     MySQL: 3306 is the default mysql port. No need to change it. &lt;br /&gt;
#     MySQL: Name of the database. You manually need to create this database on the mysql server (use phpMyAdmin) &lt;br /&gt;
#     MySQL: Username. This user must exist and have all necessary permissions on the database set before &lt;br /&gt;
#     MySQL: password for this user. &lt;br /&gt;
&lt;br /&gt;
=== Useage ===&lt;br /&gt;
&lt;br /&gt;
This addon runs in the background as a service. There is no interaction with the user. The script only gives messages about the current operation&lt;br /&gt;
&lt;br /&gt;
After Startup, the databases are searched for watched-information. &lt;br /&gt;
Then newly watched movies and tv episodes are written to the addon database (Remember): &lt;br /&gt;
After that, media that is not watched in the XBMC database and was previously marked as watched by the addon is again marked as watched in XBMC. &lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL Database ====&lt;br /&gt;
&lt;br /&gt;
The mySQL database stores all relevant information. It looks like this:&lt;br /&gt;
For the description of the tables read below. &lt;br /&gt;
&lt;br /&gt;
==== SQLite Database file ==== &lt;br /&gt;
&lt;br /&gt;
The SQLite Database file option is no longer recommended. To transfer an existing SQLite WatchedList? Database, read below.&lt;br /&gt;
&lt;br /&gt;
The script creates a SQLite database. To view the database I used SQLite Database Browser. &lt;br /&gt;
&lt;br /&gt;
https://sourceforge.net/projects/sqlitebrowser/files/latest/download&lt;br /&gt;
&lt;br /&gt;
This figure shows the SQLite db file with automatically created backup copies.&lt;br /&gt;
&lt;br /&gt;
The database has three tables. &lt;br /&gt;
&lt;br /&gt;
The first table stores the watched movies by imdb-number. The title column is only for easier user access to the table. &lt;br /&gt;
&lt;br /&gt;
The second table stores watched tv episodes with unique number for the TV Show (this field is called imdbnumber in XBMC, but this is the TheTVDB number). The names of the tv shows are stored in a third table, only for better readability. &lt;br /&gt;
&lt;br /&gt;
==== Conversion from SQLite database to mysql database ====&lt;br /&gt;
&lt;br /&gt;
In Version 1.0.0 of this addon, I added the possibility to use a mysql database, which has a few advantages over the SQLite Database file: &lt;br /&gt;
 &lt;br /&gt;
*     simultaneous access possible &lt;br /&gt;
*     mysql handles all the database access, therefore no permanent backup copying necessary &lt;br /&gt;
*     no filesystem access in the addon. Should lead to fewer errors &lt;br /&gt;
&lt;br /&gt;
How to convert the database:&lt;br /&gt;
 &lt;br /&gt;
# open the old database file in SQLite database browser&lt;br /&gt;
#     File -&amp;gt; Export -&amp;gt; Database to sql file&lt;br /&gt;
#     bring this into the new format. For Replacement, I used Notepad++ in Windows:&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO movie_watched VALUES\((\d+),(\d+),(\d+),(\d+),&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO movie_watched VALUES\((\1),(\2),FROM_UNIXTIME\((\3)\),FROM_UNIXTIME\((\4)\),&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#         Replace regular expression &amp;lt;code&amp;gt;&amp;quot;INSERT INTO episode_watched VALUES\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)&amp;quot;&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;&amp;quot;INSERT IGNORE INTO episode_watched VALUES\((\1),(\2),(\3),(\4),FROM_UNIXTIME\((\5)\),FROM_UNIXTIME\((\6)\)\)&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
#     Save this new sql file&lt;br /&gt;
#     execute the commands in the &amp;quot;INSERT&amp;quot;-commands in the sql query interface in phpmyadmin after the tables were generated at the first start of the watchedlist addon with mysql option enabled. &lt;br /&gt;
&lt;br /&gt;
[[Category:Helix add-on repository]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83939</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83939"/>
		<updated>2015-01-11T15:31:29Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Add to your python script the code for remote debug */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Python Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
Instructions for Linux users:&lt;br /&gt;
&lt;br /&gt;
{{Collapse top}}&lt;br /&gt;
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.&lt;br /&gt;
The easiest solution is to install the [[Add-on:Pydevd|pydevd-addon]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To access this from your addon, your addon.xml has to contain &amp;lt;code&amp;gt;&amp;lt;import addon=&amp;quot;script.module.pydevd&amp;quot; version=&amp;quot;3.4.1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Collapse bottom}}&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
* Option 4 - Use the pydev from the [[Add-on:Pydevd|pydevd-addon]]&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
===== Option 3: (Suggested for Windows users) =====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
===== Option 4: (Suggested for Linux users) =====&lt;br /&gt;
Use the [[Add-on:Pydevd|pydevd-addon]] as described above. No action necessary. Option 3 does not work on Linux, because /usr/share/kodi/system/python/Lib is ignored.&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd # with the addon script.module.pydevd, only use `import pydevd`&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83938</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83938"/>
		<updated>2015-01-11T15:29:26Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Copy pysrc in XBMC Python install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Python Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
Instructions for Linux users:&lt;br /&gt;
&lt;br /&gt;
{{Collapse top}}&lt;br /&gt;
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.&lt;br /&gt;
The easiest solution is to install the [[Add-on:Pydevd|pydevd-addon]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To access this from your addon, your addon.xml has to contain &amp;lt;code&amp;gt;&amp;lt;import addon=&amp;quot;script.module.pydevd&amp;quot; version=&amp;quot;3.4.1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Collapse bottom}}&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
* Option 4 - Use the pydev from the [[Add-on:Pydevd|pydevd-addon]]&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
===== Option 3: (Suggested for Windows users) =====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
===== Option 4: (Suggested for Linux users) =====&lt;br /&gt;
Use the [[Add-on:Pydevd|pydevd-addon]] as described above. No action necessary. Option 3 does not work on Linux, because /usr/share/kodi/system/python/Lib is ignored.&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83937</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83937"/>
		<updated>2015-01-11T15:13:27Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Choose how XBMC will refer to Pydev debugging module */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Python Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
Instructions for Linux users:&lt;br /&gt;
&lt;br /&gt;
{{Collapse top}}&lt;br /&gt;
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.&lt;br /&gt;
The easiest solution is to install the [[Add-on:Pydevd|pydevd-addon]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To access this from your addon, your addon.xml has to contain &amp;lt;code&amp;gt;&amp;lt;import addon=&amp;quot;script.module.pydevd&amp;quot; version=&amp;quot;3.4.1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Collapse bottom}}&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
* Option 4 - Use the pydev from the [[Add-on:Pydevd|pydevd-addon]]&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83936</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=83936"/>
		<updated>2015-01-11T15:11:22Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Identify where PyDev remote debugger Python files are */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Python Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
Instructions for Linux users:&lt;br /&gt;
&lt;br /&gt;
{{Collapse top}}&lt;br /&gt;
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.&lt;br /&gt;
The easiest solution is to install the [[Add-on:Pydevd|pydevd-addon]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To access this from your addon, your addon.xml has to contain &amp;lt;code&amp;gt;&amp;lt;import addon=&amp;quot;script.module.pydevd&amp;quot; version=&amp;quot;3.4.1&amp;quot;/&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Collapse bottom}}&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:DailyMotion.com&amp;diff=82720</id>
		<title>Add-on:DailyMotion.com</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:DailyMotion.com&amp;diff=82720"/>
		<updated>2014-12-28T18:12:39Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Addon &lt;br /&gt;
|Name=DailyMotion.com&lt;br /&gt;
|provider-name=AddonScriptorDE&lt;br /&gt;
|ID=plugin.video.dailymotion_com&lt;br /&gt;
|latest-version=2.1.2&lt;br /&gt;
|extension point=xbmc.python.pluginsource&lt;br /&gt;
|provides=video&lt;br /&gt;
|Summary=Movies, TV, Music, User-Clips, 3D and Livestreams&lt;br /&gt;
|Description=Movies, TV, Music, User-Clips, 3D and Livestreams&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=http://forum.xbmc.org/showthread.php?tid=142626&lt;br /&gt;
|Website=http://www.dailymotion.com&lt;br /&gt;
|Source=https://github.com/AddonScriptorDE/plugin.video.dailymotion_com&lt;br /&gt;
|Email=AddonScriptorDE at yahoo dot de&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.xbmc.org/addons/frodo/plugin.video.dailymotion_com/icon.png}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Frodo add-on repository]]&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
=== Integration with strm files ===&lt;br /&gt;
DailyMotion streams can be integrated into the video library with [[Strm|strm files]]. &lt;br /&gt;
The syntax for a DailyMotion-URL like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://www.dailymotion.com/video/%VIDEOID%_DESCRIPTIONTEXT&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;plugin://plugin.video.dailymotion_com/?url=%VIDEOID%&amp;amp;mode=playVideo&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Add-on:YouTube&amp;diff=82716</id>
		<title>Add-on:YouTube</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Add-on:YouTube&amp;diff=82716"/>
		<updated>2014-12-28T17:48:12Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Unofficial Browser extensions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{forum link2|For more information and support see the [[forum:79487|YouTube add-on discussion thread]]}}&lt;br /&gt;
{{Addon &lt;br /&gt;
|Name=YouTube&lt;br /&gt;
|provider-name=TheCollective&lt;br /&gt;
|ID=plugin.video.youtube&lt;br /&gt;
|latest-version=4.4.10&lt;br /&gt;
|extension point=xbmc.python.pluginsource&lt;br /&gt;
|provides=video&lt;br /&gt;
|Summary=YouTube video plugin&lt;br /&gt;
|Description=Plugin that lets you browse and play videos from everybody&#039;s favorite video site!&lt;br /&gt;
|Platform=all&lt;br /&gt;
|Language=&lt;br /&gt;
|License=&lt;br /&gt;
|Forum=&lt;br /&gt;
|Website=&lt;br /&gt;
|Source=&lt;br /&gt;
|Email=&lt;br /&gt;
|broken=&lt;br /&gt;
|icon url=http://mirrors.xbmc.org/addons/frodo/plugin.video.youtube/icon.png}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
In order to use this plugin you will need Dharma 10.1 or newer release of XBMC.&lt;br /&gt;
&lt;br /&gt;
{{bluev|NOTICE:|Changes in our development methodology have made it necessary to put the stable version of the plugin on life support. Some non-working features have been disabled as it wasn&#039;t feasible to repair them.}}&lt;br /&gt;
&lt;br /&gt;
All functions are enabled if you are running an Eden v11 or newer version of XBMC.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
* Non-intrusive user notifications&lt;br /&gt;
* Video thumbnail browsing for a more pleasant user experience&lt;br /&gt;
* Advanced Searching (including locally stored searches)&lt;br /&gt;
* Listing of [http://www.youtube.com/ YouTube&#039;s] standard feeds and region specific feeds&lt;br /&gt;
* Adding and removing contacts&lt;br /&gt;
* Adding and removing favorites&lt;br /&gt;
* Subscribing and unsubscribing&lt;br /&gt;
* Listing Subscriptions including new subscription videos&lt;br /&gt;
* Listing a contacts uploads, playlists, favorite videos and subscriptions&lt;br /&gt;
* Playback of all video streams (RTMP support is currently not working due to limitations in rtmpdump)&lt;br /&gt;
* Plays videos that can&#039;t be embedded&lt;br /&gt;
* Auto-magically filters unavailable video&#039;s from [http://www.youtube.com/ YouTube&#039;s] results (If you see it, you can play it)&lt;br /&gt;
* Supports [http://www.youtube.com/ YouTube] Disco! (Music Discovery project) Searches (Beta)&lt;br /&gt;
* Supports Browsing [http://www.youtube.com/ YouTube] Categories, Trailers and Shows (Beta)&lt;br /&gt;
&lt;br /&gt;
=== Unofficial Browser extensions ===&lt;br /&gt;
The extensions above are known not to work with the newest YouTube and XBMC Eden and newer.&lt;br /&gt;
The following unofficial extensions are available:&lt;br /&gt;
&lt;br /&gt;
Mozilla Firefox&lt;br /&gt;
* [https://addons.mozilla.org/en-US/firefox/addon/send-to-xbmc/?src=external-xbmcwiki Send to XBMC]&lt;br /&gt;
&lt;br /&gt;
Google Chrome&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/play-to-xbmc/fncjhcjfnnooidlkijollckpakkebden Play to XBMC]&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/playlist2xbmc/mgajimdehjbpldnldemmfigkepdahkik Playlist2XBMC]&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/youtube-to-xbmc/gbghegmimhjemkhpimohkdopkeahldbh Youtube to XBMC] (works with Gotham)&lt;br /&gt;
&lt;br /&gt;
Greasemonkey&lt;br /&gt;
* [http://userscripts.org/scripts/show/136934 YouTube » XBMC]&lt;br /&gt;
&lt;br /&gt;
=== Integration with strm files ===&lt;br /&gt;
Youtube streams can be integrated into the video library with [[Strm|strm files]]. &lt;br /&gt;
The syntax for a youtube-URL like &amp;lt;nowiki&amp;gt;https://www.youtube.com/watch?v=$VIDEOID&amp;lt;/nowiki&amp;gt; is&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;plugin://plugin.video.youtube/?path=/root/video&amp;amp;action=play_video&amp;amp;videoid=$VIDEOID&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Known problems =&lt;br /&gt;
* One of the main features of the plugin is that it defaults to thumbnails view for video items. This only works when using the default &amp;quot;Confluence&amp;quot; skin as the plugin is dependent on the Id defined for confluences thumbnails view.&lt;br /&gt;
&lt;br /&gt;
* [http://www.youtube.com/ YouTube] also supports exposing videos through [http://en.wikipedia.org/wiki/Protected_Streaming Adobes RTMPE Protected streaming protocol]. But due to missing support for &amp;quot;RTMPE type 10 handshakes&amp;quot; in the [http://rtmpdump.mplayerhq.hu/ rtmpdump] library, playback is currently not working.&lt;br /&gt;
&lt;br /&gt;
= Feature request =&lt;br /&gt;
If you have a feature request then create a new post in the [http://forum.xbmc.org/showthread.php?t=79487 YouTube support thread].&lt;br /&gt;
&lt;br /&gt;
= Reporting a bug =&lt;br /&gt;
If you are having problems with the plugin or just have a query please do read the documentation and do a search on the XBMC [http://forum.xbmc.org/showthread.php?t=79487 YouTube support thread] before posting.&lt;br /&gt;
&lt;br /&gt;
If you believe you have found a new bug, create a log (see below) and post in the [http://forum.xbmc.org/showthread.php?t=79487 YouTube support thread].&lt;br /&gt;
&lt;br /&gt;
== Creating a useful debug log ==&lt;br /&gt;
Typically users will report errors with descriptions that lack many important details. While we take all user reported errors seriously, its often is impossible to help if without a proper debug-log, this guide will take you through the steps to create such a log. &lt;br /&gt;
&lt;br /&gt;
As such, if you want any help with this issue you must follow these steps.&lt;br /&gt;
# Open the plugin and go to &amp;quot;Advanced&amp;quot; in settings, enable &amp;quot;Plugin debug&amp;quot; and confirm.&lt;br /&gt;
# Find your debug Log here:&lt;br /&gt;
* Linux::&lt;br /&gt;
  $HOME/.xbmc/temp/xbmc.log&lt;br /&gt;
* Mac OSX:&lt;br /&gt;
  $User/Library/Logs/xbmc.log&lt;br /&gt;
* Windows 7 &amp;amp; Vista:&lt;br /&gt;
  \Users\&amp;lt;UserName&amp;gt;\AppData\Roaming\XBMC\xbmc.log&lt;br /&gt;
# Paste your debug log to http://pastebin.com/ ( Do NOT upload part of the log, we need the ENTIRE log. )&lt;br /&gt;
# Post a message [http://forum.xbmc.org/showthread.php?t=79487 in this thread] with your debug log.&lt;br /&gt;
&lt;br /&gt;
If you have problems following the guide, please ask on the [http://forum.xbmc.org/showthread.php?t=79487 forum thread] and we will help you through it.&lt;br /&gt;
&lt;br /&gt;
= Testing/Status =&lt;br /&gt;
Integration and unittests are run continuously by Jenkins&lt;br /&gt;
&lt;br /&gt;
http://tc.tobiasussing.dk/jenkins/view/YouTube/&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
===Similar page names===&lt;br /&gt;
{{#lst:YouTube|similar pages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Frodo add-on repository]]&lt;br /&gt;
[[Category:Eden add-on repository]]&lt;br /&gt;
[[Category:Social media]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:MythicalLibrarian&amp;diff=78782</id>
		<title>Archive:MythicalLibrarian</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:MythicalLibrarian&amp;diff=78782"/>
		<updated>2014-09-13T09:33:25Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Automatic Installation on linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav| [[Supplemental tools]] }}&lt;br /&gt;
[[File:Librarianas.png|left|200px|diagram of how mythicalLibrarian works]]&lt;br /&gt;
[[File:Libraraianlibraryfiles2.jpg|right|200px|actual picture from XBMC with recordings from MythTV ]]&lt;br /&gt;
[[File:Librararianlibraryfile.jpg|right|200px|actual picture from XBMC with recordings from MythTV ]]&lt;br /&gt;
&#039;&#039;&#039;The Missing Symlink&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section begin=&amp;quot;intro&amp;quot; /&amp;gt;mythicalLibrarian will convert your [[MythTV]] recordings into a [[Video library]], free of commercials, automatically after recording. You can see an example to the right.&amp;lt;section end=&amp;quot;intro&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;About The Program&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mythicalLibrarian is a versitile tool designed to assign season and episode numbers to television shows based on show title and episode title so they are easily recognized by XBMC or Boxee. mythicalLibrarian interfaces with TheTvDb to gain information about the target file. mythicalLibrarian also has the ability to interface with MythTV&#039;s local database, XBMC&#039;s command interface, and Ubuntu GNOME desktop to provide an all-around recording recognition/managing engine which will run in the background of your back-end computer to update your library and provide status updates upon each completed job.&lt;br /&gt;
&lt;br /&gt;
mythicalLibrarian pulls information supplied by your [[MythTV]] program guide for episodes, and makes a fuzzy logic match out of the supplied data. If fuzzy logic is not enough, it will match original air date. For Movies, mythicalLibrarian will rename your MythTV recordings based upon information obtained from the program guide database on your computer. If you allow commercial data to be generated for your shows, mythicalLibrarian will also copy this data with the recordings. mythicalLibrarian allows MythTV to remain in control of the files, so there is no reason not to process your recordings for boxee and XBMC.&lt;br /&gt;
&lt;br /&gt;
MythicalLibrarian was designed to run under Ubuntu Karmic Koala OS through BASH 4.0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Files.mythicalfilesystemthumb.jpg|right|thumb|250px|Click this link to see folder layout http://wiki.xbmc.org/images/5/5f/Files.mythicalfilesystem.gif ]][[File:MythicalDBaseThumb.jpg|right|thumb|250px|Click this link to see an example database http://wiki.xbmc.org/images/e/ed/MythicalDBasea.jpg ]]&lt;br /&gt;
&#039;&#039;&#039;How it works&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mythicalLibrarian will generate several files of it&#039;s own while running. It must have it&#039;s own working directory. To the right, you can see an example of the layout of /mythicalLibrarian, the files which it creates and their purposes.&lt;br /&gt;
Here is the basic flow:&lt;br /&gt;
* You put in- &#039;mythicalLibrarian &amp;quot;file/to/process.ext&amp;quot; &amp;quot;episode or movie title&amp;quot; &amp;quot;episode subtitle&amp;quot;&lt;br /&gt;
* Episodes- mythicalLibrarian references TheTvDb to gain SeriesID. Get current time from TheTvDb If the database is out-of-date or non existant, it will download the full series and parse it. Then, using fuzzy logic, it makes a match of the series name and gains season and episode information. If this is not possible, it will attempt a match of original airdate from your MythTV program guide database.&lt;br /&gt;
mythicalLibrarian will rename your recognizable episodes to: &amp;quot;&#039;&#039;&#039;&#039;&#039;/Show Name/Show Name.SxxExx (episode subtitle).ext&#039;&#039;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Movies- mythicalLibrarian references your MythTV program guide database to verify it is a movie and then obtains the year for the movie.&lt;br /&gt;
mythicalLibrarian will rename your movies to: &amp;quot;&#039;&#039;&#039;&#039;&#039;/Movie Name/movie title (Year).ext&#039;&#039;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Showings or no TVDB info- mythicalLibrarian will skip all processing and rename the files to &amp;quot;&#039;&#039;&#039;&#039;&#039;/Show Name/Show Name.S0E0 (episode subtitle).ext&#039;&#039;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Deployment&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
While it is possible to manually configure the script, this may lead to configuration issues. mythicalLibrarian utilizes an advanced easy installation method which allows you to choose between using the latest stable version, or the current version located on your computer. As of right now, the SVN is updated daily, so take advantage of this easy deployment method to increase your features and functions. All users are encouraged to use the SVN version as the primary and in the event of a diagnostic failure, revert to the last stable version. Updating mythicalLibrarian to the newest version is as simple as typing mythicalLibrarian --update and then hitting enter a bunch of times. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Additional Information&#039;&#039;&#039;&lt;br /&gt;
* Please report problems here in the XBMC Forum thread: http://forum.xbmc.org/showthread.php?p=470402#post470402 &lt;br /&gt;
&lt;br /&gt;
* If you would like to see additional features and functions, additional back-end support such as tvheadend (and are willing to collect data), or additional guide data type support, please post in this thread http://forum.xbmc.org/showthread.php?t=65769&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation Setup and Use of mythicalLibrarian ==&lt;br /&gt;
This section covers installation, setup, and use of mythicalLibrarian. After completing this section, mythicalLibrarian can run autonomously without user intervention. See the Librarian Interfaces for information on notifications and automation tasks.&lt;br /&gt;
&lt;br /&gt;
==== Installation ====&lt;br /&gt;
This section covers installation of mythicalLibrarian.&lt;br /&gt;
&lt;br /&gt;
===== Automatic Installation on linux =====&lt;br /&gt;
This section covers automatic installation and upgrade. Automatic upgrade will allow you to choose between downloading the newest stable, the newest SVN or continuing with the last downloaded version. I encourage SVN usage as it will assist with development.&lt;br /&gt;
&lt;br /&gt;
* type the following:&lt;br /&gt;
 sudo apt-get install curl agrep&lt;br /&gt;
 mkdir ~/.mythicalLibrarian &amp;amp;&amp;amp; mkdir ~/.mythicalLibrarian/mythicalSetup &amp;amp;&amp;amp; cd ~/.mythicalLibrarian/mythicalSetup&lt;br /&gt;
 curl http://mythicallibrarian.googlecode.com/svn/trunk/mythicalSetup.sh&amp;gt;./mythicalSetup.sh&lt;br /&gt;
 sudo chmod +x ./mythicalSetup.sh &amp;amp;&amp;amp; sudo ./mythicalSetup.sh&lt;br /&gt;
* mythicalSetup&#039;s first prompt will ask you to update the working copy of mythicalLibrarian or to continue with setup. If you download a new version, it will bring you back to the same prompt at which point you will select continue. This gives you the option to upgrade, or just configure the current version.&lt;br /&gt;
* mythicalSetup will run you through a series of prompts and perform the setup of mythicalLibrarian and all of it&#039;s features&lt;br /&gt;
&lt;br /&gt;
===== Installation on Mac OS X =====&lt;br /&gt;
This section covers installation on Mac OS X. &lt;br /&gt;
&lt;br /&gt;
====== Mac OSX Dependencies ======&lt;br /&gt;
This section will cover compiling binaries needed for fuzzy logic capabilities and a terminal-based menu-driven interface&lt;br /&gt;
&lt;br /&gt;
Mac OSX does not have the packages &amp;quot;tre&amp;quot; or &amp;quot;dialog&amp;quot; by default. These packages are required to run mythicalLibrarian and are available through macports. Installation of these packages is required for first time use.&lt;br /&gt;
&lt;br /&gt;
* Install Xcode Tools &lt;br /&gt;
note: You can get Xcode from your OSX installation DVD in &amp;quot;Optional Installs/Xcode Tools/Xcode Tools.pkg&amp;quot; or you can log onto the Mac Dev center at apple.com and download it for free.&lt;br /&gt;
* Install X11&lt;br /&gt;
note: you can get X11 from your OSX installation DVD in &amp;quot;Optional Installs/Optional Installs.pkg&amp;quot; or you can build it from online sources&lt;br /&gt;
* Obtain and install MacPorts &lt;br /&gt;
note: you can get MacPorts here: http://distfiles.macports.org/MacPorts/MacPorts-1.8.2.tar.bz2 or navigate to their website here: http://www.macports.org/install.php&lt;br /&gt;
* Open Terminal from Finder:Applications/Utilities/Terminal&lt;br /&gt;
* Type the following&lt;br /&gt;
 sudo port install tre&lt;br /&gt;
 sudo port install dialog&lt;br /&gt;
&lt;br /&gt;
====== Automatic Installation on OS X ======&lt;br /&gt;
This section will cover installation of mythicalSetup, which will provide an easy interface to install mythicalLibrarian&lt;br /&gt;
* Type the following into the Terminal&lt;br /&gt;
 mkdir ~/.mythicalLibrarian &amp;amp;&amp;amp; mkdir ~/.mythicalLibrarian/mythicalSetup &amp;amp;&amp;amp; cd~/.mythicalLibrarian/mythicalSetup&lt;br /&gt;
 curl http://mythicallibrarian.googlecode.com/svn/trunk/mythicalSetup.sh&amp;gt;./mythicalSetup.sh&lt;br /&gt;
 sudo chmod +x ./mythicalSetup.sh &amp;amp;&amp;amp; sudo ./mythicalSetup.sh&lt;br /&gt;
* mythicalSetup&#039;s first prompt will ask you to update the working copy of mythicalLibrarian or to continue with setup. If you download a new version, it will bring you back to the same prompt at which point you will select continue. This gives you the option to upgrade, or just configure the current version.&lt;br /&gt;
* mythicalSetup will run you through a series of prompts and perform the setup of mythicalLibrarian and all of it&#039;s features&lt;br /&gt;
&lt;br /&gt;
===== Easy Upgrades =====&lt;br /&gt;
This section covers upgrading of mythicalLibrarian.&lt;br /&gt;
&lt;br /&gt;
* type the following&lt;br /&gt;
 sudo mythicalLibrarian --update&lt;br /&gt;
* mythicalLibrarian will download the newest version of mythicalSetup and perform the upgrade. mythicalLibrarian will remember your settings from the last time mythicalSetup was run.&lt;br /&gt;
&lt;br /&gt;
===== Manual Installation for Linux =====&lt;br /&gt;
This section covers manual installation on Linux. Automatic installation is recommended: see below.&lt;br /&gt;
* Install dependencies&lt;br /&gt;
 sudo apt-get install curl agrep libnotify-bin&lt;br /&gt;
dependencies breakdown:&lt;br /&gt;
# curl downloads web pages as text. &lt;br /&gt;
# agrep or tre provides fuzzy logic. &lt;br /&gt;
# libnotify-bin provides GNOME desktop notifications&lt;br /&gt;
&lt;br /&gt;
* Download the current version of mythcalLibrarian from this [http://mythicallibrarian.googlecode.com/files/mythicalLibrarian download link]&lt;br /&gt;
* Place mythicalLibrarianin /usr/local/bin&lt;br /&gt;
* mkdir /home/mythtv/.mythicalLibrarian&lt;br /&gt;
* Make mythicalLibrarian executable by typing the following:&lt;br /&gt;
 sudo chmod +x /usr/local/bin/mythicalLibrarian&lt;br /&gt;
&lt;br /&gt;
[[File:Mythicalsetthumb.jpg|right|thumb|250px| Click this link to see the big picture http://wiki.xbmc.org/images/4/4e/Mythicalsettingss.jpg]]&lt;br /&gt;
This section covers basic setup of mythicalLibrarian. To make mythicalLibrarian work, you will need to set the following settings located in text format within mythicalLibrarian.sh.You can see a picture of the settings to the right.&lt;br /&gt;
* MoveDir - this is your primary episode move dir.&lt;br /&gt;
* AlternateMoveDir- this is the folder where episodes will be moved if movedir cannot be used&lt;br /&gt;
* FailSafeDir- folder to place links if files cannot be moved&lt;br /&gt;
* PrimaryMovieDir-Folder to place movies&lt;br /&gt;
* AlternateMovieDir- this is where movies will be placed if PrimaryMovieDir fails&lt;br /&gt;
* Database username and password should be mythtv/mythtv. When installing MythTV a root user and password was assigned by the user.&lt;br /&gt;
Leave the rest as default, or enable and disable settings as desired. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extra settings documentation&#039;&#039;&#039;&lt;br /&gt;
The SYMLINK variable specifies to mythicalLibrarian how to treat the files. There are three modes to SYMLINK. MOVE is the preferred mode. &lt;br /&gt;
* SYMLINK=MOVE Allows XBMC to see the file and know when it has been removed from the library. When SYMLINK=MOVE and you have set up mythtv-setup to follow symlinks when deleting, MythTV&#039;s Library will function normally and XBMC will have access to all content.&lt;br /&gt;
* SYMLINK=LINK Keeps the original MythTV file in it&#039;s place and creates a link for XBMC to read. This link is not maintained and the symlink will remain after the original file has been deleted&lt;br /&gt;
* SYMLINK=Disabled Moves the file to the new location and does not provide a symlink to MythTV. On top of this, it will purge MythTV&#039;s database of all information and pictures relating to the video content. MythTV will have no memory of the recording. This mode can be used if you wish to delete files from XBMC.&lt;br /&gt;
[[File:Movelink.gif|right|thumb|250 px|Represents awareness of files between MythTV and XBMC]]Movelink.gif&lt;br /&gt;
&lt;br /&gt;
==== Use of mythicalLibrarian on MythTV Applications ====&lt;br /&gt;
This section covers setup of MythTV without any changes to mythicalLibrarian settings. This will create only a basic setup. Make sure to follow up by checking the /home/mythtv/mythicalLibrarian/output.log file after the first run.&lt;br /&gt;
&lt;br /&gt;
* Download mythicalLibrarian.sh and put it on your desktop: http://mythicallibrarian.googlecode.com/files/mythicalLibrarian.sh&lt;br /&gt;
* Download librarian-notify-send and put it on your desktop: http://mythicallibrarian.googlecode.com/files/librarian-notify-send&lt;br /&gt;
* Type the following into a terminal&lt;br /&gt;
 sudo apt-get install curl agrep libnotify-bin&lt;br /&gt;
 sudo mkdir /home/mythtv /home/mythtv/mythicalLibrarian /home/mythtv/Episodes /home/mythtv/Movies /home/mythtv/Videos /home/mythtv/FailSafe&lt;br /&gt;
 sudo chown -R mythtv:mythtv /home/mythtv /home/mythtv/mythicalLibrarian /home/mythtv/Episodes /home/mythtv/Movies /home/mythtv/Videos /home/mythtv/FailSafe&lt;br /&gt;
 sudo mv ~/Desktop/mythicalLibrarian.sh /home/mythtv/mythicalLibrarian/mythicalLibrarian.sh&lt;br /&gt;
 sudo mv ~/Desktop/librarian-notify-send /usr/local/bin/librarian-notify-send&lt;br /&gt;
 sudo chmod +x /usr/local/bin/librarian-notify-send&lt;br /&gt;
 sudo chmod +x /home/mythtv/mythicalLibrarian/mythicalLibrarian.sh&lt;br /&gt;
&lt;br /&gt;
===== MythTV settings =====&lt;br /&gt;
See use of mythicalLibrarian on MythTV Applications for setting up mythtv here: http://wiki.xbmc.org/index.php?title=MythicalLibrarian&amp;amp;action=edit&amp;amp;section=4&lt;br /&gt;
 sudo adduser *Your User Name here* mythtv&lt;br /&gt;
* Click System/Administration MythTV Backend setup&lt;br /&gt;
* Select &amp;quot;1. General&amp;quot; then select next until you get to screen 3 &lt;br /&gt;
* Check &amp;quot;Follow symbolic links when deleting files&amp;quot;. &lt;br /&gt;
* Select next until you get to screen 8&lt;br /&gt;
* Check &amp;quot;Allow user job #1 Jobs&amp;quot;&lt;br /&gt;
* Select next until you get to screen 10&lt;br /&gt;
 UserJob #1 Description: mythicalLibrarian&lt;br /&gt;
 User Job #1 Command: /usr/local/bin/mythicalLibrarian &amp;quot;%DIR%/%FILE%&amp;quot;&lt;br /&gt;
* Select Finish to exit&lt;br /&gt;
* Select 6. Storage Directories&lt;br /&gt;
* Select Default&lt;br /&gt;
* Add a recording folder to which MythTV has access ie. /home/mythtv/Videos&lt;br /&gt;
* Add additional folders if required. &lt;br /&gt;
* Remove folders to which MythTV cannot run move jobs such as /lib or /var&lt;br /&gt;
&lt;br /&gt;
==== Use of mythicalLibrarian on non-MythTV Applications ====&lt;br /&gt;
This section covers setup of non-MythTV applications. Make sure permissions are set correctly.&lt;br /&gt;
* edit mythicalLibrarian.sh and set Database=Disabled&lt;br /&gt;
* Set mythicalLibrarian up to run the job as follows:&lt;br /&gt;
 /home/mythtv/mythicalLibrarian/mythicalLibrarian.sh &amp;quot;Show name&amp;quot; &amp;quot;Show Title&amp;quot; &amp;quot;File to rename&amp;quot;&lt;br /&gt;
* see Setting the Settings in this section&lt;br /&gt;
&lt;br /&gt;
== Using the command line ==&lt;br /&gt;
mythicalLibrarian has many command line switches. This section covers command line use of mythicalLibrarian.&lt;br /&gt;
===== mythicalLibrarian Normal Operation =====&lt;br /&gt;
This section covers normal operation of mythicalLibrarian&lt;br /&gt;
When using mythicalLibrarian to rename files individually without database access, you can run the following command. Without database access, mythicalLibrarian can only look up episodes with title and subtitle.&lt;br /&gt;
 mythicalLibrarian /home/mythtv/videos/1024_33020100321.mpg &amp;quot;spongebob squarepants&amp;quot; &amp;quot;giant squidward&amp;quot;&lt;br /&gt;
 mythicalLibrarian /path/to/video/file.ext &amp;quot;episode title&amp;quot; &amp;quot;episode subtitle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
When using mythicalLibrarian with the mythtv database access you can run mythicalLibrarian as the following command.&lt;br /&gt;
 mythicalLibrarian /home/mythtv/videos/1024_33020100321.mpg&lt;br /&gt;
 mythicalLibrarian /path/to/mythtv/videos/filename.ext&lt;br /&gt;
mythicalLibrarian will integrate with the mythtv database as a user job after recordings. The mythtv user job for this is:&lt;br /&gt;
 /usr/local/bin/mythicalLibrarian &amp;quot;%DIR%/%FILE%&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===== mythicalLibrarian --help =====&lt;br /&gt;
This section covers -h|--help&lt;br /&gt;
 mythicalLibrarian --help&lt;br /&gt;
--help will display a help message containing helpful information&lt;br /&gt;
===== mythicalLibrarian --scan =====&lt;br /&gt;
This section covers -s|--scan&lt;br /&gt;
 mythicalLibrarian --scan mpg /home/mythtv/Videos&lt;br /&gt;
 mythicalLibrarian --scan ext /path/to/video/files&lt;br /&gt;
--scan will search for files automatically and process them. &lt;br /&gt;
--scan has two parmaters. The first parameter is the extension of the files to search. The seccond parameter is the folder to search.&lt;br /&gt;
&lt;br /&gt;
===== mythicalLibrarian --doover =====&lt;br /&gt;
This section covers -d|--doover&lt;br /&gt;
 mythicalLibrarian --doover &lt;br /&gt;
mythicalLibrarian keeps track of each file which fails while it runs. At any time you can type &amp;quot;mythicalLibrarian --doover&amp;quot; and all previously failed files will be processed. This process cannot be interrupted for any reason or data loss may occour.&lt;br /&gt;
===== mythicalLibrarian --undo =====&lt;br /&gt;
This section covers -u|--undo&lt;br /&gt;
 mythicalLibrarian --undo&lt;br /&gt;
mythicalLibrarian keeps track of every file which has been moved. At any time you can type mythicalLibrarian --undo and all files will be reverted to their original state. There is no indication that --doover is running until it completes. This process cannot be interrupted or data loss may occour.&lt;br /&gt;
===== mythicalLibrarian --update =====&lt;br /&gt;
This section covers --update&lt;br /&gt;
 sudo mythicalLibrarian --update&lt;br /&gt;
--update is a complicated process. First, mythicalLibrarian will download a copy of the mythicalSetup from the SVN repository. Next, it will download a copy of mythicalLibrarian from the SVN repository. mythicalSetup will then separate the program from the user settings. mythicalSetup perform several checks and bring up a GUI. The GUI will ask the user for preferences. mythicalSetup will attempt to set permissions and settings to appropriate defaults based upon user settings and the system. mythicalSetup will then combine the user settings with the separated program and place the file in /usr/local/bin. mythicalSetup will then call mythicalLibrarian --mythicalDiagnostics, which checks out your system. mythicalDiagnostics then calls mythcalLibrarian testfile.ext &amp;quot;mister&amp;quot; &amp;quot;episode 1332&amp;quot;, which puts mythicalLibrarian into a diagnostic run. Once complete, the mythicalLibrarian in test mode, mythicalDiagnostics, mythicalSetup and update are closed and results are returned to the user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; it is always a good idea to run mythicalLibrarian --doMaintenance after an update.&lt;br /&gt;
&lt;br /&gt;
===== mythicalLibrarian --mythicalDiagnostics =====&lt;br /&gt;
This section covers -m|--mythicalDiagnostics&lt;br /&gt;
 mythicalLibrarian --mythicalDiagnostics&lt;br /&gt;
--mythicalDiagnostics is a step-by-step functions check of mythicalLibrarian which will test functionality. It tests for all &#039;&#039;&#039;known&#039;&#039;&#039; causes of failure. This is a good troubleshooting tool for you to work the kinks out of your settings. mythicalLibrarian runs a series of diagnostics and then runs a search for an episode of mr rodgers with the file name set to testfile.ext. testfile.ext truncates the execution of mythicalLibrarian before any file operations occur. mythicalDiagnostics will return results which should look like this &lt;br /&gt;
   All tests complete            RESULTS&lt;br /&gt;
   Installed Packages:        ***PASSED*** &lt;br /&gt;
   Notifications Test:        ***PASSED***&lt;br /&gt;
   XBMC Communications:       ***PASSED***&lt;br /&gt;
   File System Checks:        ***PASSED***&lt;br /&gt;
   mythicalTesting:           ***PASSED***&lt;br /&gt;
   Overall mythicalReadiness: ***PASSED***&lt;br /&gt;
 -----End of diagnostics-----&lt;br /&gt;
Notifications test and xbmc communications test will not fail overall mythicalReadiness. Only critical checks effect overall mythicalReadiness. Critical checks are dependencies, file system, and mythicalTesting.&lt;br /&gt;
&lt;br /&gt;
== User Jobs ==&lt;br /&gt;
mythicalLibrarian allows flexibility in it&#039;s programming through the use of [[MythicalLibrarian UserJobs]]. &lt;br /&gt;
&lt;br /&gt;
==== Benefeits of user jobs ====&lt;br /&gt;
User Jobs are supported to allow for your individual custom set-up to be personalized. You can rename files, and set custom commands to be run after execution of mythicalLibrarian. By using [[MythicalLibrarian UserJobs]] in mythicalLibrarian you can upgrade without loosing the work you have put into it.&lt;br /&gt;
&lt;br /&gt;
Please post in the forums about any user jobs you have come up with. They will be of use to others. http://forum.xbmc.org/showthread.php?t=65644&lt;br /&gt;
&lt;br /&gt;
== Librarian Interfaces ==&lt;br /&gt;
mythicalLibrarian has the capability to send notifications to lib-notify on the DBUS of a Linux computer and keep your XBMC library up-to-date and clean. This section covers setup of notifications of the various platforms supported by mythicalLibrarian&lt;br /&gt;
&lt;br /&gt;
==== XBMC Commands ====&lt;br /&gt;
[[File:Xbmc notification.jpg|right|http://www.xbmc.org Another Sucessful library addition]]&lt;br /&gt;
This section covers setup of XBMC Commands. mythicalLibrarain can keep XBMC&#039;s library up to date, clean out deleted files and send a notification upon a completed job. &lt;br /&gt;
* edit mythicalLibrarian.sh in your text editor&lt;br /&gt;
* set XBMCUpdate, XBMCClean, and XBMCNotify to the desired settings, either Enabled, or Disabled&lt;br /&gt;
* Set the IP and port under XBMCIPs. Separate IP addresses with a space. eg.&lt;br /&gt;
 XBMCIPs=( &amp;quot;192.168.1.110:8080 192.168.1.111:8080 XBOX:8080&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
==== GNOME Desktop Notifications ====&lt;br /&gt;
[[File:GNOMENotificationsthumbs.jpg|right|thumb|250px|Another Sucessful library addition ]]&lt;br /&gt;
* mythicalLibrarian requires no-password sudo access to send GNOME notifications.&lt;br /&gt;
&lt;br /&gt;
Desktop notifications can be turned on and off from within the script settings. Desktop notifications take advantage of the lib-notify DBUS feature. DBUS is only supported on Linux.&lt;br /&gt;
&lt;br /&gt;
Desktop notifications are used on the back-end machine by mythicalLibrarian to let you know that a file move operation is in process or an operation has completed. The external script librarian-notify-send becomes the specified username and sends a GNOME desktop notification. librarian-notify-send requires the user mythtv to have access to the sudo command without a password if run as a user job. &lt;br /&gt;
&lt;br /&gt;
* Get the current version of librarian-notify-send from Google Code [http://mythicallibrarian.googlecode.com/files/librarian-notify-send download link]&lt;br /&gt;
* place the file in /usr/local/bin&lt;br /&gt;
* add mythtvall group&lt;br /&gt;
 sudo addgroup mythtvall&lt;br /&gt;
* add mythtv to the mythtvall group&lt;br /&gt;
 sudo adduser mythtv mythtvall&lt;br /&gt;
* edit the sudoers file&lt;br /&gt;
 sudo visudo&lt;br /&gt;
* add the following line to the sudoers&lt;br /&gt;
 %mythtvall ALL=(ALL) NOPASSWD:ALL&lt;br /&gt;
* hit ctrl-x and then y, then enter to write out and quit visudo&lt;br /&gt;
* make librarian-notify-send executable by typing&lt;br /&gt;
 sudo chmod +x /usr/local/bin/librarian-notify-send&lt;br /&gt;
* edit mythicalLibrarian and set Notify=Enabled and NotifyUserName=*your user name*&lt;br /&gt;
&lt;br /&gt;
You are done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
While mythicalLibrarian is designed to run fully autonomously, configuration issues come up from time to time. This section deals with these set-up issues&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;Random Errors&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for random errors which make no sense. These include errors which make you think mythicalLibrarian simply does not work.&lt;br /&gt;
&lt;br /&gt;
==== Dependencies ====&lt;br /&gt;
This section covers dependencies of mythicalLibrarian. Usually you can find dependencies by typing &amp;quot;command -V&amp;quot; or &amp;quot;command --version&amp;quot;&lt;br /&gt;
* The following are the versions of the binaries which mythicalLibrarian depends upon and are not in OS Karmic Koala.&lt;br /&gt;
 agrep -V This is agrep version 3.0, 1994.&lt;br /&gt;
 curl 7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15&lt;br /&gt;
 dialog Version: 1.1-20080819&lt;br /&gt;
 mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using EditLine wrapper&lt;br /&gt;
 notify-send 0.4.5&lt;br /&gt;
 python2.6&lt;br /&gt;
* The Following are the versions of the binaries which mythicalLibrarian depends upon and are included in OS Karmic Koala.&lt;br /&gt;
 bash GNU bash, version 4.0.33(1)-release (i486-pc-linux-gnu)&lt;br /&gt;
 (GNU coreutils) 7.4&lt;br /&gt;
 sed GNU sed version 4.2.1&lt;br /&gt;
 grep GNU grep 2.5.4&lt;br /&gt;
 awk GNU Awk 3.1.6&lt;br /&gt;
 ifconfig 1.42 (2001-04-13) net-tools 1.60&lt;br /&gt;
 replace  Ver 1.4 for debian-linux-gnu at i486&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;Permission Errors&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for permission errors.&lt;br /&gt;
==== permission errors when run from terminal ====&lt;br /&gt;
Ensure the user running mythicalLibrarian has permission to run mythicalLibrarian. This includes read and write permissions to the working folder (default=~/mythicalLibrarian) &lt;br /&gt;
see this post for more information: http://forum.xbmc.org/showpost.php?p=489246&amp;amp;postcount=36&lt;br /&gt;
==== mythicalLibrarian is not generating a log ====&lt;br /&gt;
Make sure mythicalLibrarian.sh is executable. You can set the permissions by typing &amp;quot;sudo chmod +x /path/to/mythicalLibrarian.sh&amp;quot;&lt;br /&gt;
note: mythtv will be the user running mythicalLibrarian when run as a user job from MythTV&lt;br /&gt;
see this post for more information: http://forum.xbmc.org/showpost.php?p=489246&amp;amp;postcount=36&lt;br /&gt;
&lt;br /&gt;
remember, the user who launched mythtv-backend has to have permissions. You can check this manually by using the following:&lt;br /&gt;
 sudo su *user who launched mythtv-backend*&lt;br /&gt;
 mythicalLibrarian --mythicalDiagnostics&lt;br /&gt;
where *user who launched mythtv-backend* is the username of the user who launched mythtv-backend&lt;br /&gt;
&lt;br /&gt;
==== Files are not being renamed or moved, but they are owned my mythtv ====&lt;br /&gt;
mythtv must have full access to the files. the /var/ folder does not allow users to move files without special permissions. Try moving your recording directory to your /home/ folder&lt;br /&gt;
==== mythicalLibrarian works from terminal, but not from user job ====&lt;br /&gt;
&amp;quot;mythtv&amp;quot; is the user calling the user job. If the user running mythicalLibrarian does not have access to the file, then mythicalLibrarian will not have access to the file. MythTV users can troubleshoot by changing your username with &amp;quot;sudo su mythtv&amp;quot;, then running mythicalLibrarian. &lt;br /&gt;
==== mythcialLibrarian will not copy to my NFTF/FAT/EXT3 mounted drive ====&lt;br /&gt;
Additonal file systems may require editing the /etc/fstab file to change permissions. Search your OS documentation for information on how to mount a file system under a different username. Alternately, you may wish to add the user running mythicalLibrarian to your user group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;XBMC library is not updated&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for XBMC specific issues&lt;br /&gt;
==== XBMC does not show notifications ====&lt;br /&gt;
mythicalLibrarian requires the user to set the IP address of XBMC within mythicalLibrarian.sh&lt;br /&gt;
* ensure you have a static IP set up in your router, see your router&#039;s manufacturer&#039;s website for more information&lt;br /&gt;
* Open mythicalLibrarian.sh and edit the &amp;quot;XBMCIPs&amp;quot; setting to your XBMC IP.&lt;br /&gt;
==== XBMC shows notifications but Library is not updated ====&lt;br /&gt;
* Add a source http://wiki.xbmc.org/?title=Adding_Media_Sources&lt;br /&gt;
* Set the content of your video library http://wiki.xbmc.org/?title=Set_Contents_%28Video_Library%29&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;OS Speciffic issues&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for OS Specific issues&lt;br /&gt;
==== Gentoo ====&lt;br /&gt;
Gentoo OS requires upgrade of many packages. For sure you will need the package TRE. See here for version information: http://forum.xbmc.org/showpost.php?p=495697&amp;amp;postcount=62&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
Arch Linux utilizes Python3 for it&#039;s primary Python interperater. Python 2.6 is used for MythDataGrabber(the program responsible for grabbing information from the MythTV database). You will need to install Python2.6&lt;br /&gt;
 wget http://aur.archlinux.org/packages/python26/python26.tar.gz &amp;amp;&amp;amp; tar xvf python26.tar.gz&lt;br /&gt;
 cd python26 &amp;amp;&amp;amp; makepkg -s&lt;br /&gt;
 pacman -U python26-2.6.5-1-i686.pkg.tar.gz&lt;br /&gt;
After installing Python2.6, the MythDataGrabber shebang needs to be modified to specify the Python2.6 interperater. The first line in /usr/local/bin/MythDataGrabber should read&lt;br /&gt;
 #! /usr/bin/python2.6&lt;br /&gt;
see here for more information http://forum.xbmc.org/showpost.php?p=689145&amp;amp;postcount=714&lt;br /&gt;
&lt;br /&gt;
==== Mac OS X ====&lt;br /&gt;
If mythtv-backend is launched by a different user then yourself, then you will need to set permissions for that user. See here for more information: http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;Problems after upgrade to new version&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for issues after upgrade when the previous version was working&lt;br /&gt;
==== Episodes are not identifed ====&lt;br /&gt;
When episodes are not identified after an upgrade it is because the database handling has been upgraded, however, the database itself has not. Delete all database folders to correct the issue http://forum.xbmc.org/showpost.php?p=492001&amp;amp;postcount=40&lt;br /&gt;
==== mythicalLibrarian does not generate any files in it&#039;s working directory ====&lt;br /&gt;
Ensure the user running mythicalLibrarian has permission to run mythicalLibrarian. This includes read and write permissions to the working folder (default=~/mythicalLibrarian)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;Episode recognition problems&#039;&#039;&#039; ===&lt;br /&gt;
==== Series title is not properly recognized ====&lt;br /&gt;
TheTvDb.com does not have the proper Zap2it id included. Edit it. &lt;br /&gt;
The program guide uses a generic name. Apply a showtranslation. See documentation included within mythicalLibrarian.sh.&lt;br /&gt;
=== Episode title was not properly recognized ===&lt;br /&gt;
TheTvDb.com is down. Wait for TheTvDb.com to resume and then run the doover.sh file generated by mythicalLibrarian&lt;br /&gt;
Ensure the data at TheTvDb is accurate. Correct if needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039; Desktop Notifications&#039;&#039;&#039; ===&lt;br /&gt;
This section of Troubleshooting is designated for GNOME Desktop Notifications issues&lt;br /&gt;
==== Desktop Notifications are not showing up ====&lt;br /&gt;
Ensure you have Notify=Enabled set in mythicalLibrarian.sh See this section for more information http://wiki.xbmc.org/index.php?title=MythicalLibrarian&amp;amp;action=submit#GNOME_Desktop_Notifications&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Guide Data errors ===&lt;br /&gt;
for SchedulesDirect/Tribune/Zap2it set the GuideDataType setting in mythicalLibrarian.sh to &amp;quot;SchedulesDirect&amp;quot;&lt;br /&gt;
==== Currently Unsupported Guide data types ====&lt;br /&gt;
Support for guide data will be available with help from you. See this post: http://forum.xbmc.org/showpost.php?p=496721&amp;amp;postcount=90&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Issues ===&lt;br /&gt;
This section deals with issues relating to upgrading mythicalLibrarian&lt;br /&gt;
&lt;br /&gt;
when upgrading mythicalLibrarian there may be random errors. When upgrading after more then a month it is a good idea to run &lt;br /&gt;
 mythicalLibrarian --doMaintenance&lt;br /&gt;
When running do maintenance, you should ensure that all of your removable drives are attached. doMaintenance will flush the cache and mythicalLibrarian&#039;s internal database.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
This section provides miscellanious fixes for user issues.&lt;br /&gt;
&lt;br /&gt;
==== mythicalFileRestoration ====&lt;br /&gt;
When running in Symlink=Disabled mode, mythicalLibrarian deletes database information. In older versions of mythicalLibrarian all files were logged in the undo and doover que. When running in doover or undo mode, the files are first reverted to the original state and then reprocessed later. Because there is no database information, they cannot be reprocessed. However, all hope is not lost. The logs contain valuable information and [http://twitter.com/szczys Mike Szczys] wrote a small Python application which will review these logs and restore the files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; The script does check to make sure it&#039;s not overwriting existing files. However, it doesn&#039;t creat directories. You must manually create any subdirectories that don&#039;t already exist or the files will not be moved.&lt;br /&gt;
&lt;br /&gt;
file:/usr/local/bin/mythicalFileRestoration&lt;br /&gt;
 #! /usr/bin/python2.6&lt;br /&gt;
 import os&lt;br /&gt;
 myfile = &amp;quot;~/.mythicalLibrarian/undo.sh.old&amp;quot;&lt;br /&gt;
 f = open(myfile,&#039;r&#039;)&lt;br /&gt;
 for line in f:&lt;br /&gt;
    if line.startswith(&#039;test -f&#039;):&lt;br /&gt;
        file1 = line.split(&#039; &amp;amp;&amp;amp; &#039;)[0]&lt;br /&gt;
        file1 = file1.replace(&#039;test -f &#039;,&#039;&#039;)&lt;br /&gt;
        file2 = line.split(&#039; &amp;amp;&amp;amp; &#039;)[1].split(&#039; &#039;)[-1]&lt;br /&gt;
        if os.path.isfile(file2[1:-1]):&lt;br /&gt;
            if not os.path.isfile(file1[1:-1]):&lt;br /&gt;
               cmdLine = &#039;mv &#039; + file2 + &#039; &#039; + file1&lt;br /&gt;
               print cmdLine&lt;br /&gt;
               # uncomment the next line to activate the script &lt;br /&gt;
               # print os.system(cmdLine)&lt;br /&gt;
Run this file first and view the output, if it works properly, uncomment the last line to activate it.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
mythicalLibrarian is a spawn from the project BashSExx and [[MythSExx]]. &lt;br /&gt;
&lt;br /&gt;
[[MythSExx]] and BashSExx have been depreciated.&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Mac OS X]]&lt;br /&gt;
[[Category:Supplemental tools]]&lt;br /&gt;
[[Category:Live TV]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78143</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78143"/>
		<updated>2014-08-24T18:28:18Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Add Pyhton Interpreter Path */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Python Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78140</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78140"/>
		<updated>2014-08-24T17:53:08Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Prerequisite */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Python interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pyhton Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78139</id>
		<title>Archive:Debug Python Scripts with Eclipse</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=Archive:Debug_Python_Scripts_with_Eclipse&amp;diff=78139"/>
		<updated>2014-08-24T16:21:22Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Identify where PyDev remote debugger Python files are */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]|[[Add-on development]]|[[Python development]]}}&lt;br /&gt;
&lt;br /&gt;
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.&lt;br /&gt;
&lt;br /&gt;
Note: Follow this link [[HOW-TO debug Python Scripts|Debugging Python Scripts on Linux with WinPDB]] for more information if you prefer to use WinPDB instead.&lt;br /&gt;
&lt;br /&gt;
Note: The information provided herein is also applicable to user with [http://www.aptana.com/ Aptana Studio 3] installation which come pre-installed with pydev. For this case, you can skip to [[#Configure Pydev and Eclipse|Configure Pydev and Eclipse]] after the Aptana Studio 3 installation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* Any platform able to run [http://www.eclipse.org/downloads/ Eclipse IDE] (Windows 32bit-64bit, Mac Carbon 32bit-64bit, Mac Cocoa 32bit-64bit, Linux 32bit-64bit): it is the platform from where you will run the debugger IDE&lt;br /&gt;
* Pyhton interpreter 2.4 (use the same version as XBMC or version &amp;lt;= 2.7 ) install on the machine running Eclipse&lt;br /&gt;
* Any platform running XBMC (Xbox, Linux, MACOSX, Windows): it is the platform running Python scripts/plugin connecting with the remote debugger.&lt;br /&gt;
:XBMC installed on Ubuntu (should work just fine on Windows and Mac too)&lt;br /&gt;
* [http://pydev.org/ Pydev] plugin for Eclipse IDE: Pydev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prepare and Setup Eclipse ==&lt;br /&gt;
&lt;br /&gt;
=== Install Eclipse ===&lt;br /&gt;
* Download [http://www.eclipse.org/downloads/ Eclipse IDE] and install it&lt;br /&gt;
Note: in our example Eclipse Galileo (3.5.1) is used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install Pydev in Eclipse ===&lt;br /&gt;
* In Eclipse go in: &#039;&#039;Help&#039;&#039; -&amp;gt; &#039;&#039;Install New Software...&#039;&#039;&lt;br /&gt;
* Click on the &#039;&#039;Add&#039;&#039; button and add Pydev website as a source: http://pydev.org/updates&lt;br /&gt;
* You will see the window below:&lt;br /&gt;
[[File:EclipsePydevUpdate.png]]&lt;br /&gt;
* Check &#039;&#039;PyDev&#039;&#039; box and follow the steps in order to install PyDev&lt;br /&gt;
Note: in our example PyDev 1.5.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configure Pydev and Eclipse ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pyhton Interpreter Path ====&lt;br /&gt;
* Go in &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Interpreter - Python&#039;&#039;&lt;br /&gt;
* Click on button &#039;&#039;New...&#039;&#039;&lt;br /&gt;
* In the new prompt, enter the &#039;&#039;Interpreter Name: Python&#039;&#039;, and Browse for your Python Interpreter 2.4 &#039;&#039;python.exe&#039;&#039; file and select it. After that you should see something like this:&lt;br /&gt;
[[File:EclipsePydevPref.png|none]]&lt;br /&gt;
This will help in order to have Python code completion (except for XBMC modules)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev view to Eclipse ====&lt;br /&gt;
* On the top right corner click on the View button on select &#039;&#039;Others&#039;&#039;&lt;br /&gt;
[[File:EclipsePydevViewMenu.png]]&lt;br /&gt;
* Select Pydev then OK, a PyDev View Button should be now available on the top right corner&lt;br /&gt;
[[File:EclipsePydevViewMenu2.png]]&lt;br /&gt;
Use this view for your developments in Python for XBMC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Add Pydev Start/Stop debug server buttons ====&lt;br /&gt;
* In the menu bar select &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Customize perspective...&#039;&#039;, a window &#039;&#039;Customize Perspective - PyDev&#039;&#039; will open&lt;br /&gt;
* Select &#039;&#039;Command Groups Availability&#039;&#039; Tab&lt;br /&gt;
* Check &#039;&#039;Pydev Debug&#039;&#039; box and OK&lt;br /&gt;
* You should see 2 new buttons in your toolbar:&lt;br /&gt;
[[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Setting the remote debugger port (optional) ====&lt;br /&gt;
If you do not want to use the default port (usually 5678) you can set it up:&lt;br /&gt;
* Go to &#039;&#039;Window&#039;&#039; -&amp;gt; &#039;&#039;Preferences&#039;&#039;&lt;br /&gt;
* &#039;&#039;Pydev&#039;&#039; then &#039;&#039;Debug&#039;&#039; you can define here the port and the timeout you want&lt;br /&gt;
&lt;br /&gt;
==== Setting up Predefined Completions (optional) ====&lt;br /&gt;
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc). &lt;br /&gt;
&lt;br /&gt;
In order to overcome this, you can run the [http://forum.xbmc.org/showthread.php?t=79070 PyDev Predefined Completions Creator addon] and [http://pydev.org/manual_101_interpreter.html#PyDevInterpreterConfiguration-PredefinedCompletions setup Eclipse] to reference this file:&lt;br /&gt;
# Download the &#039;PyDev Predefined Completions Creator&#039; Addon (eg. System &amp;gt; Settings &amp;gt; Addons &amp;gt; XBMC.org &amp;gt; Program Add-Ons)&lt;br /&gt;
# Navigate to the newly installed Addon (eg. Programs from the home screen)&lt;br /&gt;
# Open the context menu for newly installed addon and select &#039;Add-on Settings&#039;&lt;br /&gt;
# Set the location to save the help docs to and save the new settings (This can be anywhere on your system - we&#039;ll configure it in Eclipse later)&lt;br /&gt;
# Select the add-on to run it (the addon should run and close quickly)&lt;br /&gt;
# Open Eclipse and select Window &amp;gt; Preferences &amp;gt; PyDev &amp;gt; Interpreter - Python&lt;br /&gt;
# From the &#039;Predefined&#039; tab, click the new button and select the folder you created in the step above&lt;br /&gt;
# Press Apply / OK to ensure the changes are saved&lt;br /&gt;
&lt;br /&gt;
== Create a Python script/plugin for XBMC in Eclipse ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create a new PyDev Project ===&lt;br /&gt;
Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).&amp;lt;br\&amp;gt;&lt;br /&gt;
Let&#039;s say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\XBMC\addons\myscript1&lt;br /&gt;
C:\XBMC\addons\myscript2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With myscript1 &amp;amp; myscript2 being sub-directories of &#039;&#039;C:\XBMC\addons&#039;&#039; each containing the Default.py scripts.&amp;lt;br\&amp;gt;&lt;br /&gt;
First you need to define the Python project workspace:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Switch Workspace&#039;&#039; -&amp;gt; &#039;&#039;Other...&#039;&#039;&lt;br /&gt;
* &#039;&#039;Browse&#039;&#039; to the parent directory of your script module i.e. &#039;&#039;C:\XBMC\addons&#039;&#039; in this example, select and OK&lt;br /&gt;
Then proceed to create the Python project:&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;PyDev Project&#039;&#039;&lt;br /&gt;
: OR select below in case &#039;&#039;PyDev Project&#039;&#039; is not displayed&lt;br /&gt;
* &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;New&#039;&#039; -&amp;gt; &#039;&#039;Others&#039;&#039;; and Select &#039;&#039;Pydev&#039;&#039; then &#039;&#039;PyDev Project&#039;&#039;; Click &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Enter the name of your project e.g. xbmc_addons&lt;br /&gt;
* Uncheck option &#039;&#039;Use Default&#039;&#039;&lt;br /&gt;
* Browse to the directory of your scripts and select i.e. C:\XBMC\addons.&lt;br /&gt;
* Set &#039;&#039;Python&#039; as Project Type&lt;br /&gt;
* Select &#039;&#039;2.4 (XBMC Python version)&#039;&#039; for the grammar&lt;br /&gt;
* Select &#039;&#039;Don&#039;t configure PYTHONPATH (to be done manually later on)&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Set the Python Path ===&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Properties&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;PyDev - PYTHONPATH&#039;&#039; and click on &#039;&#039;Add source folder&#039;&#039;&lt;br /&gt;
* Select the source directory of your script, /xbmc_addons in our example&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Import File System ===&lt;br /&gt;
Assuming you want to add in all the directories under C:\XBMC\addons&lt;br /&gt;
* Right click on your new project and select &#039;&#039;Import...&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;General&#039;&#039; and click on &#039;&#039;File System&#039;&#039;; then &#039;&#039;Next&#039;&#039;&lt;br /&gt;
* Browse to the source directory of your script (or plugin) e.g. C:\XBMC\addons&lt;br /&gt;
* Check the directory and files to be added&lt;br /&gt;
* Select &#039;&#039;Into folder: xbmc_addons&#039;&#039;&lt;br /&gt;
* Select &#039;&#039;Options | &amp;lt;&amp;lt;Advanced | Create links in workspace&#039;&#039;&lt;br /&gt;
* Uncheck both the options i.e. &#039;&#039;Create virtual folders&#039;&#039; &amp;amp; &#039;&#039;Create link locations relative to;...&#039;&#039;&lt;br /&gt;
* Click on &#039;&#039;Finish&#039;&#039; button&lt;br /&gt;
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add Pydev Python source code (pysrc) to XBMC ===&lt;br /&gt;
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.&lt;br /&gt;
&lt;br /&gt;
==== Identify where PyDev remote debugger Python files are ====&lt;br /&gt;
Python source files should be in you Eclipse installation directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.&lt;br /&gt;
&amp;lt;pre&amp;gt;C:\...\eclipse\plugins\org.python.pydev_3.6.0.201406232321\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
Look for org.python.pydev.debug (not core)&lt;br /&gt;
&lt;br /&gt;
==== Modify PyDev source in order to support XBMC paths ====&lt;br /&gt;
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://... or Q:/...) and the module would not find them making it impossible to insert breakpoints in such files.&lt;br /&gt;
&lt;br /&gt;
In order to add the support of XBMC paths, you will need to do a simple modification to the file &#039;&#039;pydevd_file_utils.py&#039;&#039; consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). &lt;br /&gt;
Add a line like&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 def _NormFile(filename):&lt;br /&gt;
     filename = xbmc.translatePath(filename)&lt;br /&gt;
     try:&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
The other three procedures are:&lt;br /&gt;
* def _NormFile(filename):&lt;br /&gt;
* def NormFileToServer(filename):&lt;br /&gt;
* def NormFileToClient(filename):&lt;br /&gt;
&lt;br /&gt;
of course you need the import directive at the top of the file:&lt;br /&gt;
&lt;br /&gt;
 import xbmc&lt;br /&gt;
&lt;br /&gt;
at the beginning of the module...&lt;br /&gt;
&lt;br /&gt;
==== Choose how XBMC will refer to Pydev debugging module ====&lt;br /&gt;
&lt;br /&gt;
You have 3 options as below:&lt;br /&gt;
* Option 1 - Refer from our python script directly the directory where pysrc is installed&lt;br /&gt;
* Option 2 - Copy pysrc in our script directory and refer it from our script&lt;br /&gt;
* Option 3 - Copy pysrc in XBMC Python install&lt;br /&gt;
&lt;br /&gt;
I am only going to show you the steps for &#039;&#039;Option 3&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
==== Copy pysrc in XBMC Python install ====&lt;br /&gt;
* Copy the content of pysrc to:&lt;br /&gt;
&amp;lt;pre&amp;gt;XBMC\system\python\Lib\pysrc\&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add an empty __init__.py file in it&lt;br /&gt;
&lt;br /&gt;
=== Add to your python script the code for remote debug ===&lt;br /&gt;
At the beginning of you Python script/plugin (usually Default.py) add the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
REMOTE_DBG = True &lt;br /&gt;
&lt;br /&gt;
# append pydev remote debugger&lt;br /&gt;
if REMOTE_DBG:&lt;br /&gt;
    # Make pydev debugger works for auto reload.&lt;br /&gt;
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc&lt;br /&gt;
    try:&lt;br /&gt;
        import pysrc.pydevd as pydevd&lt;br /&gt;
	# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
    except ImportError:&lt;br /&gt;
        sys.stderr.write(&amp;quot;Error: &amp;quot; +&lt;br /&gt;
            &amp;quot;You must add org.python.pydev.debug.pysrc to your PYTHONPATH.&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case you have change the default port you can replace the line with pydevd.settrace by this one:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        pydevd.settrace(&#039;localhost&#039;, port=5678, stdoutToServer=True, stderrToServer=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use REMOTE_DBG in order to activate or not the remote debugging&lt;br /&gt;
* port specifies the listening port number use between the client and the server&lt;br /&gt;
* Replace localhost by an IP address if XBMC and Eclipse are on 2 different machines&lt;br /&gt;
* stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console, you won&#039;t have to open xbmc.log file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Run ===&lt;br /&gt;
* Go in Debug view (Eclipse: [[File:changeperspective.png]] / Debug ) and press on the start server button: [[File:EclipsePydevDebugSrvButtons.png]]&lt;br /&gt;
&lt;br /&gt;
* You will see in the console logs like:&lt;br /&gt;
&amp;lt;pre&amp;gt;Debug Server at port: 5678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Start XBMC and run your script/plugin, you will see it as &amp;quot;Running&amp;quot; but paused&lt;br /&gt;
&lt;br /&gt;
* In Eclipse (Debug View) click on the Resume button (or F8), then you will see the program running in XBMC&lt;br /&gt;
&lt;br /&gt;
* You are now fully set up: You can set break-point, watch on variables, run step by step etc&lt;br /&gt;
&lt;br /&gt;
* Enjoy!&lt;br /&gt;
&lt;br /&gt;
=== Screenshot ===&lt;br /&gt;
&lt;br /&gt;
[[File:EclipsePydevDebugger.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Add-ons]]&lt;br /&gt;
* [[:Category:All add-ons]]&lt;br /&gt;
* [[3rd party add-on repositories]]&lt;br /&gt;
&#039;&#039;&#039;Development:&#039;&#039;&#039;&lt;br /&gt;
* [[Add-on development]]&lt;br /&gt;
* [[Addon Settings]]&lt;br /&gt;
* [[Python development]]&lt;br /&gt;
* [[Add-on repositories]]&lt;br /&gt;
* [[Official add-on repository]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Add-on development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64500</id>
		<title>HOW-TO:Modify the video cache</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64500"/>
		<updated>2013-09-25T22:27:56Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{divbox|orange|| {{big|&#039;&#039;&#039;WARNING:&#039;&#039;&#039; These are considered advanced and experimental features. Some tags require a &#039;&#039;&#039;[[nightly build]]&#039;&#039;&#039; in order to work!}} }}[[Category:Gotham feature]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes &#039;&#039;&#039;three [[advancedsettings.xml]] settings&#039;&#039;&#039; that can be used to maximize the video playback cache. You can use all or just a couple of these settings to see significant improvements in cache performance, should you require it &#039;&#039;(most users will not require these modifications)&#039;&#039;. This can help with intermittent network issues, reduce how long the network is tied up, and/or improve battery life &amp;lt;ref name=&amp;quot;battery&amp;quot;&amp;gt;Certain devices (laptops, tablets, etc) that use sustained slow/medium-wifi usage, over the length of the video, will use more power than using fast-wifi usage for a shorter time. In other words, slowly loading a video file that is 30 minutes long, over a period of 30 minutes, can actually take more power than loading a 30 minute video in 5 minutes, even though more wifi speed/power is used during that 5 minutes.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Even if you change the cache settings in XBMC, that won&#039;t change how fast the video file data comes in over the network: It won&#039;t make a slow server load the video any faster. It won&#039;t fix a slow local network.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|In v12 (Frodo), the video cache affects only media over HTTP and FTP protocol (local and internet sources). SMB and NFS are &#039;&#039;&#039;not&#039;&#039;&#039; cached. Check the resulting buffer size with [[Codecinfo|Codec Info]]. If you want to buffer a poor local network WLAN connection, you should access your sources via FTP protocol.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TOC limit|2}}&lt;br /&gt;
==How-to modify the cache==&lt;br /&gt;
If you don&#039;t already have an [[advancedsettings.xml]] file, it&#039;s very simple to make. XBMC uses this file for advanced settings and features that normal users shouldn&#039;t modify without first knowing what they do, as well as for experimental features, etc.&lt;br /&gt;
&lt;br /&gt;
# Since you can use all or just some of the following settings, let&#039;s start out with the basic file. Create a &#039;&#039;&#039;plain text file&#039;&#039;&#039; (no rich text formatting, don&#039;t use .doc, etc) and save it as &#039;&#039;&#039;advancedsettings.xml&#039;&#039;&#039;. Make sure that the file extension is &amp;quot;.xml&amp;quot; and &#039;&#039;&#039;not&#039;&#039;&#039; &amp;quot;.txt&amp;quot; or &amp;quot;.xml.txt&amp;quot;.&lt;br /&gt;
# Cut and paste this into your new plain text file:&lt;br /&gt;
#:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;!--- The three settings will go in this space, between the two network tags. ---&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add some or all of the settings tags from the [[#Cache settings|next section]].&lt;br /&gt;
# Save this file in your [[userdata folder]]:&lt;br /&gt;
#:&#039;&#039;If you have an existing file, make sure the &amp;lt;network&amp;gt;&amp;lt;/network&amp;gt; tags, and settings we&#039;ll add between them, are between the main &amp;lt;advancedsettings&amp;gt;&amp;lt;/advancedsettings&amp;gt; tags.&#039;&#039;&lt;br /&gt;
::{{#lst:userdata|location all}}&lt;br /&gt;
&lt;br /&gt;
==Cache settings==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! advancedsettings.xml tag !! what it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Enable cache for local videos&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;alwaysforcebuffer&amp;quot;&amp;gt;Requires XBMC v13alpha6 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This setting will force XBMC to use a cache for all video files, including local network, internet, and even the local hard drive. We do this because by default XBMC will only cache videos that use internet file paths/sources.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increasing the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;cachemembuffersize&amp;quot;&amp;gt;Requires XBMC v12.0 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we can do two things:&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 5242880}} -&#039;&#039;&#039; keep the cache in RAM, but increase how much RAM is used. The number is the buffer size in bytes &#039;&#039;(5242880 is the default, which is about 5MB, which requires 15MB of free RAM)&#039;&#039;. XBMC will not buffer ahead more than this. {{Note|For the memory size set here, XBMC will require 3x the amount of RAM to be free. Setting this too high might cause XBMC to crash if it can&#039;t get enough RAM.}}&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;or&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 0}} -&#039;&#039;&#039; we can use the local disk memory (typically your hard drive), which will not put any limit on the size (outside of the size of your drive).  This also allows devices with low RAM, such as the [[Raspberry Pi]], to cache more than they normally would due to the small amount of RAM they have. The cache is deleted from the local disk whenever playback is stopped. {{note|This will likely cause increased wear-and-tear on your drive.}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increase the fill-rate of the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;readbufferfactor&amp;quot;&amp;gt;Requires XBMC v13alpha7 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default &#039;&#039;&#039;(value: 1)&#039;&#039;&#039;, XBMC will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn&#039;t cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The value of this setting is a multiplier of the default limit. If XBMC is loading a typical bluray raw file at 36 Mbit/s, then a value of &#039;&#039;&#039;2&#039;&#039;&#039; will need at least 72 Mbit/s of network bandwidth. However, unlike with the RAM setting, you can safely increase this value however high you want, and XBMC won&#039;t crash. Just know that it might cause XBMC to attempt to use all available bandwidth on your HTPC during playback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Example 1===&lt;br /&gt;
All three options enabled, using local hard drive for cache.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
    &amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
Only cache size changed, using 100MB of RAM for cache (which requires 300MB of free RAM).&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;104857600&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3===&lt;br /&gt;
Two options enabled, using 50MB of RAM for cache (which requires 150MB of free RAM), and cache both internet, LAN, and local content.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;52428800&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced topics]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Video Library]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64499</id>
		<title>HOW-TO:Modify the video cache</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64499"/>
		<updated>2013-09-25T22:26:54Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{divbox|orange|| {{big|&#039;&#039;&#039;WARNING:&#039;&#039;&#039; These are considered advanced and experimental features. Some tags require a &#039;&#039;&#039;[[nightly build]]&#039;&#039;&#039; in order to work!}} }}[[Category:Gotham feature]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes &#039;&#039;&#039;three [[advancedsettings.xml]] settings&#039;&#039;&#039; that can be used to maximize the video playback cache. You can use all or just a couple of these settings to see significant improvements in cache performance, should you require it &#039;&#039;(most users will not require these modifications)&#039;&#039;. This can help with intermittent network issues, reduce how long the network is tied up, and/or improve battery life &amp;lt;ref name=&amp;quot;battery&amp;quot;&amp;gt;Certain devices (laptops, tablets, etc) that use sustained slow/medium-wifi usage, over the length of the video, will use more power than using fast-wifi usage for a shorter time. In other words, slowly loading a video file that is 30 minutes long, over a period of 30 minutes, can actually take more power than loading a 30 minute video in 5 minutes, even though more wifi speed/power is used during that 5 minutes.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Even if you change the cache settings in XBMC, that won&#039;t change how fast the video file data comes in over the network: It won&#039;t make a slow server load the video any faster. It won&#039;t fix a slow local network.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|In v12 (Frodo), the video cache affects only media over HTTP and FTP protocol (local and internet sources). SMB and NFS are &#039;&#039;&#039;not&#039;&#039;&#039; cached. Check the resulting buffer size with [[Codecinfo|Codec Info]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TOC limit|2}}&lt;br /&gt;
==How-to modify the cache==&lt;br /&gt;
If you don&#039;t already have an [[advancedsettings.xml]] file, it&#039;s very simple to make. XBMC uses this file for advanced settings and features that normal users shouldn&#039;t modify without first knowing what they do, as well as for experimental features, etc.&lt;br /&gt;
&lt;br /&gt;
# Since you can use all or just some of the following settings, let&#039;s start out with the basic file. Create a &#039;&#039;&#039;plain text file&#039;&#039;&#039; (no rich text formatting, don&#039;t use .doc, etc) and save it as &#039;&#039;&#039;advancedsettings.xml&#039;&#039;&#039;. Make sure that the file extension is &amp;quot;.xml&amp;quot; and &#039;&#039;&#039;not&#039;&#039;&#039; &amp;quot;.txt&amp;quot; or &amp;quot;.xml.txt&amp;quot;.&lt;br /&gt;
# Cut and paste this into your new plain text file:&lt;br /&gt;
#:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;!--- The three settings will go in this space, between the two network tags. ---&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add some or all of the settings tags from the [[#Cache settings|next section]].&lt;br /&gt;
# Save this file in your [[userdata folder]]:&lt;br /&gt;
#:&#039;&#039;If you have an existing file, make sure the &amp;lt;network&amp;gt;&amp;lt;/network&amp;gt; tags, and settings we&#039;ll add between them, are between the main &amp;lt;advancedsettings&amp;gt;&amp;lt;/advancedsettings&amp;gt; tags.&#039;&#039;&lt;br /&gt;
::{{#lst:userdata|location all}}&lt;br /&gt;
&lt;br /&gt;
==Cache settings==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! advancedsettings.xml tag !! what it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Enable cache for local videos&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;alwaysforcebuffer&amp;quot;&amp;gt;Requires XBMC v13alpha6 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This setting will force XBMC to use a cache for all video files, including local network, internet, and even the local hard drive. We do this because by default XBMC will only cache videos that use internet file paths/sources.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increasing the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;cachemembuffersize&amp;quot;&amp;gt;Requires XBMC v12.0 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we can do two things:&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 5242880}} -&#039;&#039;&#039; keep the cache in RAM, but increase how much RAM is used. The number is the buffer size in bytes &#039;&#039;(5242880 is the default, which is about 5MB, which requires 15MB of free RAM)&#039;&#039;. XBMC will not buffer ahead more than this. {{Note|For the memory size set here, XBMC will require 3x the amount of RAM to be free. Setting this too high might cause XBMC to crash if it can&#039;t get enough RAM.}}&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;or&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 0}} -&#039;&#039;&#039; we can use the local disk memory (typically your hard drive), which will not put any limit on the size (outside of the size of your drive).  This also allows devices with low RAM, such as the [[Raspberry Pi]], to cache more than they normally would due to the small amount of RAM they have. The cache is deleted from the local disk whenever playback is stopped. {{note|This will likely cause increased wear-and-tear on your drive.}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increase the fill-rate of the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;readbufferfactor&amp;quot;&amp;gt;Requires XBMC v13alpha7 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default &#039;&#039;&#039;(value: 1)&#039;&#039;&#039;, XBMC will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn&#039;t cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The value of this setting is a multiplier of the default limit. If XBMC is loading a typical bluray raw file at 36 Mbit/s, then a value of &#039;&#039;&#039;2&#039;&#039;&#039; will need at least 72 Mbit/s of network bandwidth. However, unlike with the RAM setting, you can safely increase this value however high you want, and XBMC won&#039;t crash. Just know that it might cause XBMC to attempt to use all available bandwidth on your HTPC during playback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Example 1===&lt;br /&gt;
All three options enabled, using local hard drive for cache.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
    &amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
Only cache size changed, using 100MB of RAM for cache (which requires 300MB of free RAM).&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;104857600&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3===&lt;br /&gt;
Two options enabled, using 50MB of RAM for cache (which requires 150MB of free RAM), and cache both internet, LAN, and local content.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;52428800&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced topics]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Video Library]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64498</id>
		<title>HOW-TO:Modify the video cache</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64498"/>
		<updated>2013-09-25T22:26:25Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{divbox|orange|| {{big|&#039;&#039;&#039;WARNING:&#039;&#039;&#039; These are considered advanced and experimental features. Some tags require a &#039;&#039;&#039;[[nightly build]]&#039;&#039;&#039; in order to work!}} }}[[Category:Gotham feature]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes &#039;&#039;&#039;three [[advancedsettings.xml]] settings&#039;&#039;&#039; that can be used to maximize the video playback cache. You can use all or just a couple of these settings to see significant improvements in cache performance, should you require it &#039;&#039;(most users will not require these modifications)&#039;&#039;. This can help with intermittent network issues, reduce how long the network is tied up, and/or improve battery life &amp;lt;ref name=&amp;quot;battery&amp;quot;&amp;gt;Certain devices (laptops, tablets, etc) that use sustained slow/medium-wifi usage, over the length of the video, will use more power than using fast-wifi usage for a shorter time. In other words, slowly loading a video file that is 30 minutes long, over a period of 30 minutes, can actually take more power than loading a 30 minute video in 5 minutes, even though more wifi speed/power is used during that 5 minutes.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Even if you change the cache settings in XBMC, that won&#039;t change how fast the video file data comes in over the network: It won&#039;t make a slow server load the video any faster. It won&#039;t fix a slow local network.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|In v12 (Frodo), the video cache affects only media over HTTP and FTP protocol (local and internet sources). SMB and NFS are &#039;&#039;&#039;not&#039;&#039;&#039; cached. Check the resulting buffer size with [[Codecinfo|Codec Info]]}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TOC limit|2}}&lt;br /&gt;
==How-to modify the cache==&lt;br /&gt;
If you don&#039;t already have an [[advancedsettings.xml]] file, it&#039;s very simple to make. XBMC uses this file for advanced settings and features that normal users shouldn&#039;t modify without first knowing what they do, as well as for experimental features, etc.&lt;br /&gt;
&lt;br /&gt;
# Since you can use all or just some of the following settings, let&#039;s start out with the basic file. Create a &#039;&#039;&#039;plain text file&#039;&#039;&#039; (no rich text formatting, don&#039;t use .doc, etc) and save it as &#039;&#039;&#039;advancedsettings.xml&#039;&#039;&#039;. Make sure that the file extension is &amp;quot;.xml&amp;quot; and &#039;&#039;&#039;not&#039;&#039;&#039; &amp;quot;.txt&amp;quot; or &amp;quot;.xml.txt&amp;quot;.&lt;br /&gt;
# Cut and paste this into your new plain text file:&lt;br /&gt;
#:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;!--- The three settings will go in this space, between the two network tags. ---&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add some or all of the settings tags from the [[#Cache settings|next section]].&lt;br /&gt;
# Save this file in your [[userdata folder]]:&lt;br /&gt;
#:&#039;&#039;If you have an existing file, make sure the &amp;lt;network&amp;gt;&amp;lt;/network&amp;gt; tags, and settings we&#039;ll add between them, are between the main &amp;lt;advancedsettings&amp;gt;&amp;lt;/advancedsettings&amp;gt; tags.&#039;&#039;&lt;br /&gt;
::{{#lst:userdata|location all}}&lt;br /&gt;
&lt;br /&gt;
==Cache settings==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! advancedsettings.xml tag !! what it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Enable cache for local videos&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;alwaysforcebuffer&amp;quot;&amp;gt;Requires XBMC v13alpha6 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This setting will force XBMC to use a cache for all video files, including local network, internet, and even the local hard drive. We do this because by default XBMC will only cache videos that use internet file paths/sources.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increasing the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;cachemembuffersize&amp;quot;&amp;gt;Requires XBMC v12.0 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we can do two things:&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 5242880}} -&#039;&#039;&#039; keep the cache in RAM, but increase how much RAM is used. The number is the buffer size in bytes &#039;&#039;(5242880 is the default, which is about 5MB, which requires 15MB of free RAM)&#039;&#039;. XBMC will not buffer ahead more than this. {{Note|For the memory size set here, XBMC will require 3x the amount of RAM to be free. Setting this too high might cause XBMC to crash if it can&#039;t get enough RAM.}}&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;or&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 0}} -&#039;&#039;&#039; we can use the local disk memory (typically your hard drive), which will not put any limit on the size (outside of the size of your drive).  This also allows devices with low RAM, such as the [[Raspberry Pi]], to cache more than they normally would due to the small amount of RAM they have. The cache is deleted from the local disk whenever playback is stopped. {{note|This will likely cause increased wear-and-tear on your drive.}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increase the fill-rate of the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;readbufferfactor&amp;quot;&amp;gt;Requires XBMC v13alpha7 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default &#039;&#039;&#039;(value: 1)&#039;&#039;&#039;, XBMC will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn&#039;t cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The value of this setting is a multiplier of the default limit. If XBMC is loading a typical bluray raw file at 36 Mbit/s, then a value of &#039;&#039;&#039;2&#039;&#039;&#039; will need at least 72 Mbit/s of network bandwidth. However, unlike with the RAM setting, you can safely increase this value however high you want, and XBMC won&#039;t crash. Just know that it might cause XBMC to attempt to use all available bandwidth on your HTPC during playback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Example 1===&lt;br /&gt;
All three options enabled, using local hard drive for cache.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
    &amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
Only cache size changed, using 100MB of RAM for cache (which requires 300MB of free RAM).&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;104857600&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3===&lt;br /&gt;
Two options enabled, using 50MB of RAM for cache (which requires 150MB of free RAM), and cache both internet, LAN, and local content.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;52428800&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced topics]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Video Library]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64497</id>
		<title>HOW-TO:Modify the video cache</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=HOW-TO:Modify_the_video_cache&amp;diff=64497"/>
		<updated>2013-09-25T22:25:50Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{divbox|orange|| {{big|&#039;&#039;&#039;WARNING:&#039;&#039;&#039; These are considered advanced and experimental features. Some tags require a &#039;&#039;&#039;[[nightly build]]&#039;&#039;&#039; in order to work!}} }}[[Category:Gotham feature]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes &#039;&#039;&#039;three [[advancedsettings.xml]] settings&#039;&#039;&#039; that can be used to maximize the video playback cache. You can use all or just a couple of these settings to see significant improvements in cache performance, should you require it &#039;&#039;(most users will not require these modifications)&#039;&#039;. This can help with intermittent network issues, reduce how long the network is tied up, and/or improve battery life &amp;lt;ref name=&amp;quot;battery&amp;quot;&amp;gt;Certain devices (laptops, tablets, etc) that use sustained slow/medium-wifi usage, over the length of the video, will use more power than using fast-wifi usage for a shorter time. In other words, slowly loading a video file that is 30 minutes long, over a period of 30 minutes, can actually take more power than loading a 30 minute video in 5 minutes, even though more wifi speed/power is used during that 5 minutes.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|Even if you change the cache settings in XBMC, that won&#039;t change how fast the video file data comes in over the network: It won&#039;t make a slow server load the video any faster. It won&#039;t fix a slow local network.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{note|In v12 (Frodo), the video cache affects only media over HTTP and FTP protocol (local and internet sources). SMB and NFS are &#039;&#039;&#039;not&#039;&#039;&#039; cached. Check the resulting buffer size with [[#Codecinfo|Codec Info]]}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TOC limit|2}}&lt;br /&gt;
==How-to modify the cache==&lt;br /&gt;
If you don&#039;t already have an [[advancedsettings.xml]] file, it&#039;s very simple to make. XBMC uses this file for advanced settings and features that normal users shouldn&#039;t modify without first knowing what they do, as well as for experimental features, etc.&lt;br /&gt;
&lt;br /&gt;
# Since you can use all or just some of the following settings, let&#039;s start out with the basic file. Create a &#039;&#039;&#039;plain text file&#039;&#039;&#039; (no rich text formatting, don&#039;t use .doc, etc) and save it as &#039;&#039;&#039;advancedsettings.xml&#039;&#039;&#039;. Make sure that the file extension is &amp;quot;.xml&amp;quot; and &#039;&#039;&#039;not&#039;&#039;&#039; &amp;quot;.txt&amp;quot; or &amp;quot;.xml.txt&amp;quot;.&lt;br /&gt;
# Cut and paste this into your new plain text file:&lt;br /&gt;
#:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;!--- The three settings will go in this space, between the two network tags. ---&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add some or all of the settings tags from the [[#Cache settings|next section]].&lt;br /&gt;
# Save this file in your [[userdata folder]]:&lt;br /&gt;
#:&#039;&#039;If you have an existing file, make sure the &amp;lt;network&amp;gt;&amp;lt;/network&amp;gt; tags, and settings we&#039;ll add between them, are between the main &amp;lt;advancedsettings&amp;gt;&amp;lt;/advancedsettings&amp;gt; tags.&#039;&#039;&lt;br /&gt;
::{{#lst:userdata|location all}}&lt;br /&gt;
&lt;br /&gt;
==Cache settings==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! advancedsettings.xml tag !! what it does&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Enable cache for local videos&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;alwaysforcebuffer&amp;quot;&amp;gt;Requires XBMC v13alpha6 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This setting will force XBMC to use a cache for all video files, including local network, internet, and even the local hard drive. We do this because by default XBMC will only cache videos that use internet file paths/sources.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increasing the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;cachemembuffersize&amp;quot;&amp;gt;Requires XBMC v12.0 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we can do two things:&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 5242880}} -&#039;&#039;&#039; keep the cache in RAM, but increase how much RAM is used. The number is the buffer size in bytes &#039;&#039;(5242880 is the default, which is about 5MB, which requires 15MB of free RAM)&#039;&#039;. XBMC will not buffer ahead more than this. {{Note|For the memory size set here, XBMC will require 3x the amount of RAM to be free. Setting this too high might cause XBMC to crash if it can&#039;t get enough RAM.}}&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;or&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;{{Big|Value: 0}} -&#039;&#039;&#039; we can use the local disk memory (typically your hard drive), which will not put any limit on the size (outside of the size of your drive).  This also allows devices with low RAM, such as the [[Raspberry Pi]], to cache more than they normally would due to the small amount of RAM they have. The cache is deleted from the local disk whenever playback is stopped. {{note|This will likely cause increased wear-and-tear on your drive.}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| {{huge|&#039;&#039;&#039;Increase the fill-rate of the cache&#039;&#039;&#039;}}&amp;lt;ref name=&amp;quot;readbufferfactor&amp;quot;&amp;gt;Requires XBMC v13alpha7 or higher&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default &#039;&#039;&#039;(value: 1)&#039;&#039;&#039;, XBMC will only fill the cache a little above what is needed to play it back. It does this as to not max out your network and possibly max out some hardware. For most users and hardware, this setting shouldn&#039;t cause any issues, but be aware of it if you have unusual CPU spikes in your HTPC. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The value of this setting is a multiplier of the default limit. If XBMC is loading a typical bluray raw file at 36 Mbit/s, then a value of &#039;&#039;&#039;2&#039;&#039;&#039; will need at least 72 Mbit/s of network bandwidth. However, unlike with the RAM setting, you can safely increase this value however high you want, and XBMC won&#039;t crash. Just know that it might cause XBMC to attempt to use all available bandwidth on your HTPC during playback.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Example 1===&lt;br /&gt;
All three options enabled, using local hard drive for cache.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;0&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
    &amp;lt;readbufferfactor&amp;gt;4.0&amp;lt;/readbufferfactor&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
Only cache size changed, using 100MB of RAM for cache (which requires 300MB of free RAM).&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;104857600&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3===&lt;br /&gt;
Two options enabled, using 50MB of RAM for cache (which requires 150MB of free RAM), and cache both internet, LAN, and local content.&lt;br /&gt;
;advancedsettings.xml&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;advancedsettings&amp;gt;&lt;br /&gt;
  &amp;lt;network&amp;gt;&lt;br /&gt;
    &amp;lt;alwaysforcebuffer&amp;gt;1&amp;lt;/alwaysforcebuffer&amp;gt;&lt;br /&gt;
    &amp;lt;cachemembuffersize&amp;gt;52428800&amp;lt;/cachemembuffersize&amp;gt;&lt;br /&gt;
  &amp;lt;/network&amp;gt;&lt;br /&gt;
&amp;lt;/advancedsettings&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced topics]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
[[Category:Video Library]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=List_of_built-in_functions&amp;diff=64004</id>
		<title>List of built-in functions</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=List_of_built-in_functions&amp;diff=64004"/>
		<updated>2013-09-05T15:40:24Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* All Platforms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{mininav|[[Development]]}}&lt;br /&gt;
&lt;br /&gt;
{{see also|Python development|Skinning}}&lt;br /&gt;
&lt;br /&gt;
{{cleanup}}&lt;br /&gt;
The latest up-to-date list of built-in functions can be found in the function &#039;&#039;&#039;CBuiltins::Execute()&#039;&#039;&#039; in the source code file [https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/Builtins.cpp xbmc/interfaces/Builtins.cpp].&lt;br /&gt;
&lt;br /&gt;
In addition to the following list, for most &amp;lt;onclick&amp;gt; and &amp;lt;onfocus&amp;gt; button actions in the skin you can also use the functions from [[Keyboard.xml]].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;onclick&amp;gt;VolumeUp&amp;lt;/onclick&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;onclick&amp;gt;VolumeDown&amp;lt;/onclick&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You can use parameters with all media windows, as can be seen here:&#039;&#039;&#039;&lt;br /&gt;
* [[Opening Windows and Dialogs]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== All Platforms ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
|  Reboot&lt;br /&gt;
|  Cold reboots the system (power cycle)&lt;br /&gt;
|- &lt;br /&gt;
|  ShutDown&lt;br /&gt;
|  Trigger default Shutdown action defined in System Settings&lt;br /&gt;
|- &lt;br /&gt;
|  Powerdown&lt;br /&gt;
|  Powerdown system&lt;br /&gt;
|- &lt;br /&gt;
|  Quit&lt;br /&gt;
|  Quits XBMC&lt;br /&gt;
|- &lt;br /&gt;
|  Hibernate&lt;br /&gt;
|  Hibernate (S4) the System&lt;br /&gt;
|- &lt;br /&gt;
|  Suspend&lt;br /&gt;
|  Suspends (S3 / S1 depending on bios setting) the System&lt;br /&gt;
|- &lt;br /&gt;
|  RestartApp&lt;br /&gt;
|  Restarts XBMC (not implemented under Win32)&lt;br /&gt;
|- &lt;br /&gt;
|  Minimize&lt;br /&gt;
|  Minimizes XBMC&lt;br /&gt;
|- &lt;br /&gt;
|  Credits&lt;br /&gt;
|  Runs the Credits&lt;br /&gt;
|- &lt;br /&gt;
|  Mastermode&lt;br /&gt;
|  Runs XBMC in master mode&lt;br /&gt;
|- &lt;br /&gt;
|  ActivateWindow(window[,dir,return])&lt;br /&gt;
|  Opens the given window. The parameter window can either be the window&#039;s id, or in the case of a standard window, the window&#039;s name. [[Window IDs|See here for a list of window names, and their respective ids.]] If, furthermore, the window is Music, Video, Pictures, or Program files, then the optional dir parameter specifies which folder XBMC should default to once the window is opened. This must be a source as specified in sources.xml, or a subfolder of a valid source. For some windows (MusicLibrary and VideoLibrary), the return parameter may be specified, which indicates that XBMC should use this folder as the &amp;quot;root&amp;quot; of the level, and thus the &amp;quot;parent directory&amp;quot; action from within this folder will return the user to where they were prior to the window activating.&lt;br /&gt;
|-{{frodo row}}&lt;br /&gt;
| ActivateWindowAndFocus(id1, id2,item1, id3,item2)&lt;br /&gt;
| Activate window with id1, first focus control id2 and then focus control id3. if either of the controls is a container, you can specify which item to focus (else, set it to 0).&#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo addition]])&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| ReplaceWindowAndFocus(id1, id2,item1, id3,item2)&lt;br /&gt;
| Replace window with id1, first focus control id2 and then focus control id3.  if either of the controls is a container, you can specify which item to focus (else, set it to 0).&#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  ReplaceWindow(window,dir)&lt;br /&gt;
|  Replaces the current window with the given window. This is the same as ActivateWindow() but it doesn&#039;t update the window history list, so when you go back from the new window it will not return to the previous window, rather will return to the previous window&#039;s previous window.&lt;br /&gt;
|- &lt;br /&gt;
|  TakeScreenshot&lt;br /&gt;
|  Takes a Screenshot&lt;br /&gt;
|-&lt;br /&gt;
| ActivateScreensaver&lt;br /&gt;
| Starts the screensaver &#039;&#039;&#039;([[:Category:Gotham feature|Future Gotham addition]])&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  RunScript(script[,args]*)&lt;br /&gt;
|  Runs the python script. You must specify the full path to the script. If the script is an add-on, you can also execute it using its add-on id. As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv&lt;br /&gt;
|- &lt;br /&gt;
|  RunAddon(id)&lt;br /&gt;
|  Runs the specified plugin/script&lt;br /&gt;
|- &lt;br /&gt;
|  RunPlugin(plugin)&lt;br /&gt;
|  Runs the plugin. Full path must be specified. Does not work for folder plugins&lt;br /&gt;
|- &lt;br /&gt;
|  RunAppleScript(script[,args]*)&lt;br /&gt;
|  Run the specified AppleScript command&lt;br /&gt;
|- &lt;br /&gt;
|  Extract&lt;br /&gt;
|  Extracts a specified archive to an optionally specified path. &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;! REQUIRES ABSOLUTE PATHS !&amp;lt;/font&amp;gt;&lt;br /&gt;
|-  {{frodo row}}&lt;br /&gt;
|  Filter&lt;br /&gt;
|  Opens the mediafilter dialog in the video and musiclibrary &#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo addition]])&#039;&#039;&#039;&lt;br /&gt;
|- &lt;br /&gt;
|  PlayMedia(media[,isdir][,1],[playoffset=xx])&lt;br /&gt;
|  Plays the media. This can be a playlist, music, or video file, directory, plugin or an Url. The optional parameter &amp;quot;,isdir&amp;quot; can be used for playing a directory. &amp;quot;,1&amp;quot; will start a video in a preview window, instead of fullscreen. If media is a playlist, you can use playoffset=xx where xx is the position to start playback from.&lt;br /&gt;
|- &lt;br /&gt;
|  SlideShow(dir [,recursive, [not]random])&lt;br /&gt;
|  Starts a slideshow of pictures in the folder dir.  Optional parameters are &amp;quot;recursive&amp;quot;, and &amp;quot;random&amp;quot; or &amp;quot;notrandom&amp;quot; parameters.  The &amp;quot;recursive&amp;quot; parameter starts a recursive slideshow, adding images from sub-folders.  The &amp;quot;random&amp;quot; and &amp;quot;notrandom&amp;quot; parameters override the Randomize setting found in the pictures media window. &lt;br /&gt;
|- &lt;br /&gt;
|  RecursiveSlideShow(dir)&lt;br /&gt;
|  Run a slideshow from the specified directory, including all subdirs&lt;br /&gt;
|- &lt;br /&gt;
|  ReloadSkin()&lt;br /&gt;
|  Reloads the current skin – useful for Skinners to use after they upload modified skin files (saves power cycling)&lt;br /&gt;
|- &lt;br /&gt;
|  RefreshRSS&lt;br /&gt;
|  Reload RSS feeds from RSSFeeds.xml&lt;br /&gt;
|- &lt;br /&gt;
|  PlayerControl(command)&lt;br /&gt;
|  Allows control of music and videos. The command may be one of Play, Stop, Forward, Rewind, Next, Previous, BigSkipForward, BigSkipBackward, SmallSkipForward, SmallSkipBackward, Random, RandomOn, RandomOff, Repeat, RepeatOne, RepeatAll, RepeatOff, Partymode(music) or Partymode(video) or Partymode(path to .xsp file), and Record. Play will either pause, resume, or stop ffwding or rewinding.  Random toggles random playback and Repeat cycles through the repeat modes (these both take an optional second parameter, Notify, that notifies the user of the new state). Partymode(music/video) toggles the appropriate partymode, defaults to music if no parameter is given, besides the default music or video partymode you can also pass a path to a custom smartplaylist (.xsp) as parameter.&lt;br /&gt;
|- &lt;br /&gt;
|  Playlist.PlayOffset&lt;br /&gt;
|  Start playing from a particular offset in the playlist&lt;br /&gt;
|- &lt;br /&gt;
|  Playlist.Clear&lt;br /&gt;
|  Clear the current playlist&lt;br /&gt;
|-&lt;br /&gt;
|  XBMC.ActivateWindow(type,path to playlist)&lt;br /&gt;
|  Opens the window for the desired playlist&lt;br /&gt;
|- &lt;br /&gt;
|  EjectTray()&lt;br /&gt;
|  Either opens or closes the DVD tray, depending on its current state&lt;br /&gt;
|- &lt;br /&gt;
|  AlarmClock(name,command,time[,silent,loop])&lt;br /&gt;
|  Pops up a dialog asking for the length of time for the alarm (unless the parameter time is specified), and starts a timer. When the timer runs out, it&#039;ll execute the &amp;lt;span class=&amp;quot;nobr&amp;quot;&amp;gt;built-in&amp;lt;/span&amp;gt; command (the parameter command) if it is specified, otherwise it&#039;ll pop up an alarm notice. Add silent to hide the alarm notification. Add loop for the alarm to execute the command each time the specified time interval expires. &lt;br /&gt;
|- &lt;br /&gt;
|  CancelAlarm(name[,silent])&lt;br /&gt;
|  Cancel a running alarm. Set silent to true to hide the alarm notification. only available in trunk &amp;gt;r35674 &lt;br /&gt;
|- &lt;br /&gt;
|  Action&lt;br /&gt;
|  Executes an action for the active window (same as in keymap)&lt;br /&gt;
|- &lt;br /&gt;
|  Notification(header,message[,time,image])&lt;br /&gt;
|  Will display a notification dialog with the specified header and message, in addition you can set the length of time it displays in milliseconds and a icon image.&lt;br /&gt;
|- &lt;br /&gt;
|  PlayDVD&lt;br /&gt;
|  Will play the inserted CD or DVD media from the &amp;lt;span class=&amp;quot;nobr&amp;quot;&amp;gt;DVD-ROM&amp;lt;/span&amp;gt; drive.&lt;br /&gt;
|- &lt;br /&gt;
|  RipCD&lt;br /&gt;
|  Will rip the inserted CD from the &amp;lt;span class=&amp;quot;nobr&amp;quot;&amp;gt;DVD-ROM&amp;lt;/span&amp;gt; drive.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.ToggleSetting(setting)&lt;br /&gt;
|  Toggles the skin setting ?setting? for use with [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting).&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetString(string[,value])&lt;br /&gt;
|  Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the keyboard dialog does not pop up, and the string is set directly.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetNumeric(numeric[,value])&lt;br /&gt;
|  Pops up a keyboard dialog and allows the user to input a numerical.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetPath(string[,value])&lt;br /&gt;
|  Pops up a folder browser and allows the user to select a folder of images  to be used in a multi image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the path is set directly.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.Theme&lt;br /&gt;
|  Cycles the skin theme. Skin.theme(-1) will go backwards.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetImage(string[,value])&lt;br /&gt;
|  Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetLargeImage(string[,value])&lt;br /&gt;
|  Pops up a file browser and allows the user to select an large image file to be used in an image control else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the value parameter is specified, then the file browser dialog does not pop up, and the image path is set directly.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetFile(string,mask,folderpath)&lt;br /&gt;
|  Pops up a folder browser and allows the user to select a file off the hard-disk to be used else where in the skin via the [[InfoLabels|info tag]] Skin.String(string). If the mask parameter is specified, then the file browser will only search for the extension specified (.avi,.mp3,.m3u,.png,.bmp,etc.,etc.). To use multiple extensions separate them using &amp;quot;|&amp;quot; minus quotes. If the folderpath parameter is set the file browser will start in that folder.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetAddon(string,type)&lt;br /&gt;
|  Pops up a select dialog and allows the user to select an add-on of the given type to be used elsewhere in the skin via the info tag Skin.String(string). The most common types are &#039;&#039;xbmc.addon.video&#039;&#039;, &#039;&#039;xbmc.addon.audio&#039;&#039;, &#039;&#039;xbmc.addon.image&#039;&#039; and &#039;&#039;xbmc.addon.executable&#039;&#039;.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.SetBool(setting)&lt;br /&gt;
|  Sets the skin setting ?setting? to true, for use with the [[Conditional Visibility|conditional visibility tags]] containing Skin.HasSetting(setting). The settings are saved &amp;lt;span class=&amp;quot;nobr&amp;quot;&amp;gt;per-skin&amp;lt;/span&amp;gt; in settings.xml just like all the other XBMC settings.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.Reset(setting)&lt;br /&gt;
|  Resets the skin setting ?setting?. If ?setting? is a bool setting (i.e. set via SetBool or ToggleSetting) then the setting is reset to false. If ?setting? is a string (Set via SetString, SetImage, or SetPath) then it is set to empty.&lt;br /&gt;
|- &lt;br /&gt;
|  Skin.ResetSettings&lt;br /&gt;
|  Resets all the above skin settings to their defaults (toggles all set to false, strings all set to empty.)&lt;br /&gt;
|- &lt;br /&gt;
|  Mute&lt;br /&gt;
|  Mutes (or unmutes) the volume.&lt;br /&gt;
|- &lt;br /&gt;
|  SetVolume(percent[,showvolumebar])&lt;br /&gt;
|  Sets the volume to the percentage specified. Optionally, show the Volume Dialog in XBMC when setting the volume.&lt;br /&gt;
|- &lt;br /&gt;
|  Dialog.Close(dialog[,force])&lt;br /&gt;
|  Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.&lt;br /&gt;
|- &lt;br /&gt;
|  System.LogOff&lt;br /&gt;
|  Log off current user.&lt;br /&gt;
|- &lt;br /&gt;
|  System.Exec&lt;br /&gt;
|  Execute shell commands.&lt;br /&gt;
|- &lt;br /&gt;
|  System.ExecWait&lt;br /&gt;
|  Execute shell commands and freezes XBMC until shell is closed.&lt;br /&gt;
|-{{frodo row}}&lt;br /&gt;
| AllowIdleShutdown&lt;br /&gt;
| Allow the system to shutdown on idle. &#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo addition]])&#039;&#039;&#039;&lt;br /&gt;
|-{{frodo row}}&lt;br /&gt;
| InhibitIdleShutdown(true/false)&lt;br /&gt;
| Prevent the system to shutdown on idle. &#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo addition]])&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|  Resolution&lt;br /&gt;
|  Change XBMC&#039;s Resolution.&lt;br /&gt;
|-&lt;br /&gt;
|  UpdateLibrary(database,[path])&lt;br /&gt;
|  Takes either &amp;quot;video&amp;quot; or &amp;quot;music&amp;quot; as a parameter to begin updating the corresponding database. For &amp;quot;video&amp;quot; you can additionally specify a specific path to be scanned.&lt;br /&gt;
|-&lt;br /&gt;
|  CleanLibrary(database)&lt;br /&gt;
|  This funtion will perform a number of &#039;cleanup&#039; tasks on your video database and can be run if you have moved, deleted or renamed files. Takes either &amp;quot;video&amp;quot; or &amp;quot;music&amp;quot; as a parameter to begin cleaning the corresponding database.&lt;br /&gt;
|-&lt;br /&gt;
|  PageDown&lt;br /&gt;
|  Send a page down event to the pagecontrol with given id.&lt;br /&gt;
|-&lt;br /&gt;
|  PageUp&lt;br /&gt;
|  Send a page up event to the pagecontrol with given id.&lt;br /&gt;
|-{{frodo row}}&lt;br /&gt;
|  &amp;lt;s&amp;gt;LastFM.Love&amp;lt;/s&amp;gt;&lt;br /&gt;
|  &amp;lt;s&amp;gt;All songs that can be submitted to Last.fm can be loved, optional parameter (false) = direct loving without confirmationdialog.&amp;lt;/s&amp;gt; &#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo removal]])&#039;&#039;&#039;&lt;br /&gt;
|-{{frodo row}}&lt;br /&gt;
| &amp;lt;s&amp;gt;LastFM.Ban&amp;lt;/s&amp;gt;&lt;br /&gt;
| &amp;lt;s&amp;gt;Only songs that are playing on last.fm radio can be banned, optional parameter (false) = direct banning without confirmationdialog.&amp;lt;/s&amp;gt; &#039;&#039;&#039;([[:Category:Frodo feature|Future Frodo removal]])&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
| Container.Refresh&lt;br /&gt;
| Refresh current listing.&lt;br /&gt;
|-&lt;br /&gt;
| Container.Update&lt;br /&gt;
| Update current listing. Send Container.Update(path,replace) to reset the path history.&lt;br /&gt;
|-&lt;br /&gt;
| Container.SetViewMode(id)&lt;br /&gt;
| Set the current view mode (list, icons etc.) to the given container id.&lt;br /&gt;
|-&lt;br /&gt;
| Container.NextViewMode&lt;br /&gt;
| Select the next view mode.&lt;br /&gt;
|-&lt;br /&gt;
| Container.PreviousViewMode&lt;br /&gt;
| Select the previous view mode.&lt;br /&gt;
|-&lt;br /&gt;
| Container.SetViewMode&lt;br /&gt;
| Move to the view with the given id.&lt;br /&gt;
|-&lt;br /&gt;
| Container.NextSortMethod&lt;br /&gt;
| Change to the next sort method.&lt;br /&gt;
|-&lt;br /&gt;
| Container.PreviousSortMethod&lt;br /&gt;
| Change to the previous sort method.&lt;br /&gt;
|-&lt;br /&gt;
| Container.SetSortMethod&lt;br /&gt;
| Change to the specified sort method.&lt;br /&gt;
|-&lt;br /&gt;
| Container.SortDirection&lt;br /&gt;
| Toggle the sort direction.&lt;br /&gt;
|- &lt;br /&gt;
| Control.Move(id,offset)&lt;br /&gt;
| Will make a Container with the &amp;quot;id&amp;quot; specified in the command move focus by &amp;quot;offset&amp;quot;.&lt;br /&gt;
|- &lt;br /&gt;
| Control.SetFocus(id,position)&lt;br /&gt;
| Will make a list with the &amp;quot;id&amp;quot; specified in the command gain focus at &amp;quot;position&amp;quot; number in its list. Alias SetFocus(id,position)&lt;br /&gt;
|- &lt;br /&gt;
| Control.Message(id,message,[windowid])&lt;br /&gt;
| Sends a given message to a control in a given window (or active window if omitted). Messages can be movedown, moveup, pagedown, pageup, click.&lt;br /&gt;
|- &lt;br /&gt;
| SendClick(windowid,id)&lt;br /&gt;
| Sends a click to a control in a given window (or active window if omitted).&lt;br /&gt;
|- &lt;br /&gt;
| LoadProfile(profilename,[prompt])&lt;br /&gt;
| Load the specified profile. If prompt is not specified, and a password would be required for the requested profile, this command will silently fail. If promp&#039; is specified and a password is required, a password dialog will be shown.&lt;br /&gt;
|- &lt;br /&gt;
| SetProperty(key,value[,id])&lt;br /&gt;
| Sets a window property for the current window (key,value), or the specified window (key,value,id).&lt;br /&gt;
|- &lt;br /&gt;
| ClearProperty(key[,id]) &lt;br /&gt;
| Clears a window property for the current focused window/dialog(key), or the specified window (key,id).&lt;br /&gt;
|- &lt;br /&gt;
| PlayWith()&lt;br /&gt;
| Play the selected item with the specified player core.&lt;br /&gt;
|- &lt;br /&gt;
| LIRC.Stop&lt;br /&gt;
| Removes XBMC as a LIRC client.&lt;br /&gt;
|- &lt;br /&gt;
| LIRC.Start&lt;br /&gt;
| Adds XBMC as a LIRC client.&lt;br /&gt;
|- &lt;br /&gt;
| LIRC.Send(command)&lt;br /&gt;
| Sends a command to LIRC, syntax is the lirc protocol without the newline.&amp;lt;br /&amp;gt;Example: LIRC.Send(SEND_ONCE Onkyo_RC-453S2 volup)&lt;br /&gt;
|- &lt;br /&gt;
| LCD.Suspend&lt;br /&gt;
| Suspends LCDproc.&lt;br /&gt;
|- &lt;br /&gt;
| LCD.Resume&lt;br /&gt;
| Resumes LCDproc.&lt;br /&gt;
|- &lt;br /&gt;
| WakeOnLan(mac)&lt;br /&gt;
| Sends the wake-up packet to the broadcast address for the specified MAC address (Format: FF:FF:FF:FF:FF:FF or FF-FF-FF-FF-FF-FF).&lt;br /&gt;
|- &lt;br /&gt;
| exportlibrary(music,false,filepath)&lt;br /&gt;
| The music library will be exported to a single file stored at filepath location.&lt;br /&gt;
|- &lt;br /&gt;
| exportlibrary(video,true,thumbs,overwrite,actorthumbs)&lt;br /&gt;
| The video library is exported to multiple files with the given options. Here thumbs, overwrite and actorthumbs are boolean values (true or false).&lt;br /&gt;
|- &lt;br /&gt;
| Addon.Default.OpenSettings &lt;br /&gt;
| Open a settings dialog for the default addon of the given type&lt;br /&gt;
|- &lt;br /&gt;
| UpdateAddonRepos&lt;br /&gt;
| Triggers a forced update of enabled add-on repositories.&lt;br /&gt;
|- &lt;br /&gt;
| UpdateLocalAddons&lt;br /&gt;
| Triggers a scan of local add-on directories.&lt;br /&gt;
|- &lt;br /&gt;
| Weather.Refresh&lt;br /&gt;
| Force weather data refresh&lt;br /&gt;
|- &lt;br /&gt;
| Weather.LocationNext&lt;br /&gt;
| Switch to next weather location&lt;br /&gt;
|- &lt;br /&gt;
| Weather.LocationPrevious&lt;br /&gt;
| Switch to previous weather location&lt;br /&gt;
|- &lt;br /&gt;
| Weather.LocationSet&lt;br /&gt;
| Switch to given weather location (parameter can be 1-3)&lt;br /&gt;
|- &lt;br /&gt;
| VideoLibrary.Search&lt;br /&gt;
| Brings up a search dialog which will search the library&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:XBMC Manual]]&lt;br /&gt;
[[Category:Python]]&lt;br /&gt;
[[Category:Addon Development]]&lt;br /&gt;
[[Category:Skin Development]]&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=NFS&amp;diff=63997</id>
		<title>NFS</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=NFS&amp;diff=63997"/>
		<updated>2013-09-04T17:31:15Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: /* Synology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;section begin=&amp;quot;intro&amp;quot;/&amp;gt;&#039;&#039;&#039;Network File System&#039;&#039;&#039;, or &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Network_File_System_%28protocol%29 NFS]&#039;&#039;&#039;, is a way to share folders over a network, and was added to XBMC in v11 (Eden). The main benefits of using NFS instead of SMB are its low protocol overhead (which allows it to send data across a network more quickly) and its use of simple [http://en.wikipedia.org/wiki/User_identifier UID&#039;s] to authenticate users rather than username/password combinations. This part bears repeating, as many people are confused on this point and try to create usernames and passwords to get XBMC to work with NFS: &#039;&#039;&#039;NFS does not use usernames or passwords as logins;&#039;&#039;&#039; it uses a UNIX-based &amp;quot;userID&amp;quot; (UID) alone.&amp;lt;section end=&amp;quot;intro&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NFS&#039;s main disadvantage in comparison to SMB (a commonly-encountered protocol in Windows environments) is that it can be more complicated to set up in some cases, since many non-technical users are unfamiliar with configuring UNIX-based protocols.&lt;br /&gt;
&lt;br /&gt;
NFS is commonly found on all Linux/UNIX distributions, as well as on OS X and Solaris, and offers several features:&lt;br /&gt;
:* It is already incorporated in UNIX-like operating systems (such as OS X), eliminating the need for additional software and services to be installed on your computer.&lt;br /&gt;
:* It allows for authentication by UID, thus eliminating the need to save usernames and passwords in XBMC source XML files (note, however, that this simple authentication also makes it more vulnerable to attacks; NFS should be only used inside a private LAN).&lt;br /&gt;
:* Once properly configured, NFS will allow your network shares to be seen and accessed by not only XBMC, but also any other machine on your network.&lt;br /&gt;
&lt;br /&gt;
;{{note|If you already have a working NFS server check that the export options required by XBMC have been set (as described in the relevant section below).}} &lt;br /&gt;
&lt;br /&gt;
When configuring NFS shares to use as network sources for XBMC&#039;s music/video libraries, use the following format: &#039;&#039;&#039;nfs://1.2.3.4/path/to/folder&#039;&#039;&#039; (where &amp;quot;1.2.3.4&amp;quot; should be replaced with the IP of your NFS server, and &amp;quot;/path/to/folder&amp;quot; should be replaced with the path to the folder you want to share; a double slash between the server and the path is wrong, you &#039;&#039;&#039;should not&#039;&#039;&#039; use nfs://1.2.3.4//path/to/folder).  See the sections below for help configuring NFS shares on various devices&#039; operating systems.&lt;br /&gt;
&lt;br /&gt;
For more info on network sources for your music and video in XBMC, see [[Types of Media Sources]].&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from Windows ==&lt;br /&gt;
Windows does not have any built-in native ability to share folders via NFS; and only a limited selection of Windows operating systems have the native ability to access NFS shares as a client.  However, several third-party solutions attempt to provide NFS functionality, on both the server side and the client side.&lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;serving&#039;&#039; (sharing) files from Windows using NFS, there seem to be three choices:&lt;br /&gt;
:* Windows Server 2003 R2 and Windows Server 2008 have built-in NFS Server and Client through Subsystem for UNIX-based Applications (SUA).  With 64-bit support, this solution supports files up to 4TB in size&lt;br /&gt;
:* [http://en.wikipedia.org/wiki/Microsoft_Windows_Services_for_UNIX Microsoft Windows Services for UNIX (SFU)] available [http://www.microsoft.com/download/en/details.aspx?id=274 here]for Windows 2000, Windows XP Professional (NOT Home edition, without a [http://www.networkedmediatank.com/showthread.php?tid=1434 hexedit hack]), Windows 2003 Server, and Windows Home Server (based on 2003 Server).  SFU is 32-bit only, which &#039;&#039;may&#039;&#039; mean it only supports files up to 2GB in size, [http://www.suacommunity.com/SUA_Tools_Env_Start.htm#_Toc203389873 according to some sources] (this is unconfirmed).  A good installation guide can be found [http://www.networkedmediatank.com/showthread.php?tid=1434 here].  Windows SFU will not install on Windows Vista or Windows 7, so there is no way to &#039;&#039;serve&#039;&#039; NFS from Windows Vista or Windows 7 with the possible exception of the haneWIN solution below, but it is unconfirmed if that works with Windows Vista/7.&lt;br /&gt;
:* [http://www.hanewin.net/nfs-e.htm haneWIN NFS Server for Windows] - a shareware program that costs 19EUR for non-commercial use.  Claims to work for &amp;quot;Windows 2000 and above.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from OS X ==&lt;br /&gt;
{{see also|NFS Manager}}&lt;br /&gt;
NFS is built into Mac OS X (OS 10.5 and later), and thus no additional software is required to set up NFS shares on a Mac OS X device.&lt;br /&gt;
&lt;br /&gt;
;{{note|The following assumes some basic knowledge of the UNIX/BSD operating system interface and environment, and assumes you are familiar with using a Mac&#039;s Terminal command-line utility.  It also assumes you have a beginner&#039;s understanding of UNIX text editors such as [http://mintaka.sdsu.edu/reu/nano.html nano] or [http://www.eng.hawaii.edu/Tutor/vi.html vi].}}&lt;br /&gt;
&lt;br /&gt;
1. To allow regular (non-root) users to connect to your NFS shared folders, you&#039;ll need to edit the &amp;quot;/System/Library/LaunchDaemons/com.apple.nfsd.plist&amp;quot; file. Open it and add the option &amp;quot;-N&amp;quot; to the startup parameters as follows: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;array&amp;gt;&lt;br /&gt;
    &amp;lt;string&amp;gt;/sbin/nfsd&amp;lt;/string&amp;gt;&lt;br /&gt;
    &#039;&#039;&#039;&amp;lt;string&amp;gt;-N&amp;lt;/string&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &amp;lt;/array&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t do this step, XBMC will only be able to access the Mac&#039;s shared NFS folders if XBMC is running as root (normally, XBMC does not run as root, so you will almost certainly want to do this first step and add the -N parameter).&lt;br /&gt;
&lt;br /&gt;
2. The NFS server and its shared folders are set up in a config file named &amp;quot;exports&amp;quot;, located in the /etc directory. Technically speaking, with NFS you &amp;quot;export a path&amp;quot; rather than &amp;quot;share a folder&amp;quot; (which is why the file is named &amp;quot;exports&amp;quot;), but we&#039;ll use the latter phrasing for simplicity&#039;s sake.&lt;br /&gt;
&lt;br /&gt;
The /etc/exports file may not yet exist; if not, you&#039;ll need to create it. The file is edited either manually (in Terminal, using a UNIX text editor such as &#039;&#039;&#039;nano&#039;&#039;&#039; or &#039;&#039;&#039;vi&#039;&#039;&#039;) or via a GUI utility, the most well-known of which is [http://www.bresink.com/osx/NFSManager.html NFS Manager]. The following guide assumes you are using Terminal (if using NFS Manager, consult that software&#039;s documentation for help).&lt;br /&gt;
&lt;br /&gt;
To view the current contents of /etc/exports, if any, execute the following command in a Terminal window:&lt;br /&gt;
&lt;br /&gt;
  &#039;&#039;&#039;cat /etc/exports&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Any folders to be shared via NFS should be listed on separate lines, along with any configuration parameters governing connections to those folders.  The lines should follow this general format:&lt;br /&gt;
  &lt;br /&gt;
  /path/to/folder_name_to_share [-parameter1 -parameter2 ...] &amp;lt;IP address restriction (optional)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Examples&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this sample /etc/exports file, we&#039;ve set up four folders to be shared via NFS, using various parameters and options.  The folders are all contained in a folder called &amp;quot;nfs_shares&amp;quot;, and are named to indicate some things about how we&#039;ve set them up; obviously, on your system, the folder names would be things like &amp;quot;video&amp;quot;, &amp;quot;music&amp;quot;, and so on.&lt;br /&gt;
&lt;br /&gt;
  /nfs_shares/allread                -ro -mapall=nobody -alldirs&lt;br /&gt;
  /nfs_shares/allwrite               -mapall=nobody -alldirs -network 192.168.1.0 -mask 255.255.255.0&lt;br /&gt;
  /nfs_shares/writeAs501             -mapall=501 -alldirs 192.168.1.5&lt;br /&gt;
  /nfs_shares/xbmcuser&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at what each of these shared folder configurations means.&lt;br /&gt;
&lt;br /&gt;
* The folder &amp;quot;&#039;&#039;&#039;/nfs_shares/allread&#039;&#039;&#039;&amp;quot; can be accessed from all computers (because no IP address is given), is read-only (&amp;quot;&#039;&#039;&#039;-ro&#039;&#039;&#039;&amp;quot;), and all incoming connections are assigned the same permissions as the UNIX user &amp;quot;nobody&amp;quot;, who has anonymous access (&amp;quot;&#039;&#039;&#039;-mapall=nobody&#039;&#039;&#039;&amp;quot;).  This last parameter ensures that anyone can access the folder, but they will not have any rights on your NFS server other than those belonging to the &amp;quot;nobody&amp;quot; user.  Also, the &amp;quot;&#039;&#039;&#039;-alldirs&#039;&#039;&#039;&amp;quot; parameter is used to indicate that incoming connections can mount either the /allread folder OR any subfolder underneath /allread.&lt;br /&gt;
&lt;br /&gt;
* The folder &amp;quot;&#039;&#039;&#039;/nfs_shares/allwrite&#039;&#039;&#039;&amp;quot; can be accessed from all computers on the subnet 192.168.1.0/255.255.255.0, has read and write permissions (we&#039;ve omitted &amp;quot;&#039;&#039;&#039;-ro&#039;&#039;&#039;&amp;quot;), and again access rights for user &amp;quot;nobody&amp;quot; are assigned (&amp;quot;&#039;&#039;&#039;-mapall=nobody&#039;&#039;&#039;&amp;quot;).  The &amp;quot;&#039;&#039;&#039;-alldirs&#039;&#039;&#039;&amp;quot; parameter is once again used to allow subfolders to be mounted directly.&lt;br /&gt;
&lt;br /&gt;
* The folder &amp;quot;&#039;&#039;&#039;/nfs_shares/writeAs501&#039;&#039;&#039;&amp;quot; can be accessed from the computer with an IP of 192.168.1.5, has read and write permissions (again we&#039;ve omitted &amp;quot;&#039;&#039;&#039;-ro&#039;&#039;&#039;&amp;quot;), and access rights belonging to users on your system with a UID of 501 (see note below) will be inherited by all incoming connections (&#039;&#039;&#039;-mapall=501&#039;&#039;&#039;).  The &amp;quot;&#039;&#039;&#039;-alldirs&#039;&#039;&#039;&amp;quot; parameter is once again used to allow subfolders to be mounted directly.&lt;br /&gt;
&lt;br /&gt;
:;{{note|As already mentioned, authentication to the NFS server is done by checking UIDs. For XBMC, this means that the UID which the XBMC process is running under is given to the NFS server to be authenticated. To find out your current UID, just type &amp;quot;id&amp;quot; into a console:}}&lt;br /&gt;
&lt;br /&gt;
         Mac:~ [&#039;&#039;your_user_name&#039;&#039;]$ &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::You should see something that begins like this:&lt;br /&gt;
&lt;br /&gt;
         uid=501(&#039;&#039;your_user_name&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
:In this example, my UID is 501. If you are going to be connecting to your NFS shared folder from XBMC on iOS, keep in mind that on iOS XBMC runs as the user &amp;quot;mobile&amp;quot;, which should have UID 501 also.  &lt;br /&gt;
&lt;br /&gt;
* The folder &amp;quot;&#039;&#039;&#039;/nfs_shares/xbmcuser&#039;&#039;&#039;&amp;quot; can be accessed from all computers (&#039;&#039;&#039;no ip given&#039;&#039;&#039;), readwrite (no &amp;quot;&#039;&#039;&#039;-ro&#039;&#039;&#039;&amp;quot;) and the access rights belonging to the UID which is connecting to the NFS server are used (&amp;quot;&#039;&#039;&#039;-mapall&#039;&#039;&#039;&amp;quot; removed).  &lt;br /&gt;
;{{note|The important effect of the absence of the -mapall parameter in this case: if someone connects to your NFS server as root, they will be running on your system as root!  Also note that because &amp;quot;-alldirs&amp;quot; is not specified, incoming connections will only be able to connect to the /xbmcuser folder, NOT any folders underneath it.}}&lt;br /&gt;
&lt;br /&gt;
Bear in mind that any UID&#039;s that are used to connect to the NFS server, or that are specified with &amp;quot;-mapall&amp;quot;, have to exist on your NFS server (i.e. on your Mac).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Each change on the exports config file needs a restart of the nfs server! Just issue &amp;quot;sudo nfsd restart&amp;quot; for this.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3.  Once you&#039;ve configured and saved your /etc/exports file, the NFS server can be started either by rebooting or by executing the following command:&lt;br /&gt;
&lt;br /&gt;
  $ sudo nfsd start&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting NFS on OS X ===&lt;br /&gt;
&lt;br /&gt;
==== -N flag is set, but shares still won’t work ====&lt;br /&gt;
&lt;br /&gt;
Sometimes there are issues with NFS shares on OS X. Most of them result in the &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; flag not being set, but they result in different error messages or issues. One of the root issues is the flag being set in the Property List file, but not read by launchd which controls the process. The following observations are pretty common in this case and if you see one of these points, it won’t hurt to either inspect the nfsd process on your Mac or restart the whole computer.&lt;br /&gt;
&lt;br /&gt;
* You have successfully shared the volume and you can mount it from other Macs in your network (via ⌘K in the Finder), but not from XBMC.&lt;br /&gt;
* You can add the computer share (e.g. &amp;lt;code&amp;gt;nfs://192.168.1.5/&amp;lt;/code&amp;gt;), but not the share that contains a path (e.g. &amp;lt;code&amp;gt;nfs://192.168.1.5/nfs_shares/allread&amp;lt;/code&amp;gt;).&lt;br /&gt;
* When you add the computer share, you can enter it in XBMC’s browser, but then clicking on one of the mount points does nothing.&lt;br /&gt;
* You see either &#039;&#039;&#039;&amp;quot;Server responded: Procedure not available&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;RPC Packet not accepted by the server&amp;quot;&#039;&#039;&#039; in the error logs.&lt;br /&gt;
&lt;br /&gt;
In most cases it’s sufficient to restart nfsd via launchd, just killing the process with &amp;lt;code&amp;gt;kill -9&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;killall nfsd&amp;lt;/code&amp;gt; after applying changes to the Property List file has no effects. To restart nfsd via launchd you have to type the following command in the Terminal:&lt;br /&gt;
&lt;br /&gt;
    sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nfsd.plist &amp;amp;&amp;amp; \&lt;br /&gt;
    sudo launchctl load /System/Library/LaunchDaemons/com.apple.nfsd.plist&lt;br /&gt;
&lt;br /&gt;
When you use &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt; to inspect the process, &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; should be visible at the end of the line. If it’s not, then launchd didn’t apply the changes and just (re-)started nfsd with the old configuration. A proper output looks like this:&lt;br /&gt;
&lt;br /&gt;
    ~  &#039;&#039;&#039;ps aux | grep nfsd&#039;&#039;&#039;&lt;br /&gt;
    root        55828   0,0  0,0  2500812   2332   ??  Ss    3:54pm   0:08.96 /sbin/nfsd &#039;&#039;&#039;-N&#039;&#039;&#039;&lt;br /&gt;
    chiefsucker 58788   0,0  0,0  2435268    496 s000  U+    7:22pm   0:00.00 grep nfsd&lt;br /&gt;
&lt;br /&gt;
Pay attention to the &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; flag being visible in the ps output. If the &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; flag is visible, but your shares don’t work, then it’s probably another issue.&lt;br /&gt;
&lt;br /&gt;
==== NFS shares stopped working after OS X upgrade ====&lt;br /&gt;
&lt;br /&gt;
If your share stopped working after you upgraded your OS (e.g. from Lion to Mountain Lion) then it usually means that the installer did overwrite the Property List file and you have to add &amp;lt;code&amp;gt;-N&amp;lt;/code&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
==== My Mac goes to sleep while playing a movie from a NFS share ====&lt;br /&gt;
&lt;br /&gt;
OS X 10.8 Mountain Lion introduced some changes that result in very aggressive sleep behaviour. Because NFS shares aren’t handled and treated like shares set from within the Sharing panel in System Preferences, OS X will ignore clients that access your NFS shares and just put it to sleep. Fortunately there are some workarounds:&lt;br /&gt;
&lt;br /&gt;
# Set &#039;&#039;&#039;Computer sleep&#039;&#039;&#039; in the Energy Saver pane of System Preferences to &#039;&#039;&#039;Never&#039;&#039;&#039;. Unfortunately this will affect the whole machine and you’ll have to put your Mac manually to sleep from now on.&lt;br /&gt;
# Get the [http://itunes.apple.com/app/caffeine/id411246225?mt=12 free Caffeine app from the Mac App Store]. The app will reside in your menu bar and you can prevent your Mac from sleeping with just one mouse-click. If you disable Caffeine (again with one click), your Mac will go to sleep as set in the System Preferences. This has the benefit of adjustable sleep behavior, i.e. you turn Caffeine on when you watch movies and you turn it off otherwise to preserve energy and save the planet.&lt;br /&gt;
# You can reach the same goal with the Terminal app &amp;lt;code&amp;gt;caffeinate&amp;lt;/code&amp;gt; that gets shipped with the OS since OS X 10.8 Mountain Lion.&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from Linux ==&lt;br /&gt;
&lt;br /&gt;
NFS sharing has been built into linux kernel for a long time.&lt;br /&gt;
&lt;br /&gt;
;{{note|This article assumes some basic knowledge of the Linux/UNIX/BSD operating-system interface and environment.}}&lt;br /&gt;
&lt;br /&gt;
The configuration of the NFS server takes place in the config file &amp;quot;/etc/exports&amp;quot;. As already mentioned, the authentication to the NFS server is done through UIDs. For XBMC, this means the UID that the XBMC process is running under is used to authenticate on the NFS server. To find out what UID XBMC is using, just type &amp;quot;id&amp;quot; into a console:&lt;br /&gt;
&lt;br /&gt;
  penix:~ [your_user_name]$ id&lt;br /&gt;
  uid=501(your_user_name)&lt;br /&gt;
&lt;br /&gt;
In this example, my UID is 501. For iOS devices, keep in mind that XBMC is running as the user &amp;quot;mobile&amp;quot;, whose UID should also be 501.&lt;br /&gt;
&lt;br /&gt;
A basic configuration for exporting a path with NFS looks like this:&lt;br /&gt;
&lt;br /&gt;
  /nfs/export &amp;lt;ip or iprange which is allowed to connect&amp;gt;(rw,all_squash,insecure)&lt;br /&gt;
&lt;br /&gt;
The important options here for use with XBMC are the &amp;quot;ip or iprange&amp;quot; and the &amp;quot;insecure&amp;quot; options. The &amp;quot;insecure&amp;quot; option is needed because we want to be able to run XBMC without root privileges. If the insecure option is not enabled, only the root user (uid 0) will have access to the nfs share. The &amp;quot;ip or iprange&amp;quot; specifies which hosts on the network will be allowed to access the exported NFS share. &lt;br /&gt;
&lt;br /&gt;
By changing some of the options of that line, we can use any of three different approaches for getting the access rights configured as we want:&lt;br /&gt;
&lt;br /&gt;
1. The option all_squash (most insecure) - all UIDs connected to the NFS server are mapped to UID 65534 (user nobody)&lt;br /&gt;
::* In this case all files which shall be accessed on the NFS exported path should have the correct rights for the user &amp;quot;nobody&amp;quot;.&lt;br /&gt;
2. Using the option &amp;quot;all_squash&amp;quot; in conjunction with the option &amp;quot;anonuid&amp;quot; and &amp;quot;anongid&amp;quot;&lt;br /&gt;
::* By adding the options &amp;quot;anonuid=501&amp;quot; and &amp;quot;anongid=501&amp;quot; all accesses would be mapped to the user with UID 501 (user &amp;quot;mobile&amp;quot; on iOS or user &amp;quot;memphis&amp;quot; in my example above)&lt;br /&gt;
3. Removing the &amp;quot;all_squash&amp;quot; option the accesses will be done with the UID given from the user which is running XBMC&lt;br /&gt;
::* So if XBMC is started with username foobar (which has UID 1000) all accesses to the NFS export path will be made with UID 1000.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Examples for exported paths:&amp;lt;/big&amp;gt;&lt;br /&gt;
  ### access from &#039;&#039;all computers&#039;&#039; (&amp;quot;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;quot;), &#039;&#039;readonly&#039;&#039; (&amp;quot;&#039;&#039;&#039;ro&#039;&#039;&#039;&amp;quot;), access for user &#039;&#039;nobody&#039;&#039; (&amp;quot;&#039;&#039;&#039;all_squash&#039;&#039;&#039;&amp;quot;)&lt;br /&gt;
  /nfs/allread   *(ro,all_squash,insecure)&lt;br /&gt;
  &lt;br /&gt;
  ### access from the subnet 192.168.1.0/255.255.255.0, &#039;&#039;read/write&#039;&#039; (&amp;quot;&#039;&#039;&#039;rw&#039;&#039;&#039;&amp;quot;), access for user &#039;&#039;nobody&#039;&#039;&lt;br /&gt;
  ### (&amp;quot;&#039;&#039;&#039;all_squash&#039;&#039;&#039;&amp;quot;).  Remember that &amp;quot;&#039;&#039;&#039;rw&#039;&#039;&#039;&amp;quot; doesn&#039;t automatically allow writes; the user &amp;quot;nobody&amp;quot; must&lt;br /&gt;
  ### have write access to the path on the filesystem.&lt;br /&gt;
  /nfs/allwrite   192.168.1.0/24(rw,all_squash,insecure)&lt;br /&gt;
  &lt;br /&gt;
  ### access from 192.168.1.5, &#039;&#039;read/write&#039;&#039; (&amp;quot;&#039;&#039;&#039;rw&#039;&#039;&#039;&amp;quot;), access for user with UID 501 (i.e. memphis, for me)&lt;br /&gt;
  ### (&amp;quot;&#039;&#039;&#039;all_squash,anonuid=501,anongid=501&#039;&#039;&#039;&amp;quot;)&lt;br /&gt;
  /nfs/writeAsMemphis   192.168.1.5(rw,all_squash,insecure,anonuid=501,anongid=501)&lt;br /&gt;
  &lt;br /&gt;
  ### access from &#039;&#039;all computers&#039;&#039; (&amp;quot;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;quot;), &#039;&#039;read/write&#039;&#039; (&amp;quot;&#039;&#039;&#039;rw&#039;&#039;&#039;&amp;quot;), access for the UID connecting to the&lt;br /&gt;
  ### NFS server (&amp;quot;&#039;&#039;&#039;all_squash&#039;&#039;&#039;&amp;quot; removed)&lt;br /&gt;
  /nfs/xbmcuser   *(rw,insecure)&lt;br /&gt;
  &lt;br /&gt;
  ### NTFS export  *SECURITY Warning: this gives the user ROOT access*&lt;br /&gt;
  ### access from the subnet 192.168.1.0/255.255.255.0, &#039;&#039;read/write&#039;&#039; (&amp;quot;&#039;&#039;&#039;rw&#039;&#039;&#039;&amp;quot;),  nfs client connects&lt;br /&gt;
  ### as root (&amp;quot;&#039;&#039;&#039;no_root_squash&#039;&#039;&#039;&amp;quot;). Otherwise, permission is for &#039;&#039;nfsnobody&#039;&#039;, (uid 65534).&lt;br /&gt;
  ### NTFS is non-POSIX permissions compliant, so you must access the share as &#039;&#039;root&#039;&#039;&lt;br /&gt;
  /nfs/NTFS_share   192.168.1.0/24(rw,&#039;&#039;&#039;no_root_squash&#039;&#039;&#039;,insecure)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The UIDs which are used to connect to the NFS server or which are specified with &amp;quot;anonuid&amp;quot; and &amp;quot;anongid&amp;quot; have to exist on the NFS server. Otherwise the filesystem permission can&#039;t be set.&lt;br /&gt;
 &lt;br /&gt;
Remember - access rights are these you give in the filesystem. &#039;&#039;&#039;After each change to the exports config file issue &amp;quot;sudo exportfs -ra&amp;quot;!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from NAS4Free 9.x (successor to legacy FreeNAS 7.x) ==&lt;br /&gt;
The information in the Linux section above also applies for *BSD based systems (such as FreeBSD). This section addresses some specific issues to bear in mind if you are using NAS4Free 9.x or FreeNAS 7.x (aka. legacy) installations.&lt;br /&gt;
&lt;br /&gt;
;{{note|FREENAS 8.3.0-RELEASE or later does not require modifying the rc.conf file for XBMC to access NFS shares. You must however enable &amp;quot;allow non-root mount&amp;quot; which can be found under the SERVICES - NFS section in the Freenas 8.3.0 web GUI.}}&lt;br /&gt;
&lt;br /&gt;
Setup your NFS shares as normal. Remember: don&#039;t create shares inside other shares. The following would be illegal...&lt;br /&gt;
  /mnt/disk                   -alldirs,quiet -mapall=root -network 192.168.1.0 -mask 255.255.255.0&lt;br /&gt;
  /mnt/disk/folder            -alldirs,quiet -mapall=root -network 192.168.1.0 -mask 255.255.255.0&lt;br /&gt;
...because the &amp;quot;/mnt/disk/folder&amp;quot; directory is already shared by &amp;quot;/mnt/disk&amp;quot;. If you remember to set the setting &amp;quot;All dirs&amp;quot; when creating your NFS shares, the flag &amp;quot;-alldirs&amp;quot; will be set. This flag allows you to mount any subdirectory of your share just as if it was a share itself. Said another way: It&#039;s not necessary to share &amp;quot;/mnt/disk/folder&amp;quot; because you can mount it through the &amp;quot;/mnt/disk&amp;quot; share.&lt;br /&gt;
&lt;br /&gt;
After having set up a standard NFS share on your NAS4Free box, you need to add a few variables to rc.conf on NAS4Free. This is done by going into System &amp;gt; Advanced &amp;gt; rc.conf .&lt;br /&gt;
Here you need to add the following:&lt;br /&gt;
  Variable                     Value              Comment&lt;br /&gt;
  mountd_flags                 -n                 Allow non-root mount requests to be served. 	  &lt;br /&gt;
  nfs_reserved_port_only       NO                 Allow for insecure ports to be used by NFS.	  &lt;br /&gt;
  nfs_server_flags             -u -t -n 4         Serve UDP and TCP with 4 servers.  &lt;br /&gt;
&lt;br /&gt;
After this, apply your changes and reboot NAS4Free. You should now be able to mount your NFS shares, as well as any subdirectory of those shares.&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from ZFSGuru ==&lt;br /&gt;
Very similar to FreeNAS solution.&lt;br /&gt;
mountd needs the -n flag.&lt;br /&gt;
In ZFSGuru you can achieve this by adding&lt;br /&gt;
  weak_mountd_authentication=&amp;quot;YES&amp;quot;&lt;br /&gt;
to /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
== NFS sharing from commercial NAS systems such as Synology or QNAP ==&lt;br /&gt;
Each NAS manufacturer, if it allows you to share folders via NFS on its NAS systems, does so in its own way.  Often this will involve setup via the NAS&#039;s control panel or administrator interface.  You can also connect to many NAS systems via ssh and manually edit files in order to set up and configure NFS (consult your NAS manual to see if this is possible/desirable/necessary).  Since most NAS systems are based on Linux/UNIX, if you need to manually edit files, you should be able to make use of the [[#NFS sharing from Linux|Linux instructions above]] to create/edit your NFS shares.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting NFS on a commercial NAS with XBMC ===&lt;br /&gt;
Your NFS server on your NAS needs to be able to allow connections on so-called &#039;&#039;&#039;unprivileged ports&#039;&#039;&#039;, which are port numbers higher than 1023.  However, most NAS&#039;s are set up by default to deny incoming NFS connections on these unprivileged ports.  This is one of the most common reasons why XBMC users experience problems when trying to connect to an NFS shared folder on a NAS.&lt;br /&gt;
&lt;br /&gt;
If you are having trouble connecting to your NFS shares on your NAS from XBMC, make sure your NFS shares have the &amp;quot;insecure&amp;quot; option enabled, which will allow connections on unprivileged ports.  To check, connect to your NAS via ssh and issue the &#039;&#039;&#039;cat /etc/exports&#039;&#039;&#039; command.  Your shared folders will each have several parameters listed separated by commas.  If the &amp;quot;insecure&amp;quot; parameter is not listed, you will need to add that parameter to the list.  This will usually involve directly editing the /etc/exports file with a UNIX text editor and adding the &amp;quot;insecure&amp;quot; option manually, although some NAS&#039;s may offer the ability to add the option via an admin interface.  Check your NAS manual for details, or explore the section below if your brand of NAS is listed.&lt;br /&gt;
&lt;br /&gt;
=== Commercial NAS NFS setup instructions ===&lt;br /&gt;
XBMC users have contributed the following NFS setup instructions for various brands of NAS devices.  If your NAS is listed below, feel free to follow the accompanying instructions to set up NFS on your system.&lt;br /&gt;
&lt;br /&gt;
==== Synology ====&lt;br /&gt;
[[File:Synology.png|link=]]&amp;lt;br /&amp;gt;&lt;br /&gt;
;{{note|You do not need to create a special user account on your Synology NAS in order to make use of NFS for XBMC.  The following guide assumes you are comfortable with using the simplest (least secure) internal setup on your NAS, which will normally be the case for the vast majority of XBMC users.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=600px heights=340px&amp;gt;&lt;br /&gt;
File:Step1.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 1:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Log in to your Synology admin control panel.&lt;br /&gt;
File:Step2.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 2:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Enable SSH (if not enabled already): Control Panel --&amp;gt; Terminal --&amp;gt; Enable SSH service --&amp;gt; {{button|OK}}&lt;br /&gt;
&lt;br /&gt;
File:Step3.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 3:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Enable NFS under Control Panel --&amp;gt; Win/MAC/NFS&lt;br /&gt;
File:Step4.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 4:&amp;lt;/big&amp;gt;&#039;&#039;&#039; NFS Services --&amp;gt; Enable NFS --&amp;gt; {{button|OK}}&lt;br /&gt;
&lt;br /&gt;
File:Step5.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 4:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Under Control Panel --&amp;gt; Shared Folder&lt;br /&gt;
File:Step6.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 6:&amp;lt;/big&amp;gt;&#039;&#039;&#039; On NFS Privileges tab select entry for the folders you want to share e.g. &#039;&#039;&#039;Movies&#039;&#039;&#039;&lt;br /&gt;
File:Step7.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 7:&amp;lt;/big&amp;gt;&#039;&#039;&#039; {{button|Create}} privileges for the selected share&lt;br /&gt;
File:Step8.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 8:&amp;lt;/big&amp;gt;&#039;&#039;&#039; As per example allow all IPs (or the desired IP for your HTPC) with &#039;&#039;&#039;read/write&#039;&#039;&#039; permissions with no mapping and enable &#039;&#039;&#039;asynchronous&#039;&#039;&#039;. The option to &#039;&#039;&#039;allow connections from non-priviledged hosts&#039;&#039;&#039; is new in DSM version 4.3-3776. With this option the following steps 10 to 14 are no longer needed. --&amp;gt; {{button|OK}}&lt;br /&gt;
File:Step9.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 9:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Press {{button|OK}}&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. On your computer, in a command line window (Terminal on a Mac, CMD on a Windows PC, etc), ssh into your Synology:&lt;br /&gt;
  &#039;&#039;&#039;ssh root@&amp;lt;&amp;lt;YOUR.SYNOLOGY.IP.ADDRESS&amp;gt;&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
11. Type in &#039;&#039;&#039;cat /etc/exports&#039;&#039;&#039; to make sure your previous steps have created exported NFS directories.  If no entries are found, go back to the previous steps and make sure you&#039;ve followed them correctly.  You should be seeing something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Step11.png|600px]]&lt;br /&gt;
&lt;br /&gt;
12. Type &#039;&#039;&#039;vi /etc/exports&#039;&#039;&#039; to edit the /etc/exports file, and change all the &amp;quot;insecure_locks&amp;quot; entries to simply read &amp;quot;insecure&amp;quot;. If you don&#039;t know vi: press the INS[SERT] key, use arrows to go to the line to edit, and delete/edit the line. Then press the ESC key, and type &#039;&#039;&#039;:x&#039;&#039;&#039; to &#039;Save &amp;amp; Exit&#039;.&amp;lt;br /&amp;gt;&lt;br /&gt;
13. Type &#039;&#039;&#039;cat /etc/exports&#039;&#039;&#039; again, and you should now see something like this (make sure it says &amp;quot;insecure&amp;quot; rather than &amp;quot;insecure_locks&amp;quot;):&lt;br /&gt;
 &lt;br /&gt;
[[File:Step15.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
14. Type &#039;&#039;&#039;exportfs -ra&#039;&#039;&#039; to initialize your newly exported directories, or reboot the NAS.&amp;lt;br /&amp;gt;&lt;br /&gt;
15. You should now be able to browse NFS and get to your exported Synology subfolders in XBMC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== QNAP ====&lt;br /&gt;
[[File:QNAP.gif|link=]]&amp;lt;br /&amp;gt;&lt;br /&gt;
;{{note|You do not need to create a special user account on your QNAP NAS in order to make use of NFS for XBMC.  The following guide assumes you are comfortable with using the simplest (least secure) internal setup on your NAS, which will normally be the case for the vast majority of XBMC users.}}&lt;br /&gt;
&lt;br /&gt;
This guide requires you to [[SSH]] into your QNAP, and also to use the terminal editor [http://en.wikipedia.org/wiki/Vi Vi] to edit files.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a couple of guides if you wish to learn more, but feel free to google for further reading: &lt;br /&gt;
&lt;br /&gt;
[http://www.tuxfiles.org/linuxhelp/vimcheat.html Vi Cheat Sheet]&lt;br /&gt;
 &lt;br /&gt;
1. Log into your QNAP admin control panel. (Web browser = IP-ADDRESS:8080).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=700px heights=340px&amp;gt;&lt;br /&gt;
File:QNAP_SSH.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 2:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Enable SSH (if not already): Network Services -&amp;gt; Telnet / SSH -&amp;gt; &#039;tick&#039; Allow SSH connection, Press {{button|Apply}}&lt;br /&gt;
File:QNAP_NFS.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 3:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Enable NFS: Network Services -&amp;gt; NFS Service -&amp;gt; &#039;tick&#039; Enable NFS Service, Press {{button|Apply}}&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery widths=600px heights=350px&amp;gt;&lt;br /&gt;
File:QNAP_Shares.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 3:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Set NFS Access Rights: Under &amp;quot;Enable NFS Service&amp;quot; Click on &amp;quot;Click here to set the NFS access right of the network share&amp;quot;&lt;br /&gt;
File:QNAP_NFS_Access.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 4:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Click on the NFS icon next to Qmultimedia (or whatever the name of your media share on the QNAP) and set Access Right to No Limit and put in the IP Address of each individual device that requires NFS connection (ATV2, Desktop, Laptop, etc.), Press {{button|Apply}}&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. On your computer, in a command line window (Terminal on a Mac, CMD on a Windows PC, etc), ssh into your QNAP:&lt;br /&gt;
  &#039;&#039;&#039;ssh admin@&amp;lt;&amp;lt;YOUR QNAP IP ADDRESS&amp;gt;&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
7. Type in &#039;&#039;&#039;cat /etc/exports&#039;&#039;&#039; to make sure your previous steps have created exported NFS directories. If no entries are found, go back to the previous steps and make sure you&#039;ve followed them correctly. You should be seeing something like this:&lt;br /&gt;
  &amp;quot;/share/MD0_DATA/Qmultimedia&amp;quot; 192.168.1.15(rw,async,no_root_squash) 192.168.1.20(rw,async,no_root_squash) &lt;br /&gt;
  &amp;quot;/share/NFS/Qmultimedia&amp;quot; 192.168.1.15(rw,nohide,async,no_root_squash) 192.168.1.20(rw,nohide,async,no_root_squash)&lt;br /&gt;
&lt;br /&gt;
8. Type &#039;&#039;&#039;vi /etc/exports&#039;&#039;&#039; to edit the /etc/exports file, and add &amp;quot;insecure&amp;quot; entries inside the brackets in front &amp;quot;rw&amp;quot;(separated with a comma &amp;quot;,&amp;quot;). If you don&#039;t know vi: press the &amp;quot;i&amp;quot; key, use arrows to go to the line to edit, and add the entries. Then press the ESC key, and type &#039;&#039;&#039;:wq&#039;&#039;&#039; to &#039;Save &amp;amp; Exit&#039;. Your exports file should now look something like this:&lt;br /&gt;
  &amp;quot;/share/MD0_DATA/Qmultimedia&amp;quot; 192.168.1.15(insecure,rw,async,no_root_squash) 192.168.1.20(insecure,rw,async,no_root_squash) &lt;br /&gt;
  &amp;quot;/share/NFS/Qmultimedia&amp;quot; 192.168.1.15(insecure,rw,nohide,async,no_root_squash) 192.168.1.20(insecure,rw,nohide,async,no_root_squash)&lt;br /&gt;
&lt;br /&gt;
9. Type &#039;&#039;&#039;exportfs -ra&#039;&#039;&#039; to initialize your newly exported directories, &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&#039;&#039;&#039;DO NOT&#039;&#039;&#039; reboot the QNAP or restart NFS via the QNAP Admin page - If you do the QNAP will overwrite the changes you just made&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=415px heights=168px&amp;gt;&lt;br /&gt;
File:QNAP_nfssetting_before.png|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 10:&amp;lt;/big&amp;gt;&#039;&#039;&#039; Now type &#039;&#039;&#039;vi /etc/config/nfssetting&#039;&#039;&#039;. You&#039;ll see something like this:&lt;br /&gt;
File:QNAP_nfssetting_after.png‎|&#039;&#039;&#039;&amp;lt;big&amp;gt;Step 11:&amp;lt;/big&amp;gt;&#039;&#039;&#039;Move your cursor to after the &#039;&#039;&#039;rw&#039;&#039;&#039; in the line &#039;&#039;&#039;/share/*****/Qmultimedia = rw&#039;&#039;&#039; (***** interchangeable with whatever yours says). Press {{keypress|i}} and add &#039;&#039;&#039;insecure&#039;&#039;&#039; separated by a &#039;&#039;&#039;,&#039;&#039;&#039; (comma). When you&#039;re done editing press {{keypress|esc}} and then &#039;&#039;&#039;:wq&#039;&#039;&#039; to save the changes and close the file. It will look something like this when finished:&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;&#039;&#039;&#039;CAUTION: If you reboot your QNAP NAS at any time after completing the steps above, but before completing the steps below, the changes you&#039;ve made will be wiped out and you will need to redo the process.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12. That should be it for getting it working.. You should now be able to browse NFS and get to your exported QNAP folders in XBMC. Now there&#039;s just a few more steps to ensure all your hard work survives a reboot/firmware upgrade.&lt;br /&gt;
&lt;br /&gt;
* We&#039;re going to edit/create an autorun script that overwrites two files from backups we&#039;re going to make.&lt;br /&gt;
&lt;br /&gt;
13. Okay, you need to make a folder to store the backup files. You need to use the absolute path in the Autorun script. Type &#039;&#039;&#039;mkdir /share/MD0_DATA/backups&#039;&#039;&#039; and press &#039;&#039;&#039;enter&#039;&#039;&#039;. (The MD0_DATA part could be different on your model, I&#039;m running a TS-509).&lt;br /&gt;
&lt;br /&gt;
14. Now type &#039;&#039;&#039;cp /etc/exports /share/MD0_DATA/backups/exports&#039;&#039;&#039; and press enter.&lt;br /&gt;
&lt;br /&gt;
15. Type &#039;&#039;&#039;cp /etc/config/nfssetting /share/MD0_DATA/backups/nfssetting&#039;&#039;&#039; and press enter.&lt;br /&gt;
&lt;br /&gt;
16. Now for the fun part. To mount the ramblock follow the procedure below. This is based on the guide here (Method 1): [http://wiki.qnap.com/wiki/Running_Your_Own_Application_at_Startup QNAP Autorun Wikiguide] &lt;br /&gt;
&lt;br /&gt;
17. Pick the method that is applicable to your QNAP model.&lt;br /&gt;
## Model TS-201: Mount the config ramblock /dev/mtdblock4: &amp;lt;pre&amp;gt;# mount -t ext2 /dev/mtdblock4 /tmp/config &amp;lt;/pre&amp;gt; &lt;br /&gt;
## Models TS-109, TS-109P, TS-110, TS-119, TS-209, TS-209P, TS-219, TS-409 (Marvell ARM), TS-419P: Mount the config ramblock /dev/mtdblock5: &amp;lt;pre&amp;gt;# mount -t ext2 /dev/mtdblock5 /tmp/config&amp;lt;/pre&amp;gt; &lt;br /&gt;
## Models TS-439, TS-509, TS-639, TS-809, TS-809U (x86): Mount the config ramblock /dev/sdx6: &amp;lt;pre&amp;gt;# mount -t ext2 /dev/sdx6 /tmp/config&amp;lt;/pre&amp;gt; &lt;br /&gt;
# Create/Edit /tmp/config/autorun.sh .&lt;br /&gt;
## either using vi: &amp;lt;pre&amp;gt;# vi /tmp/config/autorun.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
### Get vi editor into edit mode: &#039;&#039;&#039;press i&#039;&#039;&#039; &lt;br /&gt;
### Add these lines to the autorun.sh script:&lt;br /&gt;
### &#039;&#039;&#039;cp /share/MD0_DATA/backups/exports /etc/exports&#039;&#039;&#039;&lt;br /&gt;
### &#039;&#039;&#039;cp /share/MD0_DATA/backups/nfssetting /etc/config/nfssetting&#039;&#039;&#039;&lt;br /&gt;
### Exit edit mode: &#039;&#039;&#039;press ESC&#039;&#039;&#039; &lt;br /&gt;
### Save and exit: &#039;&#039;&#039;:wq&#039;&#039;&#039; &lt;br /&gt;
## or editing it using a desktop PC and e.g. SFTP &lt;br /&gt;
# Ensure that /tmp/config/autorun.sh is executable: &amp;lt;pre&amp;gt;# chmod +x /tmp/config/autorun.sh&amp;lt;/pre&amp;gt; &lt;br /&gt;
# &#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; Unmount the mounted flash partition: &amp;lt;pre&amp;gt;# cd /&amp;lt;/pre&amp;gt; &amp;lt;pre&amp;gt;# umount /tmp/config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18. Finish the linked guide, making sure to unmount the ramblock. (You will need to cd away from the /tmp/config directory to umount it.&lt;br /&gt;
&lt;br /&gt;
19. Should be done!&lt;br /&gt;
&lt;br /&gt;
[[Category:File Sharing]]&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Mac OS X]]&lt;br /&gt;
[[Category:How-to]]&lt;br /&gt;
{{frodo updated}}&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
	<entry>
		<id>https://kodi.wiki/index.php?title=File:Step8.png&amp;diff=63996</id>
		<title>File:Step8.png</title>
		<link rel="alternate" type="text/html" href="https://kodi.wiki/index.php?title=File:Step8.png&amp;diff=63996"/>
		<updated>2013-09-04T17:27:08Z</updated>

		<summary type="html">&lt;p&gt;Schapplm: Schapplm uploaded a new version of &amp;amp;quot;File:Step8.png&amp;amp;quot;: new option since DSM version 4.3-3776&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Schapplm</name></author>
	</entry>
</feed>