[patch] artist streaming

Locked
Superlexx
User
Posts: 45
Joined: Thu Feb 10, 2005 8:51 pm

[patch] artist streaming

Post by Superlexx »

this patch adds artist streaming to 3.67 and also removes the Arists:

Code: Select all

diff netjukebox3.68/browse.php netjukebox3.67/browse.php
251c251
< $allow = authenticate('access_browse');
---
> authenticate('access_browse');
304d303
< 	<td></td><!-- optional stream -->
319d317
< 	<td><?php if ($allow['access_play']) echo '<a href="stream.php?command=playlist&artist=' . rawurlencode($album['artist']) . '" onMouseOver="return overlib(\'Stream artist\');" onMouseOut="return nd();"><img src="bitmap/small_stream.gif" alt="" width="21" height="21" border="0"></a>'; ?></td>
513d510
< 	<td></td><!-- optional stream -->
515c512
< 	<td><a href="<?php echo $url; ?>&order=artist&sort=<?php echo $sort_artist; ?>">Artist<?php echo $order_bitmap_artist; ?></a></td>
---
> 	<td><a href="<?php echo $url; ?>&order=artist&sort=<?php echo $sort_artist; ?>">Arist<?php echo $order_bitmap_artist; ?></a></td>
539d535
< 	<td><?php if ($allow['access_play']) echo '<a href="stream.php?command=playlist&album_id=' . $album['album_id'] . '" onMouseOver="return overlib(\'Stream album\');" onMouseOut="return nd();"><img src="bitmap/small_stream.gif" alt="" width="21" height="21" border="0"></a>'; ?></td>
599c595
< 	<a href="<?php echo $url; ?>&mode=thumbnail&order=artist&sort=<?php echo $sort_artist; ?>">Artist<?php echo $order_bitmap_artist; ?></a>
---
> 	<a href="<?php echo $url; ?>&mode=thumbnail&order=artist&sort=<?php echo $sort_artist; ?>">Arist<?php echo $order_bitmap_artist; ?></a>

diff netjukebox3.68/stream.php netjukebox3.67/stream.php
34d33
< $artist			= urldecode(get('artist'));
36c35
< if ($command == 'playlist')	playlist($artist, $album_id, $track_id);
---
> if ($command == 'playlist')	playlist($album_id, $track_id);
47c46
< function playlist($artist, $album_id, $track_id)
---
> function playlist($album_id, $track_id)
60,68c59
< if ($artist)
< 	{
< 	echo '#' . $artist . "\r\n";
< 	$query 	= mysql_query('SELECT SUM(playtime_miliseconds) AS sum_playtime FROM track WHERE artist = "' . mysql_escape_string($artist) . '"');
< 	$track	= mysql_fetch_array($query);
< 	$expire	= time() + round($track['sum_playtime'] / 1000) + 3600;
< 	$query	= mysql_query('SELECT artist, title, playtime_miliseconds, track_id FROM track WHERE artist = "' . mysql_escape_string($artist) . '" ORDER BY relative_file');
< 	}
< elseif ($album_id)
---
> if ($album_id)
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

Superlexx, thanks very much for your code.
When I start coding netjukebox 3.68 I will add something like this.
And of cource the same thing for Playback.

There are two ways to select an artist.
I would say select artist from album is the best way.
What do you think?

When select artist from tracks, (your example) mixed or compilation albums are not streamed.

Code: Select all

Not streamed: Deep dish\199908 – Yoshiesque\Atmosfear - Dancing in outer space (the maw accapella).mp3
Not streamed: Deep dish\199908 – Yoshiesque\Jark prongo - Jark prongo wave 2081.mp3
Streamed: Various\Singles\Deep dish - Flashdance (original mix).mp3
When select artist from album, mixed albums are streamed.

Code: Select all

Streamed: Deep dish\199908 – Yoshiesque\Atmosfear - Dancing in outer space (the maw accapella).mp3
Streamed: Deep dish\199908 – Yoshiesque\Jark prongo - Jark prongo wave 2081.mp3
Not streamed: Various\Singles\Deep dish - Flashdance (original mix).mp3
Superlexx
User
Posts: 45
Joined: Thu Feb 10, 2005 8:51 pm

Post by Superlexx »

hm, I think I like selecting from artist better :D
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

Superlexx wrote:hm, I think I like selecting from artist better :D
Do you mean: I think I like selecting from track better
And it is gonne be that way :D
I have decided to add artist playback/streaming on the bottom of view3all().
It is a little bit more complicated but more flexible.
This way it is also possible to stream titles and change the sort order.
Of course you are free to add it also to another places in browse.php :wink:
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

Hello Superlexx,

Track and title streaming is now intergrated in netjukebox 3.68 :D
If you also want to add track streaming to view1() add something like this:

Code: Select all

'<a href="stream.php?command=playlist&artist=' . htmlentities($artist) '&order=title&sort=asc" target="dummy" onMouseOver="return overlib(\'Stream artist\');" onMouseOut="return nd();"><img src="bitmap/small_stream.gif" alt="" width="21" height="21" border="0"></a>'
Locked