PDA

View Full Version : Duplicate episodes on "Scan for New Content"


Mouton
2008-10-07, 14:22
(This seems to have started after the Atlantis beta 2 upgrade. Running on Xbox.)

When I am in Library mode, in the list of TV Shows, if I select 'Scan for new content' for a specific TV Shows, the number of episodes will increase by as many episodes I have of that show. So if I have 2 Mythbustes shows, and I scan for new content, I'll end up with 4 episodes (each episode is doubled). If I scan for new content again, I end up with 3 times each episode, and so on.
To make the duplicates disappear (they don't show if I have 'stack duplicate episodes' slected), I can select an episode, go in "Episode Information" and select "Refresh". This will make the duplicates for that particular Episode disappear. I can repeat for all duplicated Episodes, but then, if I "Rescan for New Content" again, I'll get more duplicates.

Any pointer as to where to look for the problem? Or what I could try to make this problem go away?
Maybe I could transfer the (SQLite?) library DB from the Xbox to my PC, and check what's happening in there..?

- Mouton

vdrfan
2008-10-07, 14:26
debug log please ..

Mouton
2008-10-07, 15:40
Here's before and after XML (for only one tvshow) exports of the library, where I 'Scan for new content' twice for this show (which is supposed to show only 2 episodes).

http://pub.abuserz.com/xbmc-library-before.xml

http://pub.abuserz.com/xbmc-library-after.xml

Mouton
2008-10-07, 15:45
http://pub.abuserz.com/xbmc-debug-mouton.log

Mouton
2008-10-07, 17:21
From the debug log:
08:43:31 M: 17600512 DEBUG: CVideoDatabase::GetEpisodeId (smb://xbox:temp@192.168.1.8/TV Shows/La Cour des grands/La Cour des grands - 080928 - Music hall - Series Premiere.mpg), query = select idEpisode from episode where idFile=1374

So I tried looking in the MyVideo DB:
sqlite> select * from files where strFilename like 'La Cour des grands%';
1374|163|La Cour des grands - 080928 - Music hall - Series Premiere.mpg
1375|163|La Cour des grands - 081005 - Big Bazar.mpg
sqlite>

Those files are only there once.
But there are multiple episodes for each:

sqlite> select * from episode where idFile=1374;
545|Music hall - Series Premiere|||0.000000||2008-09-28|||||||1|1||-1|-1|-1||||1374
646|Music hall - Series Premiere|||0.000000||2008-09-28|||||||1|1||-1|-1|-1||||1374
897|Music hall - Series Premiere|||0.000000||2008-09-28|||||||1|1||-1|-1|-1||||1374
899|Music hall - Series Premiere|||0.000000||2008-09-28|||||||1|1||-1|-1|-1||||1374
sqlite> select * from episode where idFile=1375;
546|Big Bazar|||0.000000||2008-10-05|||||||1|2||-1|-1|-1||||1375
647|Big Bazar|||0.000000||2008-10-05|||||||1|2||-1|-1|-1||||1375
898|Big Bazar|||0.000000||2008-10-05|||||||1|2||-1|-1|-1||||1375
900|Big Bazar|||0.000000||2008-10-05|||||||1|2||-1|-1|-1||||1375
sqlite>

vdrfan
2008-10-07, 17:23
I've just tried to reproduce this using a a custom episode nfo, but its working as expected here. Please try again using a fresh database and report back.

Mouton
2008-10-07, 17:54
I found the problem looking at the source code.
When CVideoDatabase::GetEpisodeId receives season and episode hints (found in the filename), and they don't match what is in the nfo file, it will return -1, and thus a new episode will be added in the MyVideo DB.

I'll let a developer answer if this requires a fix, and if so, how he wants to fix this, but my suggestion would be to send the nfo episode & season information to GetEpisodeId, not the values found in the filename, as those might be incorrect (as is my case, where a YYMMDD timestamp in the filename is incorrectly interpreted as SSSSEE).

jmarshall
2008-10-07, 22:57
Please provide a set of files that allows us to reproduce. This allows:

1. Us to quickly reproduce so we can see about a fix.
2. A testcase so that we can assure that we don't get regressions at a later date.

Post a trac report and attach all information, including an example filesystem (dummy files for .avi's etc. are fine)

Thanks,
Jonathan

Mouton
2008-10-07, 23:17
Done: http://xbmc.org/trac/ticket/5112