• 1
  • 3
  • 4
  • 5
  • 6(current)
  • 7
XBMC not deriving watched status from .nfo files
#76
I don't see the problem: Backup your database in case you want to roll back.

Update. XBMC will update your database for you. If it screws up you can always go back, but this is extremely unlikely to happen.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#77
jmarshall Wrote:I don't see the problem: Backup your database in case you want to roll back.

Update. XBMC will update your database for you. If it screws up you can always go back, but this is extremely unlikely to happen.
You mean that the new nightlies backup the database when installing over a previous version? Does this happen even if the database is in the old format (I don't remember when you switched to the new one, but I remember it happened while nightlies were not produced).
Reply
#78
I didn't say that at all.

XBMC always updates your database. It does not back it up. If you think you might want to roll back to an older release then make sure you have a back up.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#79
jmarshall Wrote:I didn't say that at all.

XBMC always updates your database. It does not back it up. If you think you might want to roll back to an older release then make sure you have a back up.
Yes, rereading you are right and I misinterpreted. Which brings me back to square one. I can't backup fully without updating first to a version that will update the database. At which point, were I to want to go back... I couldn't.

Well, I'll risk it, no big deal. Thanks for all the help and answers. Big Grin
Reply
#80
Hi,

I recently switched from Windows7/Mediacenter to Ubuntu10.04/XBMC and had the same problem with the watched-status.
In windows I used MediaCenterMaster to fetch meta-data for movies (works great!) it generates mymovies.xml files and movie.nfo files.

XBMC reads the meta-data from the .nfo/.xml files, but not the watched-status. I wrote a php-script to get the watched status from the movie.nfo/mymovies.xml files into the XBMC database.

I can post the script if anyone wants to use it (let me know!). You need a webserver on your system to run it.
Reply
#81
Sure I would like the script and a setupguide if possible?
Reply
#82
Jos123 Wrote:Hi,

I recently switched from Windows7/Mediacenter to Ubuntu10.04/XBMC and had the same problem with the watched-status.
In windows I used MediaCenterMaster to fetch meta-data for movies (works great!) it generates mymovies.xml files and movie.nfo files.

XBMC reads the meta-data from the .nfo/.xml files, but not the watched-status. I wrote a php-script to get the watched status from the movie.nfo/mymovies.xml files into the XBMC database.

I can post the script if anyone wants to use it (let me know!). You need a webserver on your system to run it.

Can we get a copy of that please Jos?
Reply
#83
Yes, that script would be fantastic! Smile
Kodi: Kodi 17.4, with Transparency!
50 TB Unraid Server: Docker Apps: SABnzbd, Sickrage, mariaDB
HTPC: Win10 (cause Steam), i7, GTX 1080
Watching on: Panasonic TC65-PS64 with lowend Sony 5.1 HTIB
Other devices: rMBP 15", MBA 13", nvidia shield
Reply
#84
How about we have a toggle in XBMC options?

Take Watched status from NFO / VDB

There seems to be alot of people here who want to take it from watched status.

It has its advantages, if you have 300 watched Movies and you lose your DB or have to do a fresh install then you have to do Mark as Watched 300 times, its a bit tedious!
Reply
#85
I have a scenario right now where it would be really handy. Recently, XBMC changed the the format of the duration field in nfo's from XXhrXXmin to XXXmin. All of my 950 or so movies were scraped using the XXhrXXmin format and now they all show whacked out durations within XBMC (many read 465461546 minutes). I have used Ember Media Manager to correct the nfos, but the only way to get the change to show in XBMC is to either manually refresh each movie (major PITA) or re-scan the library. Re-scanning the library would be the obvious choice, but then I lose all the watched statuses and would have to manually reset them.

If XBMC read the watched status from the nfo file, the solution would be easy. The sad part is that XBMC used to do this.
Reply
#86
I hate to sound like a broke record but i would love for this to be an option. Could it be made as a setting in advancedsettings.xml or something? I understand why they chanced this feature because the new way is better for alot of people but for some of us including me this would be an enormous help.
Reply
#87
Hello,
Sorry for the delay. Here's the script:

For this script you need an Apache web server on your system with Php installed. for help look at: http://www.apache.org/ and http://www.php.net/

Find the root folder for your apache server and create a new folder in it. Name it 'XBMC' or whatever. In this folder you need 3 files: index.php, synchronizePlaycount.psp and xbmc_movie_list.php
.php files are simple text files. the contents are listed below.

If you need help with php, look at: http://www.w3schools.com/php/default.asp
(it's easy! you can learn it in 1 weekend)

Now open your php-site in a browser: http://localhost/<folder name you just created>



Contents of index.php:



<!DOCTYPE HTML>
<html>
<head>
<title>XBMC Video Database</title>
</head>
<body>
<h1>XBMC Video Database</h1>
<hr>
<form action="xbmc_movie_list.php" method="post">
Path to XMBC video database:<input type="text" name="file" id="file" size="60" value=<?php echo "'".$_COOKIE["pad"]."'";?> /><br>
<br><input type="submit" value="Open Database"/>
</form><br><br>
<hr>
<p>This script iterates through the 'paths' in the xbmc-database. It looks for an [xmlFileName] in the folder (path). If this file is found, it looks for a [tagName]valueWatched[/tagName] in the file, and updates the XBMC database.
It then sets the 'playCount' field in the 'FILES' table to "1", and the 'lastPlayed' field to 'today'.</p>
<p>Make sure to set the permissions of the database file and the database-folder to read/write !!!</p>
</body>
</html>



Contents of synchronizePlaycount.psp


<!DOCTYPE HTML>
<html>
<body>

<?php
//iterate through paths
$db = new PDO('sqlite:'.$_COOKIE['pad']);
$sqlString='SELECT "idPath", "strPath"
FROM PATH
ORDER BY "strPath" ASC';
$counter=1;
$db2 = new PDO('sqlite:'.$_COOKIE['pad']);
echo 'Open Database: sqlite:'.$_COOKIE['pad']."<br>";
try {
chown($_COOKIE['pad'], "Jos");

} catch (Exception $e) {
}
echo "Begin transaction...<br>";

$db2->beginTransaction();
foreach ($db->query($sqlString) as $row){
//find xml file and update movie in database
$xmlDoc = new DOMDocument();
if ($xmlDoc->load($row['strPath']."/".$_POST['xmlFileName'])){
$x=$xmlDoc->documentElement;
foreach ($x->childNodes as $item){
if ($item->nodeName == $_POST['tagName']){
if ($item->nodeValue == $_POST['valueWatched']){
$q="UPDATE FILES SET playCount = 1, lastPlayed=date() WHERE idPath=".$row['idPath'];
}
else{
$q="UPDATE FILES SET playCount = NULL, lastPlayed=NULL WHERE idPath=".$row['idPath'];
}
echo $row['strPath']." > ".$q."<br>";
try {
$r= $db2->exec($q);

} catch (Exception $e) {
echo "fout: ";
echo $e;
}

}
}
}
$counter+=1;
}
$db2->commit();
$db=NULL;
$db=NULL;
echo '<br><br>'.$counter." movies in database synchronized with xml-files!";
echo "<br><br>";
?>
</body>
</html>


Contents of xbmc_movie_list.php


<!DOCTYPE HTML>
<?php setcookie("pad", $_POST["file"], time()+60*60*24*60);?>
<html>
<head>
<title>XBMC movie list</title>
</head>
<body>

<?php
echo "<table width='100%'><tr><td valign='top'><h1>XBMC Movie List</h1>";
echo "<i>".$_POST["file"]."</i>
</td><td align='right'>
<form action='synchronizePlaycount.php' method='post'>
Xml file name:<input type='text' name='xmlFileName' value='mymovies.xml'/><br>
Tagname:<input type='text' name='tagName' value='Watched'/><br>
Tag value watched:<input type='text' name='valueWatched' value='True'/><br>
<input type='submit' value='Write watched status to XMBC Database' />
</form></td></tr></table>
<hr>";
$db = new PDO('sqlite:'.$_COOKIE['pad']);

$sqlString='SELECT MOVIE."c00", PATH."strPath", FILES."playCount", FILES."strFilename"
FROM
MOVIE JOIN FILES ON MOVIE."idFile" = FILES."idFile" JOIN PATH ON FILES."idPath" = PATH."idPath"
ORDER BY MOVIE."c00"
';
echo "<table><tr>
<th width='350px' align='left'>Title</th>
<th align='left'>playCount</th>
<th align='left'>Path/File</th>
</tr>";
foreach ($db->query($sqlString) as $row){
echo "<tr><td>".$row['c00']."</td><td>".$row['playCount']."</td><td>".$row['strPath'].$row['strFilename']."</td></tr>";
}
echo "</table>";
$db=NULL;


?>
</body>
</html>
Reply
#88
jmarshall Wrote:If you'd exported your db to a single XML file PRIOR to updating you'd have been fine.

DAMN! Wish I had knew this yesterday... I exported to separate .nfo files, and happily noticed the .nfo contained a "playcount". So then I formatted my mediapc, installed it again (as I had fucked up some of the system), and imported the library..... Only to find out all of my TV-series and DVDs was marked 'unwatched'! :\

There really should be a "Export watched" and "Import watched"-feature in XBMC. Even if this "export to single XML file" could've solved it, nothing inside XBMC tells me this will keep track of watched media, while if exporting to separate files it will NOT.


Please, please, please. This is one feature from Team-MediaPortal which I feel I'm missing.
Reply
#89
Then they're ALWAYS set to the same thing, import twice -> you've lost any changes. It's retarded. Even so, I believe it now works that way anyway.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#90
jmarshall Wrote:Then they're ALWAYS set to the same thing, import twice -> you've lost any changes. It's retarded. Even so, I believe it now works that way anyway.
Hi! Could you clarify how this is supposed to work now? I'd hate to go about it by trial and error. Smile

Thanks!
Reply
  • 1
  • 3
  • 4
  • 5
  • 6(current)
  • 7

Logout Mark Read Team Forum Stats Members Help
XBMC not deriving watched status from .nfo files0