INTERACT FORUM

More => Old Versions => Media Jukebox => Topic started by: Saucepan on August 08, 2010, 09:55:04 am

Title: question for the Manage Links section (need help with building a link)
Post by: Saucepan on August 08, 2010, 09:55:04 am
I use RateYourMusic.com a lot, and wanted to build a link for quick access. I currently use one that was posted in an older thread which works pretty well, but I wanted to create something that is even more direct. It would basically eliminate a mouse click.

I just want to know if there is a way I can make spaces become underscores, and capital letters become lowercase.

For example:

I want to turn this
http://rateyourmusic.com/release/album/Down To Nothing/The Most/

into this
http://rateyourmusic.com/release/album/down_to_nothing/the_most/



This is what I have so far (don't laugh):

<Link version="1.1">
<Item Name="Name">RYM</Item>
<Item Name="Filter">[Media Type]=[Audio]</Item>
<Item Name="Action">1</Item>
<Item Name="Base URL">http://rateyourmusic.com/release/album/</Item>
<Item Name="Search URL">http:////rateyourmusic.com//release//album//Hexify([Artist])//Hexify([Album])//</Item>
</Link>
Title: Re: question for the Manage Links section (need help with building a link)
Post by: Matt on August 08, 2010, 10:02:11 am
You can use the Replace(...) and FixCase(...) functions.

More here:
http://wiki.jrmediacenter.com/index.php/Media_Center_expression_language

Thanks.
Title: Re: question for the Manage Links section (need help with building a link)
Post by: Saucepan on August 08, 2010, 10:22:40 am
FixCase made sense.

I'm having trouble with the Replace part.


(Thank you by the way)
Title: Re: question for the Manage Links section (need help with building a link)
Post by: Matt on August 08, 2010, 10:26:05 am
Try:
Replace(insert value here, / , _)

The space needs to be escaped.
Title: Re: question for the Manage Links section (need help with building a link)
Post by: Saucepan on August 08, 2010, 10:34:17 am
That worked.

But...

how to make FixCase and Replace exist/work together?

i.e.

http:////rateyourmusic.com//release//album//FixCase([Artist], 4), Replace([Artist], / , _)//FixCase([Album], 4), Replace([Album], / , _)//


What am I doing wrong here?

Title: Re: question for the Manage Links section (need help with building a link)
Post by: Matt on August 08, 2010, 10:52:52 am
I think you need to put one inside the other:
FixCase(Replace(...))
Title: Re: question for the Manage Links section (need help with building a link)
Post by: Saucepan on August 08, 2010, 11:06:50 am
Yes!

You rule.