Ok, I pushed a fix. Essentially, it does the following:

* Try to parse as:
```
#EXTINF:<duration>,<artist> - <title>
```
If any of `artist` or `title` contains the string `" - "` then it falls back to 
parsing:
```
#EXTINF:<duration>,<song>
```
`song` is a metadata that is used in `output.{icecast,shoutcast}` `mp3` 
metadata. It is otherwise discarded, which should allow metadata from the file 
to take precedence with other formats. This is pretty much inline with the 
historic relationship between `m3u` playlists and `icy` metadata format from 
`shoutcast`.

The only alternative would be to parse as:
```
#EXTINF:<duration>,<title>
```
In the ambiguous case but I'm reluctant to do so since we already know that 
there's a good chance this will contain the artist string and thus be incorrect.

Finally, here are the result of the updated parsing:
```
# parse_extinf "#EXTINF:177,ABBA - Money, Money, Money";;
[("artist", "ABBA"); ("title", "Money, Money, Money")]
# parse_extinf "#EXTINF:233,Aerosmith - Pink";;
[("artist", "Aerosmith"); ("title", "Pink")]
# parse_extinf "#EXTINF:160,Blink-182 - California";;
[("artist", "Blink-182"); ("title", "California")]
# parse_extinf "#EXTINF:233,My hot artist - feat. DJ. fancy pants - I looked 
for you at the store -- but you weren't there";;
[("song",
  "My hot artist - feat. DJ. fancy pants - I looked for you at the store -- but 
you weren't there")]
``` 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/625#issuecomment-422824134
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to