2012-09-15, 20:07
XBMC has evolved to allow use of a shared MySQL database to store library metadata for media files. However, it currently stores absolute paths to each entry, which makes it cumbersome for users to successfully configure clients that use different paths or protocols to reach those files and match them with the database information.
It seems to me that it would be better if, instead of absolute paths, the database could instead contain source names/aliases or numbers for each entry, along with relative paths. Then, clients could define (in sources.xml) what the base paths should be on that client for each source name/alias or number. This would allow much easier configuration of multiple clients that share a library while accessing the media files via different means.
For example, the database could contain and entry like this:
...and then one client could have this definition of movies1 in sources.xml:
...while another client can define the base path for movies1 differently:
This eliminates any confusion when the clients scan for new media to add to the library, as they see the same files and directory structure relative to the movies1 alias. This is much cleaner than using pathsubstitution (which is currently not working properly for me anyways: http://forum.xbmc.org/showthread.php?tid=140536) because it keeps the database completely agnostic with regards to what protocol, mount point, etc. is used on a particular client to reach the shared media location.
With XBMC now supporting shared database libraries and multiple file sharing protocols (SMB, NFS, UPnP, FTP, local paths, OS mount points, etc.), it really makes sense to take this next logical step towards freeing users to more easily configure a diverse network of clients that access the same media and library of metadata via these various different means.
It seems to me that it would be better if, instead of absolute paths, the database could instead contain source names/aliases or numbers for each entry, along with relative paths. Then, clients could define (in sources.xml) what the base paths should be on that client for each source name/alias or number. This would allow much easier configuration of multiple clients that share a library while accessing the media files via different means.
For example, the database could contain and entry like this:
- Movie name: Some Movie
- Source: movies1
- Relative path: Some Movie series/Some Movie.avi
...and then one client could have this definition of movies1 in sources.xml:
Code:
<source>
<name>Movies</name>
<alias>movies1</alias>
<path>/mnt/otherbox/shared/movies/</path>
</source>
...while another client can define the base path for movies1 differently:
Code:
<source>
<name>Movies</name>
<alias>movies1</alias>
<path>smb://otherbox/shared/movies/</path>
</source>
This eliminates any confusion when the clients scan for new media to add to the library, as they see the same files and directory structure relative to the movies1 alias. This is much cleaner than using pathsubstitution (which is currently not working properly for me anyways: http://forum.xbmc.org/showthread.php?tid=140536) because it keeps the database completely agnostic with regards to what protocol, mount point, etc. is used on a particular client to reach the shared media location.
With XBMC now supporting shared database libraries and multiple file sharing protocols (SMB, NFS, UPnP, FTP, local paths, OS mount points, etc.), it really makes sense to take this next logical step towards freeing users to more easily configure a diverse network of clients that access the same media and library of metadata via these various different means.