Database paths relative to source

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bleze Offline
Senior Member
Posts: 216
Joined: Nov 2009
Reputation: 0
Post: #1
I wanted to switch from SMB to NFS on my sources but found that XBMC started to re-scrape everything. Looking in the database it seems that full paths are saved and not saved relative to source path Sad
I understand that a source can contain multiple paths, but perhaps a dev can suggest a work around or future solution?
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 20,377
Joined: Jan 2011
Reputation: 258
Location: Arizona, USA
Post: #2
There's a few ways to do it, but one easy way (if you're using XBMC v11 Eden) is to just use path substitution.

XBMC should have asked if you wanted to update the library with the new path, though, without having to rescrape everything.

You can make easy links to the XBMC wiki using double brackets around common XBMC words: debug log = debug log, Video library = Video library, SMB = SMB , userdata = userdata, etc
(This post was last modified: 2012-03-18 21:43 by Ned Scott.)
find quote
bleze Offline
Senior Member
Posts: 216
Joined: Nov 2009
Reputation: 0
Post: #3
Thanks Ned!

It should have asked about that? Cool, but does not seem to work then. Sad

From top of my mind...

Old source containing just one path:

smb://xbmc@192.168.1.10/Video/Movies/Adults

was changed to:

nfs://xbmc:xbmc@192.168.1.10/Volume2/Video/Movies/Adults


Something weird happened though as when I changed the source it was not shown in GUI and newly created didn't appear either. I had to exit and restart XBMC every time before changes were visible (CrystalBuntu RC2). Perhaps related to the missing question (as in a badly handled exception or something?)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 10,850
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #4
Just a headsup. There is no username/password authentiacion for nfs (auth works on a different approach in nfs - see the wiki if you are interested in details...). Though it doesn't seem to harm because i just ignore that xbmc:xbmc@ bit then ...

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
bleze Offline
Senior Member
Posts: 216
Joined: Nov 2009
Reputation: 0
Post: #5
I don't think I actually had that auth part in the nfs path. I think it was added when I went back to smb to try to avoid losing my library. I had to delete rows from Paths and Movies tables in the database to get back to where I were.

Can you reproduce the problem going from smb to nfs on a source? Because it would be nice if it was possible to change between them without having to lose the database.
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 10,850
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #6
thumbnails are hashed from the fullpath ... so changing from smb to nfs will invalidate the old thumbnails ... not sure if that is what you mean... but yep in general it will give problems when changing protocols with already existing db...

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,228
Joined: Oct 2003
Reputation: 177
Post: #7
If it's done by pathsubstitution it won't - the substitution is done before we hit the filesystem, not in the fileitems themselves.

If it's done by altering the paths in the db, then it will, yup.

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: badge.gif]
find quote
nomisholman Offline
Junior Member
Posts: 2
Joined: Oct 2011
Reputation: 0
Post: #8
I would also like to see something like this, however for a completely different reason.
Every so often, I have to move folders to different drives.
This then means that I have to do an Update, which adds new entries in the Database, re-scrapes.
Then Clean which removes the missing entries. However this also deletes any associated data (ie Watched flag)

If paths were stored relative to a source path it would be possible to match up moved folders and only update the source path.
So that the files would not need to be scraped again, or any additional data (ie watched flags) would not be lost.

In addition if a missing flag was added as suggested here http://forum.xbmc.org/showthread.php?tid=122054
Auto-update could be used to handle moved files and simply update the path.
find quote
AnalogKid Offline
Fan
Posts: 648
Joined: Feb 2009
Reputation: 141
Post: #9
I do this using symlinks (on Windows)

X:\Sources\Movies
X:\Sources\Music
X:\Sources\TV Shows
X:\Sources\Music Videos

Each of the above is a symlinked folder 'pointing/linking' to wherever the REAL source is, this way, I can move my content wherever I like without affecting XBMC. The only think that MUST remain constant is the 'X' drive (or whichever drive you elect), after that you can store your media anywhere - it will also work for network (\\mynetworkdrive) paths too.

XBMC is simply configured to use the above folder sources and remains blissfully ignorant of symlinking.
find quote