PDA

View Full Version : Empty Download Link



Jean-Sebastien Morisset
2005-02-14, 08:22
Hi everyone,

I'm running SlimServer v5.4 on Windows XP with iTunes. The "Server
Settings -> Music Folder" and and "Server Settings -> Playlist Folders"
are empty - I'm using just the iTunes library. My iTunes Library.xml
Location is "\\Dent\Doc\My Music\iTunes\iTunes Music Library.xml" and
my iTunes Music Folder path is "\\Dent\Music".

When I follow an artist, etc., down to a track name, there's a
"Download" link, but the HREF is empty. Here's a snippet of the HTML
source:

---
<tr>
<td class="nowrap"> Location: </td>
<td>file:////Dent/Music/Avril Lavigne/Let Go/03 Sk8er Boi.mp3 <a href="">(Download)</a> </td>
</tr>
---

I'd like that download link to be an HTTP URL so I can download the file
from other non-Windows machines.

And in a related topic, the Artwork image path only works on the Windows
XP machine. here's a snippet:

---
<td valign="top">Artwork: </td>
<td><a href="/music/file%3A%2F%2F%2F%2FDent%2FMusic%2FAvril%2520Lavign e%2FLet%2520Go%2F03%2520Sk8er%2520Boi.mp3/cover.jpg" target="cover"><img src="/music/file%3A%2F%2F%2F%2FDent%2FMusic%2FAvril%2520Lavign e%2FLet%2520Go%2F03%2520Sk8er%2520Boi.mp3/cover.jpg"></a></td>
</tr>
---

Any way to turn this into an HTTP URL also?

Thanks!
js.
--
Jean-Sebastien Morisset, Sr. UNIX Administrator <jsmoriss (AT) mvlan (DOT) net>
Personal Home Page <http://jsmoriss.mvlan.net/>
JS & Melanie's Homebrewery <http://brewery.mvlan.net/>
Underwater and Travel Photographs <http://www.mvpix.com/>

Jean-Sebastien Morisset
2005-02-14, 13:50
Everyone,

I did some digging and found something in Slim/Web/Pages.pm:

---
my $downloadurl;
if (Slim::Music::Info::isHTTPURL($song)) {
$downloadurl = $song;
} else {
my $loc = $song;
if (Slim::Music::Info::isFileURL($song)) {
$loc = Slim::Utils::Misc::pathFromFileURL($loc);
}
my $curdir = Slim::Utils::Prefs::get('audiodir');
if (!$curdir) {
$downloadurl = undef;
} elsif ($loc =~ /^\Q$curdir\E(.*)/i) {
$downloadurl = '/music';
foreach my $item (splitdir($1)) {
$downloadurl .= '/' . Slim::Web::HTTP::escape($item);
}
$downloadurl =~ s/\/\//\//;
} else {
$downloadurl = $loc;
}
}
---

I have a few questions... How can $song contain an HTTP URL? Since I'm
using iTunes, I assume $song contains a Windows compatible path. Since
my 'audiodir' is empty (I'm using iTunes exclusively), then $downloadurl
is undef'ed.

So, how can I configure SlimServer to populate that $downloadurl
variable with an HTTP URL?

Thanks,
js.

On Mon, Feb 14, 2005 at 10:22:51AM -0500, Jean-Sebastien Morisset wrote:
> Hi everyone,
>
> I'm running SlimServer v5.4 on Windows XP with iTunes. The "Server
> Settings -> Music Folder" and and "Server Settings -> Playlist Folders"
> are empty - I'm using just the iTunes library. My iTunes Library.xml
> Location is "\\Dent\Doc\My Music\iTunes\iTunes Music Library.xml" and
> my iTunes Music Folder path is "\\Dent\Music".
>
> When I follow an artist, etc., down to a track name, there's a
> "Download" link, but the HREF is empty. Here's a snippet of the HTML
> source:
>
> ---
> <tr>
> <td class="nowrap"> Location: </td>
> <td>file:////Dent/Music/Avril Lavigne/Let Go/03 Sk8er Boi.mp3 <a href="">(Download)</a> </td>
> </tr>
> ---
>
> I'd like that download link to be an HTTP URL so I can download the file
> from other non-Windows machines.
>
> And in a related topic, the Artwork image path only works on the Windows
> XP machine. here's a snippet:
>
> ---
> <td valign="top">Artwork: </td>
> <td><a href="/music/file%3A%2F%2F%2F%2FDent%2FMusic%2FAvril%2520Lavign e%2FLet%2520Go%2F03%2520Sk8er%2520Boi.mp3/cover.jpg" target="cover"><img src="/music/file%3A%2F%2F%2F%2FDent%2FMusic%2FAvril%2520Lavign e%2FLet%2520Go%2F03%2520Sk8er%2520Boi.mp3/cover.jpg"></a></td>
> </tr>
> ---
>
> Any way to turn this into an HTTP URL also?
>
> Thanks!
> js.
--
Jean-Sebastien Morisset, Sr. UNIX Administrator <jsmoriss (AT) mvlan (DOT) net>
Personal Home Page <http://jsmoriss.mvlan.net/>
JS & Melanie's Homebrewery <http://brewery.mvlan.net/>
Underwater and Travel Photographs <http://www.mvpix.com/>