HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: ghostface on 2024-03-25 14:29:13

Title: Foobar stream custom columns
Post by: ghostface on 2024-03-25 14:29:13
Hi!

I have a problem with custom columns. I use this command:
Code: [Select]
$if(%isplaying%, >>> %filename%, %filename%) $if($stricmp($left(%path%,7),'http://'), %artist% - %title%) $if($stricmp($left(%path%,8),'https://'), %artist% - %title%))
This works fine for local files but not for streams.
When I listen to a stream I see this in the playlist (http://nap.casthost.net:8878/;stream.mp3): ;stream Killarmy - Red Dawn [1998]
But this is what i want to see: Killarmy - Red Dawn [1998]
And if I'm not listening to a stream, I see this: ;stream ? - GtronicRadio
But this is what i want to see: GtronicRadio

Can anyone help me with this?
Title: Re: Foobar stream custom columns
Post by: anamorphic on 2024-03-26 10:44:45
The %filename% is the part that returns ";stream" - you can see it there at the end of the URL - ";stream.mp3". So remove the two %filename%.

Also not sure why you need two $if functions for http:// and https:// when they both do the same - just the first one is enough.
Title: Re: Foobar stream custom columns
Post by: ghostface on 2024-03-26 15:05:15
The two %filename% are required for local files, and the second $if function for https streams.
Title: Re: Foobar stream custom columns
Post by: Defender on 2024-03-26 21:41:05
Hi!

I have a problem with custom columns. I use this command:
Code: [Select]
$if(%isplaying%, >>> %filename%, %filename%) $if($stricmp($left(%path%,7),'http://'), %artist% - %title%) $if($stricmp($left(%path%,8),'https://'), %artist% - %title%))
This works fine for local files but not for streams.
When I listen to a stream I see this in the playlist (http://nap.casthost.net:8878/;stream.mp3): ;stream Killarmy - Red Dawn [1998]
But this is what i want to see: Killarmy - Red Dawn [1998]
And if I'm not listening to a stream, I see this: ;stream ? - GtronicRadio
But this is what i want to see: GtronicRadio

Can anyone help me with this?

Get rid of the ; before stream. Stream works fine without it. Change "%artist% - %title%" with "[%artist% - ]%title%".
When streaming %artist% is only known when actually playing.
When streaming %title% has actual title of the playing song when actually playing, otherwise it has the station name.
Title: Re: Foobar stream custom columns
Post by: ghostface on 2024-03-27 16:35:10
Thx!

I managed to solve it based on your answer.

Code: [Select]
$if(%isplaying%, >>> $if3($if($stricmp($left(%path%,7),'http://'),[%artist% - ]%title%),$if($stricmp($left(%path%,8),'https://'),[%artist% - ]%title%),%filename%),$if3($if($stricmp($left(%path%,7),'http://'),[%artist% - ]%title%),$if($stricmp($left(%path%,8),'https://'),[%artist% - ]%title%),%filename%))

Works for local files and streams.
Title: Re: Foobar stream custom columns
Post by: Defender on 2024-03-27 17:56:53
Thx!

I managed to solve it based on your answer.

Code: [Select]
$if(%isplaying%, >>> $if3($if($stricmp($left(%path%,7),'http://'),[%artist% - ]%title%),$if($stricmp($left(%path%,8),'https://'),[%artist% - ]%title%),%filename%),$if3($if($stricmp($left(%path%,7),'http://'),[%artist% - ]%title%),$if($stricmp($left(%path%,8),'https://'),[%artist% - ]%title%),%filename%))

Works for local files and streams.

You are welcome.

BTW. I differentiate streams not by checkling for http:// or https:// but by $if($strstr(%path%),//),STREAM,OTHER) . You cannot use a single / since youtube sources use single / as well.