MusicPlayerDaemon / mpdscribble

a MPD client which submits information about tracks being played to a scrobbler (e.g. last.fm)
GNU General Public License v2.0
114 stars 15 forks source link

Use album artist for empty artist tag #40

Closed smithjd15 closed 2 years ago

smithjd15 commented 2 years ago

Use the album artist instead if the artist tag is empty.

MaxKellermann commented 2 years ago

Doesn't compile:

../../src/Main.cxx: In member function ‘void Instance::OnMpdSongChanged(const mpd_song*)’:
../../src/Main.cxx:79:28: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
   79 |   artist = mpd_song_get_tag(song, MPD_TAG_ARTIST, 0);

Also please don't add redundant code. Make a function which returns the artist with fallbacks, and call that, instead of copying code around.

smithjd15 commented 2 years ago

Sorry, all fixed.