2013-08-06, 02:56
I recently upgraded to xbmc 12.2. Previously, I was running xbmc 11
Prior to upgrading, I exported the entire library to a single file.
After upgrading (starting with a fresh home directory), I re-imported the above library export.
At this point, everything I had before is available again and accessible.
When I perform a scan, duplicates of various movies and shows start appearing.
It appears to only be limited to movies / shows which are contained in rars.
I examined the MyVideos75.db using sqlite3, and here is what I discovered:
The first column is just an id for the movie. The second column is the file id, and the third is the title.
The second path (2172) is urlquoted. I noticed in the export xml that rars appear quoted. I thought that maybe this was the issue, so I wrote a python script to iterate all of them and fix them. That did not resolve the problem.
I suppose what I could try next is to delete the database again, import and then check the db using sqlite3 to see what one is created initially, and update it to match the format of the other one.
Update
I imported the original export, and the result was the following:
Every non-alphanumeric character is urlquoted.
Then I did a scan, resulting in:
In this example, periods are not urlquoted, which explains why the paths do not match.
Update
Source: https://github.com/xbmc/xbmc/blob/abba6f...L.cpp#L758
According to the above, this url encode algorithm ignores -_.!() as per RFC1738.
It also appears that the quoted characters must be lowercase, otherwise not only do they not match, the file cannot even be found.
Prior to upgrading, I exported the entire library to a single file.
After upgrading (starting with a fresh home directory), I re-imported the above library export.
At this point, everything I had before is available again and accessible.
When I perform a scan, duplicates of various movies and shows start appearing.
It appears to only be limited to movies / shows which are contained in rars.
I examined the MyVideos75.db using sqlite3, and here is what I discovered:
Code:
sqlite> select idMovie, idFile, c00 from movie where c00 like '%jump%';
42|62|21 Jump Street
126|2172|21 Jump Street
The first column is just an id for the movie. The second column is the file id, and the third is the title.
Code:
sqlite> select * from files where idFile = 62;
62|14|rar:///media/disk/xbmc/movies/21.Jump.Street.2012.1080p.BluRay.x264-SECTOR7/s7-21.jump.street.1080.rar/s7-21.jump.street.1080.mkv|2|2013-03-17 00:00:00|2013-08-04 23:44:07
sqlite> select * from files where idFile = 2172;
2172|974|rar://%2fmedia%2fdisk%2fxbmc%2fmovies%2f21.Jump.Street.2012.1080p.BluRay.x264-SECTOR7%2fs7-21.jump.street.1080.rar/s7-21.jump.street.1080.mkv|||2012-08-26 01:01:02
The second path (2172) is urlquoted. I noticed in the export xml that rars appear quoted. I thought that maybe this was the issue, so I wrote a python script to iterate all of them and fix them. That did not resolve the problem.
I suppose what I could try next is to delete the database again, import and then check the db using sqlite3 to see what one is created initially, and update it to match the format of the other one.
Update
I imported the original export, and the result was the following:
Code:
sqlite> select idMovie, idFile, c00 from movie where c00 like '%jump%';
42|42|21 Jump Street
sqlite> select * from files where idFile = 42;
42|11|rar://%2fmedia%2fdisk%2fxbmc%2fmovies%2f21%2eJump%2eStreet%2e2012%2e1080p%2eBluRay%2ex264%2dSECTOR7%2fs7%2d21%2ejump%2estreet%2e1080%2erar/s7-21.jump.street.1080.mkv|2|2013-03-17 00:00:00|2012-08-26 01:01:02
Every non-alphanumeric character is urlquoted.
Then I did a scan, resulting in:
Code:
sqlite> select idMovie, idFile, c00 from movie where c00 like '%jump%';
42|42|21 Jump Street
126|2167|21 Jump Street
sqlite> select * from files where idFile = 42;
42|11|rar://%2fmedia%2fdisk%2fxbmc%2fmovies%2f21%2eJump%2eStreet%2e2012%2e1080p%2eBluRay%2ex264%2dSECTOR7%2fs7%2d21%2ejump%2estreet%2e1080%2erar/s7-21.jump.street.1080.mkv|2|2013-03-17 00:00:00|2012-08-26 01:01:02
sqlite> select * from files where idFile = 2167;
2167|11|rar://%2fmedia%2fdisk%2fxbmc%2fmovies%2f21.Jump.Street.2012.1080p.BluRay.x264-SECTOR7%2fs7-21.jump.street.1080.rar/s7-21.jump.street.1080.mkv|||2012-08-26 01:01:02
In this example, periods are not urlquoted, which explains why the paths do not match.
Update
Source: https://github.com/xbmc/xbmc/blob/abba6f...L.cpp#L758
According to the above, this url encode algorithm ignores -_.!() as per RFC1738.
It also appears that the quoted characters must be lowercase, otherwise not only do they not match, the file cannot even be found.