Personal Video Database

English => Support => Topic started by: kmickeletto on August 07, 2010, 04:26:59 am

Title: [SOLVED] Variable for FileName
Post by: kmickeletto on August 07, 2010, 04:26:59 am
Hi, I use PVD to manage my video collection and I export to XML for my Roku box (Roksbox application).  I have had a continual issue with the <path> section.  The default script creates the path with the drive letter intact.  When passing the XML file to a my Roku which is technically a HTTP client, it pukes using the path with the drive letter.

I noticed I can modify the results of the XML file that is built by playing with the XML (Movies).ptm file.  My problem is, I can't seem to find a variable that just has the filename instead of the filename and path.  Can anyone help?

Thanks so much!
Ken
Title: Re: Variable for FileName
Post by: rick.ca on August 07, 2010, 05:01:08 am
Welcome, Ken.

<path>{#StringReplace '{%value=path}' 'D:' '')}</path> works—assuming all your files are on one drive ('D:'). If not, I don't know...maybe the function can be nested.
Title: Re: Variable for FileName
Post by: kmickeletto on August 07, 2010, 04:19:41 pm
Perfect!  That was exactly what I was looking for.  I did find stuff about stringreplace on the forum, but I just wasn't sure how to implement it.   I ended up making a slight change to your example and it is working perfectly.  Thanks!

Code: [Select]
<path>{#StringReplace '{%value=path}' 'F:\Roku\movies\' 'movies/')}</path>
Title: Re: Variable for FileName
Post by: svenne on August 08, 2010, 11:43:16 am
Maybe the second function here might be more reliable... easier to deal with different drives and paths:
ExtractFileName
see here:
http://www.videodb.info/help/hlp_export.html#functions

I think the following should work, but I didn't test it. If you're satisfied with your solution, then you just might want to keep it your way... nevertheless:
Code: [Select]
<path>movies/{#ExtractFileName '{%value=path}'}</path>