Getting duplicate items when sharing library between instances
#1
Hi there,

It seems I am getting duplicate items into my library probably because of pathsubstitution or something of that sort.
Let me first describe my setup and what I did.

I have a HTPC running my MySQL server, hosting some of the files (3x1TB in Raid 5, ubuntu 12.04, installed xbmc from apt-get), has two external HDDs connected via USB.

I also have a Windows 7 machine that hosts some more movies+tv shows (shares them via normal windows share/smb) and a macbook pro (which hosts nothing, but i'de like to be able to stream from either the windows/linux machines through a local xbmc installation).

What I did was start with a completely empty library, clean and new, and started adding files with smb:// shares (even the local files). That way even files that are hosted locally are submitted via a smb link. I also added this to my advancedsettings.xml (on the HTPC):
Code:
<pathsubstitution>
                <substitute>
                        <from>smb://htpc/Media/</from>
                        <to>/home/ken/Videos/</to>
                </substitute>
        </pathsubstitution>
So when I decide to play a file, it would run off normal filesystem, and not through the samba service.
However this made me get duplicate movies for everything.. for example querying the MySQL tables here is an example:

Code:
mysql> select idMovie, idFile,c00, c22 from movie where c00 LIKE '%21%';
+---------+--------+----------------+---------------------------------------------------------------------------------+
| idMovie | idFile | c00            | c22                                                                             |
+---------+--------+----------------+---------------------------------------------------------------------------------+
|       4 |      4 | 21 Jump Street | smb://htpc/Media/Movies/21.Jump.Street.2012.720p.BluRay.x264-Felony [PublicHD]/ |
|     198 |    360 | 21 Jump Street | /home/ken/Videos/Movies/21.Jump.Street.2012.720p.BluRay.x264-Felony [PublicHD]/ |
+---------+--------+----------------+---------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

My questions are as followed:
1) If i want the play movies (that are hosted on HTPC) from the windows/mac instances, should the main library (HTPC) include files locally or through the smb share?
2) Why does using pathsubstituion cause these duplicates? Or maybe I am misunderstanding the purpose of these pathsubstitutions.
On which machines should I use pathsubstitution ,and one which shouldn't I?
3) Where does pathsubstituion take effect? when reading the file itself?

Another wierd observation I had is this; when viewing my movie list, I know have '21 Jump Steet' listed twice, if I choose one and press 'I' (Information) I see the details and the filename as the smb://htpc/Movies/..blabla/ (on the htpc instance itself). If I choose the second listed movie and press 'I', nothing happens - but i know its the filename home /home/ken/Videos/blablabla because I can see it in the MySQL.

my sources.xml in case it might help:
Code:
<video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1">smb://htpc/Media/Movies/</path>
        </source>
        <source>
            <name>Documentaries</name>
            <path pathversion="1">smb://HTPC/Media/Documentaries/</path>
        </source>
        <source>
            <name>Stand Up</name>
            <path pathversion="1">smb://HTPC/Media/Stand Up/</path>
        </source>
        <source>
            <name>TV Series</name>
            <path pathversion="1">smb://HTPC/Media/TV Series/</path>
        </source>
        <source>
            <name>Nessi Movies</name>
            <path pathversion="1">smb://NESSI/Media/Movies/</path>
        </source>
        <source>
            <name>Nessi TV Shows</name>
            <path pathversion="1">smb://NESSI/Media/TV Shows/</path>
        </source>
    </video>
Reply
#2
(2012-10-20, 17:36)kens Wrote: Hi there,

It seems I am getting duplicate items into my library probably because of pathsubstitution or something of that sort.

XBMC uses the file location to determine whether file1 is different from file2. With a shared MySQL database it's possible that you're creating 2 sources for the same file when one of the machines uses path substitution. XBMC will then add both/home/ken/video/file1 and smb://server/video/file1. Just use SMB on all machines..there's really no reason for path substitution other than to share thumbnails. I'm not exactly sure how the scanner works with path substitution but if you don't have the local path listed in sources.xml it shouldn't add entries for the local paths...perhaps one of the devs. Perhaps if you edit the video source and mark it to NOT scan for new content it should only have the SMB entry from the main server.

Ken S

Mythbuntu doesn't need viruses - we have Sudo
Reply
#3
Thanks for your reply Dobyken.
I didn't add any more sources from any other instance, i'm still only working on the HTPC (which also hosts some files and the MySQL). It seems that by simply adding the pathsubstitution XML it started adding duplicates.
Also, I don't see a point to reading an entire movie through the SMB service when the file is hosted locally.. so I don't want to simply drop the pathsubt. and keep everything over smb. [I'll leave the smb to do it's work with the machines that don't host the files].


Ken.
Reply
#4
Can anyone else help with this issue or guide me in the right direction?
Reply
#5
Well, assuming you've done everything right, and it looks like you have, this could just be some weird bug. I'll try to replicate the issue on my side, but I have to get my MySQL server working again.
Reply

Logout Mark Read Team Forum Stats Members Help
Getting duplicate items when sharing library between instances0