XBMC Set Videos to Watched

Posted by {"display_name"=>"greg", "login"=>"greg", "email"=>"greg@udon.org", "url"=>""} on October 16, 2013 · 1 min read

If you're importing a bunch of videos into XBMC, by default they are set as not viewed. Here's how to change that.

To change the viewed setting on import, you'll need to modify the advancedsettings.xml file. On Linux this file should be created in the /home/<user>/.xbmc/userdata directory (it does not exist by default).

Open this file and use these settings:

<advancedsettings>
    <videolibrary>
        <importwatchedstate>true</importwatchedstate>
    </videolibrary>
</advancedsettings>

This setting will set the watched state based on the value in the nfo file for each movie. Most likely, you don't have nfo files for each of your movies, to generate them, go to the XBMC user interface and select

Settings > Video > Library > Export library

You'll now have nfo files generated for all of your movies in your video directory. You then have to change the playcount setting in each nfo file:

<playcount>1</playcount>

That would be very tedious if you have a lot of files. Here's a quick Linux command to change all of the files to viewed:

sed -i 's/playcount>0</playcount>1</g' *.nfo

Finally, you now have to remove this directory as a library source and re-add it.