Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow scrobbling from internet radio streams #21

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

christopher-fu
Copy link

Oone feature that would be pretty cool would be the ability to scrobble tracks from internet radio streams. Right now mpdas only pulls metadata from the ID3 tags associated with the music file using libmpdclient, but there is no such data associated with a stream url. Instead, mpd picks up that data as it streams music from the url. If the currently playing song's title provided by the stream is well-formed (i.e., in the format "Artist - Song Title"), we can parse that and use that to scrobble the song.

@troxor
Copy link

troxor commented Nov 21, 2015

This is great. Thank you!

@troxor
Copy link

troxor commented Jan 9, 2016

After running for a while, I noticed some memory leakage...

==29704== LEAK SUMMARY:
==29704==    definitely lost: 25,441,600 bytes in 79,505 blocks
==29704==    indirectly lost: 13,475,549 bytes in 238,477 blocks
==29704==      possibly lost: 29,958 bytes in 259 blocks
==29704==    still reachable: 2,930 bytes in 38 blocks
==29704==         suppressed: 0 bytes in 0 blocks

I'll keep investigating this unless someone else beats me to it.

@christopher-fu
Copy link
Author

I believe 10a4b0f fixes the memory leak.

@troxor
Copy link

troxor commented Jan 13, 2016

Indeed it does! However, this PR reintroduces the leak. Moving mpd_song_free(song); on mpd.cpp:133 down a couple lines to the same scope as mpd_song *song = mpd_run_current_song(_conn); will clear it up. At least, it worked for me.

@christopher-fu
Copy link
Author

The last merge should have included the fix.

@f1u77y
Copy link

f1u77y commented Sep 14, 2016

What's status of this PR? valgrind does output many errors and reports memory leaks for me.
I've fixed radio streams scrobbling in another way(https://github.com/f1u77y/mpdas/commits/handle-streams) when I didn't know about this. Should I make another PR on this or wait for merging this one?

@christopher-fu
Copy link
Author

You should definitely submit another PR. I wrote this a while back to solve a problem I had with a certain internet radio stream, and it might not (probably won't?) work for your use case. I also haven't looked closely at any memory leaks other than merging any fixes into my fork.

Christopher Fu added 5 commits August 9, 2017 15:57
parseSongTitle will be used to parse song titles in the format "Artist -
Song Title" into the artist name and song title.

Tests use the Catch C++ testing framework.
When playing an internet radio stream, the artist and song title cannot
be pulled from ID3 tags, but if the stream title shows the current song
in the format "Artist - Title" (which is common with most streams), we
can parse that and scrobble the song.
@YuyQuan
Copy link

YuyQuan commented Sep 5, 2018

I'm having issues with this. Here is a screenshot me listening to a local file and then internet radio. The local file goes through but not the song "DOT.EXE - :delta"

screen shot 2018-09-05 at 6 33 33 pm

my .mpdasrc is just my username and password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants